2323import java .util .Set ;
2424
2525import org .gradle .testkit .runner .BuildResult ;
26- import org .gradle . util . GradleVersion ;
27- import org .junit .jupiter .api .TestTemplate ;
26+ import org .junit . jupiter . api . Test ;
27+ import org .junit .jupiter .api .extension . ExtendWith ;
2828
29- import org .springframework .boot .gradle .junit .GradleCompatibility ;
3029import org .springframework .boot .testsupport .gradle .testkit .GradleBuild ;
30+ import org .springframework .boot .testsupport .gradle .testkit .GradleBuildExtension ;
3131
3232import static org .assertj .core .api .Assertions .assertThat ;
3333
3636 *
3737 * @author Andy Wilkinson
3838 */
39- @ GradleCompatibility
39+ @ ExtendWith ( GradleBuildExtension . class )
4040class KotlinPluginActionIntegrationTests {
4141
42- GradleBuild gradleBuild ;
42+ GradleBuild gradleBuild = new GradleBuild () ;
4343
44- @ TestTemplate
44+ @ Test
4545 void noKotlinVersionPropertyWithoutKotlinPlugin () {
4646 assertThat (this .gradleBuild .build ("kotlinVersion" ).getOutput ()).contains ("Kotlin version: none" );
4747 }
4848
49- @ TestTemplate
49+ @ Test
5050 void kotlinVersionPropertyIsSet () {
51- String output = this .gradleBuild .expectDeprecationWarningsWithAtLeastVersion ("8.1-rc-1" )
52- .build ("kotlinVersion" , "dependencies" , "--configuration" , "compileClasspath" )
51+ String output = this .gradleBuild .build ("kotlinVersion" , "dependencies" , "--configuration" , "compileClasspath" )
5352 .getOutput ();
5453 assertThat (output ).containsPattern ("Kotlin version: [0-9]\\ .[0-9]\\ .[0-9]+" );
5554 }
5655
57- @ TestTemplate
56+ @ Test
5857 void kotlinCompileTasksUseJavaParametersFlagByDefault () {
59- assertThat (this .gradleBuild .expectDeprecationWarningsWithAtLeastVersion ("8.1-rc-1" )
60- .build ("kotlinCompileTasksJavaParameters" )
61- .getOutput ()).contains ("compileKotlin java parameters: true" )
58+ assertThat (this .gradleBuild .build ("kotlinCompileTasksJavaParameters" ).getOutput ())
59+ .contains ("compileKotlin java parameters: true" )
6260 .contains ("compileTestKotlin java parameters: true" );
6361 }
6462
65- @ TestTemplate
63+ @ Test
6664 void kotlinCompileTasksCanOverrideDefaultJavaParametersFlag () {
67- assertThat (this .gradleBuild .expectDeprecationWarningsWithAtLeastVersion ("8.1-rc-1" )
68- .build ("kotlinCompileTasksJavaParameters" )
69- .getOutput ()).contains ("compileKotlin java parameters: false" )
65+ assertThat (this .gradleBuild .build ("kotlinCompileTasksJavaParameters" ).getOutput ())
66+ .contains ("compileKotlin java parameters: false" )
7067 .contains ("compileTestKotlin java parameters: false" );
7168 }
7269
73- @ TestTemplate
70+ @ Test
7471 void taskConfigurationIsAvoided () throws IOException {
75- BuildResult result = this .gradleBuild .expectDeprecationWarningsWithAtLeastVersion ( "8.1-rc-1" ). build ("help" );
72+ BuildResult result = this .gradleBuild .build ("help" );
7673 String output = result .getOutput ();
7774 BufferedReader reader = new BufferedReader (new StringReader (output ));
7875 String line ;
@@ -82,12 +79,7 @@ void taskConfigurationIsAvoided() throws IOException {
8279 configured .add (line .substring ("Configuring :" .length ()));
8380 }
8481 }
85- if (GradleVersion .version (this .gradleBuild .getGradleVersion ()).compareTo (GradleVersion .version ("7.3.3" )) < 0 ) {
86- assertThat (configured ).containsExactly ("help" );
87- }
88- else {
89- assertThat (configured ).containsExactlyInAnyOrder ("help" , "clean" );
90- }
82+ assertThat (configured ).containsExactlyInAnyOrder ("help" , "clean" );
9183 }
9284
9385}
0 commit comments