Java unit testing - Junit

  • Eclipse or STS may have to manually increase the corresponding version of Junit build path-dependent
  • Junit 4
  • Junit 5
@ExtendWith(SpringExtension.class)
@TestPropertySource(locations = { "/application.properties" })
@Import({EnvironmentConfig.class})
@ContextConfiguration(classes = { XXXConfig.class, YYYConfig.class })
@TestInstance(Lifecycle.PER_CLASS)
public class XXXTest {
}

Guess you like

Origin www.cnblogs.com/wyp1988/p/12125017.html