Skip to content

1.3.0.Final

Compare
Choose a tag to compare
@mkouba mkouba released this 22 Jun 14:16
· 122 commits to master since this release
  • 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

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.