Skip to content
Advertisement

Tag: micronaut

Micronaut test in docker overriding the MICRONAUT_ENVIRONMENTS

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

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

Advertisement