1515 */
1616package com .diffplug .gradle .spotless ;
1717
18- import static org .junit .jupiter .api .condition .JRE .JAVA_11 ;
19-
2018import java .io .IOException ;
2119
2220import org .assertj .core .api .Assertions ;
2321import org .junit .jupiter .api .Test ;
24- import org .junit .jupiter .api .condition .EnabledForJreRange ;
2522
2623import com .diffplug .common .base .StringPrinter ;
2724
@@ -39,35 +36,4 @@ void redirectPluginModernGradle() throws IOException {
3936 " To migrate:" ,
4037 " - Test your build with: id 'com.diffplug.gradle.spotless' version '4.5.1'" ));
4138 }
42-
43- @ Test
44- @ EnabledForJreRange (max = JAVA_11 )
45- void redirectPluginOldGradle () throws IOException {
46- setFile ("build.gradle" ).toLines (
47- "plugins {" ,
48- " id 'com.diffplug.gradle.spotless'" ,
49- "}" );
50- Assertions .assertThat (gradleRunner ().withGradleVersion (GradleVersionSupport .JRE_11 .version )
51- .buildAndFail ().getOutput ().replace ("\r " , "" ))
52- .contains (StringPrinter .buildStringFromLines (
53- "> Failed to apply plugin [id 'com.diffplug.gradle.spotless']" ,
54- " > We have moved from 'com.diffplug.gradle.spotless'" ,
55- " to 'com.diffplug.spotless'" ,
56- " To migrate:" ,
57- " - Upgrade Gradle to 7.1 or newer (you're on 5.0)" ,
58- " - Test your build with: id 'com.diffplug.gradle.spotless' version '4.5.1'" ));
59- }
60-
61- @ Test
62- @ EnabledForJreRange (max = JAVA_11 )
63- void realPluginOldGradle () throws IOException {
64- setFile ("build.gradle" ).toLines (
65- "plugins {" ,
66- " id 'com.diffplug.spotless'" ,
67- "}" );
68- Assertions .assertThat (gradleRunner ().withGradleVersion (GradleVersionSupport .JRE_11 .version )
69- .buildAndFail ().getOutput ().replace ("\r " , "" ))
70- .contains (StringPrinter .buildStringFromLines (
71- "Spotless requires Gradle 7.1 or newer, this was 5.0" ));
72- }
7339}
0 commit comments