Class JctExtension

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

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