hi paul, if the test-class itself should be handled as a cdi-bean, you need to enable deltaspike.testcontrol.use_test_class_as_cdi_bean in META-INF/apache-deltaspike.properties. it's disabled per default, because there are some limitations.
regards, gerhard http://www.irian.at Your JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces, DeltaSpike and OpenWebBeans 2015-12-10 5:56 GMT+01:00 Paul Wills <[email protected]>: > 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 >
