Spring boot 1.4 Testing : Configuration error: found multiple declarations of @BootstrapWith

This exception occurs when spring test can not find main configuration class.
Try to add @ContextConfiguration anootation to your test class. Follow the spring test documention for more details (section Detecting test configuration)

My example Test class is like this:

@RunWith(SpringRunner.class)
@ContextConfiguration(classes=Application.class)
@WebMvcTest(MyController.class)
public class MyConrollerTests {
    ...
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)