@@ -166,6 +166,17 @@ void whenAotRunsWithClassProxyClassesAreCopiedToTargetClasses(MavenBuild mavenBu
166166 });
167167 }
168168
169+ @ TestTemplate
170+ void whenAotRunsWithDevtoolsInClasspathItIsExcluded (MavenBuild mavenBuild ) {
171+ mavenBuild .project ("aot-exclude-devtools" ).goals ("package" ).execute ((project ) -> {
172+ Path aotDirectory = project .toPath ().resolve ("target/spring-aot/main" );
173+ assertThat (aotDirectory ).exists ();
174+ Path sourcesDirectory = aotDirectory .resolve ("sources" );
175+ assertThat (sourcesDirectory ).exists ();
176+ assertThat (collectRelativePaths (sourcesDirectory )).isNotEmpty ();
177+ });
178+ }
179+
169180 @ TestTemplate
170181 void whenAotTestRunsSourcesAndResourcesAreGenerated (MavenBuild mavenBuild ) {
171182 mavenBuild .project ("aot-test" ).goals ("test" ).execute ((project ) -> {
@@ -180,6 +191,17 @@ void whenAotTestRunsSourcesAndResourcesAreGenerated(MavenBuild mavenBuild) {
180191 });
181192 }
182193
194+ @ TestTemplate
195+ void whenTestAotRunsWithDevtoolsInClasspathItIsExcluded (MavenBuild mavenBuild ) {
196+ mavenBuild .project ("aot-test-exclude-devtools" ).goals ("process-test-classes" ).execute ((project ) -> {
197+ Path aotDirectory = project .toPath ().resolve ("target/spring-aot/test" );
198+ assertThat (aotDirectory ).exists ();
199+ Path sourcesDirectory = aotDirectory .resolve ("sources" );
200+ assertThat (sourcesDirectory ).exists ();
201+ assertThat (collectRelativePaths (sourcesDirectory )).isNotEmpty ();
202+ });
203+ }
204+
183205 List <Path > collectRelativePaths (Path sourceDirectory ) {
184206 try (Stream <Path > pathStream = Files .walk (sourceDirectory )) {
185207 return pathStream .filter (Files ::isRegularFile )
@@ -195,26 +217,4 @@ protected String buildLog(File project) {
195217 return contentOf (new File (project , "target/build.log" ));
196218 }
197219
198- @ TestTemplate
199- void whenAotRunsWithDevtoolsInClasspathItIsExcluded (MavenBuild mavenBuild ) {
200- mavenBuild .project ("aot-exclude-devtools" ).goals ("package" ).execute ((project ) -> {
201- Path aotDirectory = project .toPath ().resolve ("target/spring-aot/main" );
202- assertThat (aotDirectory ).exists ();
203- Path sourcesDirectory = aotDirectory .resolve ("sources" );
204- assertThat (sourcesDirectory ).exists ();
205- assertThat (collectRelativePaths (sourcesDirectory )).isNotEmpty ();
206- });
207- }
208-
209- @ TestTemplate
210- void whenTestAotRunsWithDevtoolsInClasspathItIsExcluded (MavenBuild mavenBuild ) {
211- mavenBuild .project ("aot-test-exclude-devtools" ).goals ("process-test-classes" ).execute ((project ) -> {
212- Path aotDirectory = project .toPath ().resolve ("target/spring-aot/test" );
213- assertThat (aotDirectory ).exists ();
214- Path sourcesDirectory = aotDirectory .resolve ("sources" );
215- assertThat (sourcesDirectory ).exists ();
216- assertThat (collectRelativePaths (sourcesDirectory )).isNotEmpty ();
217- });
218- }
219-
220220}
0 commit comments