Class JctExtension

java.lang.Object
io.github.ascopes.jct.junit.JctExtension
All Implemented Interfaces:
AfterAllCallback, AfterEachCallback, BeforeAllCallback, BeforeEachCallback, Extension

@API(since="0.4.0", status=STABLE) public final class JctExtension extends Object implements Extension, BeforeEachCallback, BeforeAllCallback, AfterEachCallback, AfterAllCallback
JUnit5 extension that will manage the lifecycle of Managed-annotated Workspace fields within JUnit5 test classes.

 @ExtendWith(JctExtension.class)
 class MyTest {
   @Managed
   Workspace workspace;

   @JavacCompilerTest
   void myTest(JctCompiler compiler) {
     // Given
     workspace
        .createSourcePathPackage()
        ...;

     // When
     var compilation = compiler.compile(workspace);

     // Then
     ...
   }
 }
 
Since:
0.4.0
Author:
Ashley Scopes