Failed to load ApplicationContext (with annotation)

前端 未结 2 1795
闹比i
闹比i 2021-02-13 02:00

This is my class for test.

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = AppConfig.class, loader = AnnotationConfigContextLoader.class)         


        
2条回答
  •  忘了有多久
    2021-02-13 02:22

    In my case, I had to do the following while running with Junit5

    @SpringBootTest(classes = {abc.class}) @ExtendWith(SpringExtension.class

    Here abc.class was the class that was being tested

提交回复
热议问题