1.3.0.Final
- JUnit5 extension now offers annotation based configuration - see the example bellow (#44 and #42)
- Thanks @kdubb for contribution!
- Fire
@Initialized
and@Destroyed
lifecycle events for activated contexts (#50)- Payload is
java.lang.Object
- We don't fire
@BeforeDestroyed
as we're still compatible with CDI 1.2
- Payload is
JUnit5 annotation based configuration example
@EnableAutoWeld
@AddPackages(Alpha.class) // Adds all bean classes from the package of Alpha
@ActivateScopes(RequestScoped.class) // Activates the request scope for the duration of the test
public class SimpleTest {
// Injected automatically
@Inject
Foo foo;
@Test
public void testFoo() {
// Weld container is started automatically
assertEquals("baz", foo.getBaz());
}
}
For more examples see our test suite.