0

In my current Java project, there is such style of integration test:

@Test
@Transactional
public void testBusinessTransaction() throws Exception {
    //...complicate set up code and execution code
    assertEquals(expected, actual);
}

Question:

  • is using the @Test in combination with @Transactional suitable at all, esp. when set up code before the assertion is complicated?
  • shouldn't the setup part of code, which forms the business transaction, be separated as another concern?
  • transaction in the method is committed only when the method ends, then what this method is testing?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.