We run our micronaut integration tests in the cloud in a docker container We’re setting the MICRONAUT_ENVIRONMENTS=staging in the docker environment variables, to force our application to read the config values from application-staging.yaml. However, micronaut is automatically adding “test” as an environment, and then read the config values from application-test.yaml. From the docs (https://docs.micronaut.io/2.2.1/guide/index.html#propertySource), environment variables should have priority compared
Tag: micronaut
Is there a way to stop a micronaut scheduled job between tests?
I have an application that dynamically schedules jobs based on properties. It listens for the ServiceReadyEvent and then schedules the job. Below is a small example that would get added to the context via a factory. To test this code I have a Micronaut test, using kotest. I also have a second test for another job My problem lies in
micronaut @RequestScope – not creating bean per incoming http-request
I have a class the following class as RequestScope bean: The idea is to have an object containing the REST request level custom data accessible across the application, the scope of the this obviously should be within the current request. This can be used for say.. logging – whenever devs log anything from the application, some of the request meta
Micronaut HTTP Client – Deserialize generic type – For API Testing
For API testing I have to parse the response of a request using io.micronaut.http.client.HttpClient I prefer to use the format given below. But It is not working. I am getting type cast error while trying to fetch User from response Currently I am using ObjectMapper (Jackson) like given below, Is there any way to use TypeReference directly with HttpClient retrieve
Is there an equivalent for Springs Resource in Micronaut?
I am migrating a tiny Spring Boot application to Micronaut 1.0.1 and I was wondering if there is an equivalent for org.springframework.core.io.Resource and their implementation such as ClasspathResource? In Spring Boot I inject a resource into a service using its constructor. How can I do this in Micronaut? Answer In Micronaut you can use io.micronaut.core.io.ResourceLoader variants, such as io.micronaut.core.io.scan.ClassPathResourceLoader or