@ -41,6 +41,7 @@ class AotProcessorTests {
@BeforeEach
@BeforeEach
void setup ( ) {
void setup ( ) {
SampleApplication . argsHolder = null ;
SampleApplication . argsHolder = null ;
SampleApplication . postRunInvoked = false ;
}
}
@Test
@Test
@ -50,6 +51,7 @@ class AotProcessorTests {
directory . resolve ( "resource" ) , directory . resolve ( "class" ) , "com.example" , "example" ) ;
directory . resolve ( "resource" ) , directory . resolve ( "class" ) , "com.example" , "example" ) ;
processor . process ( ) ;
processor . process ( ) ;
assertThat ( SampleApplication . argsHolder ) . isEqualTo ( arguments ) ;
assertThat ( SampleApplication . argsHolder ) . isEqualTo ( arguments ) ;
assertThat ( SampleApplication . postRunInvoked ) . isFalse ( ) ;
assertThat ( directory ) . satisfies ( hasGeneratedAssetsForSampleApplication ( ) ) ;
assertThat ( directory ) . satisfies ( hasGeneratedAssetsForSampleApplication ( ) ) ;
}
}
@ -69,6 +71,7 @@ class AotProcessorTests {
directory . resolve ( "class" ) . toString ( ) , "com.example" , "example" , "1" , "2" } ;
directory . resolve ( "class" ) . toString ( ) , "com.example" , "example" , "1" , "2" } ;
AotProcessor . main ( mainArguments ) ;
AotProcessor . main ( mainArguments ) ;
assertThat ( SampleApplication . argsHolder ) . containsExactly ( "1" , "2" ) ;
assertThat ( SampleApplication . argsHolder ) . containsExactly ( "1" , "2" ) ;
assertThat ( SampleApplication . postRunInvoked ) . isFalse ( ) ;
assertThat ( directory ) . satisfies ( hasGeneratedAssetsForSampleApplication ( ) ) ;
assertThat ( directory ) . satisfies ( hasGeneratedAssetsForSampleApplication ( ) ) ;
}
}
@ -125,9 +128,12 @@ class AotProcessorTests {
public static String [ ] argsHolder ;
public static String [ ] argsHolder ;
public static boolean postRunInvoked ;
public static void main ( String [ ] args ) {
public static void main ( String [ ] args ) {
argsHolder = args ;
argsHolder = args ;
SpringApplication . run ( SampleApplication . class , args ) ;
SpringApplication . run ( SampleApplication . class , args ) ;
postRunInvoked = true ;
}
}
}
}