Try
@ContextConfiguration(locations = { "classpath:/META-INF/spring/applicationContext.xml" })
Honestly, I would step back from xml and go this route. Edit
@ContextConfiguration(locations = { "/META-INF/spring/applicationContext.xml" })
to
@ContextConfiguration(classes = { FloorServiceTestConfig.class })
And create a class class
@Configuration public class FloorServiceTestConfig { @Bean public FloorService floorService() { return new FloorService(); } }
Thus, when you need to make fun of your beans for a class that you are not testing, it looks below
@Configuration public class FloorServiceTestConfig { @Bean public FloorService floorService() { return Mockito.mock(FloorService.class); } }
source share