Questions tagged [micronaut-test]
23 questions
0
votes
0 answers
Micronaut mongo test resources doesn't start docker container
I have a project of the following…

goncharovmvdev
- 33
- 3
0
votes
2 answers
How to select the correct TransactionManager when using R2DBC together with Flyway and JDBC
Setup:
micronaut 3.7.2
micronaut-data 3.8.1, micronaut-data-r2dbc, r2dbc-postgresql 0.9.2
Flyway 8.5.13, micronaut-jdbc-hikari, micronaut-flyway 5.4.1, postgresql 42.5.0
testcontainers (jdbc, r2dbc, postgresql) 1.17.5
io.micronaut.test-resources…

macmillancodes
- 63
- 7
0
votes
0 answers
How to avoid starting server every time for multiple @MicronautTest
Our application has 15 integration tests, each written with @MicronautTest. The tests currently take long time to run, as db connection establishment and server restart happens at start and end of every test.
How can we optimize build run time by…

user3474393
- 33
- 4
0
votes
1 answer
Micronaut Test Resources: How to extend AbstractTestContainersProvider class
Micronaut documentation says:
For test resources which make use of Testcontainers, you may extend
the base AbstractTestContainersProvider class.
My question is: how to add this class properly to the classpath of the test resources sourceset (I am…

HeavyLifter
- 47
- 4
0
votes
0 answers
Cannot invoke "io.micronaut.context.ApplicationContext.getBean(java.lang.Class)" because "this.applicationContext" is null
I have an extended class where I am initializing the application context, but facing an issue with null.
Micronaut Test
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class DiscountDeleteListenerTest extends TestContainerFixture…

San Jaisy
- 15,327
- 34
- 171
- 290
0
votes
1 answer
How to Override a OnApplicationEvent method from Running on StartupEvent in Tests in Micronaut Application
I have a OnApplicationEvent which executes some fancy scheduled code whenever the server spins up. What I want to do is disable/Override this Call for all at least some of my Unit Tests. I am working in Micronaut Application.
How can I do that?

pks18
- 1
0
votes
0 answers
MicronautTest annotation skips test with DescribeSpec
I'm trying to write a test using the @MicronautTest annotation in order to take advantage of the @Requires annotation so that I can run different tests depending on which MICRONAUT_ENVIRONMENTS variable(s) I set. I'm following what I see here:…

Steven Staley
- 182
- 1
- 1
- 10
0
votes
1 answer
Junit 5 functional testing the Micronaut Messaging-Driven Application
I have a Rabbit MQ Micronaut Messaging-Driven application. The application only contains the Consumer side, Producer side is on another REST API application.
Now I want to perform JUnit 5 testing with the consumer side only. Trying to get the best…

San Jaisy
- 15,327
- 34
- 171
- 290