Spring Dependency Injection with TestNG

前端 未结 3 587
难免孤独
难免孤独 2020-12-02 10:11

Spring support JUnit quite well on that: With the RunWith and ContextConfiguration annotation, things look very intuitive

@RunWith(         


        
3条回答
  •  没有蜡笔的小新
    2020-12-02 11:00

    It works with TestNG as well. Your test class needs to extend one of the following classes:

    • org.springframework.test.context.testng.AbstractTestNGSpringContextTests
    • org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests

提交回复
热议问题