mercredi 23 décembre 2015

Best way to exclude unit test @Configurations in Spring?

In my Spring Boot project, I have a main class annotated with @SpringBootConfiguration. I also have some unit tests that use @SpringApplicationConfiguration that points to an inner class that defines a Spring context for usage in my unit test (using some mocks).

I now want to write an integration test that starts the full context of my application. However, this does not work as it also picks up the Spring contexts that are defined as inner classes in other unit tests.

What would be the best way to avoid that? I did see the exclude and excludeName properties on @SpringBootConfiguration, but I am unsure how to use them.

Aucun commentaire:

Enregistrer un commentaire