Spring Boot Testing & @DirtiesContext

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Spring Boot Testing & @DirtiesContext

James Green
I have an itch to scratch. Why does my test class require @DirtiesContext
to avoid a stack trace telling me that ActiveMQ was never started and so it
cannot be stopped after my test completes?

Context:

@RunWith(CamelSpringBootRunner.class)
@SpringBootTest
@MockEndpoints
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
public class FooTest {
...
}

Thanks,

James