I have a @SpringBootApplication class in java/
directory(same package) and another @SpringBootApplication class in test/
for mocking some auto-wired beans. There are several tests and which configuration is used varies from test to test.
And in a test class
@RunWith(SpringRunner.class)
@WebMvcTest(RecApiServerController.class)
throws
java.lang.IllegalStateException: Found multiple @SpringBootConfiguration annotated classes [Generic bean: class [com.xxx.MockedTestConfig]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [/..direction.../target/test-classes/com/xxx/MockedTestConfig.class], Generic bean: class [com.xxx.MyApplication]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [/...direction.../target/classes/com/xxx/MyApplication.class]]
I just want to test routing of a controller.
How could I set a specific application configuration?