Accessing Spring Boot Actuator metrics programmatically

Suppose you have Spring Boot actuator in your application, and you want to access metrics programmatically. Or you want to gather a lot of system/application metrics initially. After you enable the Spring Boot actuator in your application (https://www.baeldung.com/spring-boot-actuators), just autowire all actuator auto wire candidates: You can use them like this: That’s all.

READ MORE

REST endpoint stub in Java

Making a REST server Let me remind you that earlier we talked about setting up a REST server for unit tests in JUnit. We will also be using the WireMock tool today. Information about adding WireMock to the project can be found in the previous article. Configuring server parameters For HTTP: For HTTPS: To use […]

READ MORE

REST endpoint stub in JUnit

Suppose you want to test method X. It requests data from a specific endpoint Y. In this article, we’ll talk about three things: how to start a REST server within a unit test; how to set up data transmission on Y; how to check the number of requests received on Y. For information on how […]

READ MORE