I don't know if this is viewed as a problem or not, but when I wrote a test
class and annotated it with
@RunWith(CdiTestRunner.*class*)
the following test method is called as a non proxied method call from
reflection, indicating to me that the @Transactional annotation cannot be
having any effect.

@Test
@Transactional
*public* *void testSaveAndFetchUser() {*

    // Given - a new user
    *final* User randomUser = createRandomUser(*false*);

    // When - saved
    *final* User savedUser = userService.saveUser(randomUser);

    // Then - user is saved as well as history and can be retrieved by id
and username
    *assertThat*(savedUser.getRoles(), *hasSize*(*greaterThan*(0)));
    ...
}

Regards,
Paul Wills

Reply via email to