TransactionalIntegrationTest.java
@TestMethodOrder(OrderAnnotation.class)
@SpringJUnitWebConfig(locations = { "classpath:service.xml","classpath:data.xml" })
@Tag("1")
public @interface TransactionalIntegrationTest {}
MyTestTest .java
@TransactionalIntegrationTest
public class MyTestTest {
@Autowired
protected CreateUser createUser;
@BeforeEach
public void setUp() throws Exception {
createUser.createTimesheetUser(...)} --> NPE
}
Получение исключения NullPointerException для createUser
.
Если я не использую метааннотации, тогдавсе работает нормально.
MyTestTest.java
@TestMethodOrder(OrderAnnotation.class)
@SpringJUnitWebConfig(locations = { "classpath:service.xml","classpath:data.xml" })
@Tag("1")
public class MyTestTest {
@Autowired
protected CreateUser createUser;
@BeforeEach
public void setUp() throws Exception {
createUser.createTimesheetUser(...)} --> works now
}