1717
1818import static org .junit .jupiter .api .condition .JRE .JAVA_13 ;
1919import static org .junit .jupiter .api .condition .JRE .JAVA_15 ;
20+ import static org .junit .jupiter .api .condition .JRE .JAVA_16 ;
2021
2122import org .junit .jupiter .api .Test ;
2223import org .junit .jupiter .api .condition .EnabledForJreRange ;
@@ -51,7 +52,7 @@ void behavior18() throws Exception {
5152
5253 @ Test
5354 void behavior () throws Exception {
54- FormatterStep step = GoogleJavaFormatStep .create ("1.8 " , TestProvisioner .mavenCentral ());
55+ FormatterStep step = GoogleJavaFormatStep .create ("1.10.0 " , TestProvisioner .mavenCentral ());
5556 StepHarness .forStep (step )
5657 .testResource ("java/googlejavaformat/JavaCodeUnformatted.test" , "java/googlejavaformat/JavaCodeFormatted.test" )
5758 .testResource ("java/googlejavaformat/JavaCodeWithLicenseUnformatted.test" , "java/googlejavaformat/JavaCodeWithLicenseFormatted.test" )
@@ -67,9 +68,18 @@ void versionBelowMinimumRequiredVersionIsNotAllowed() throws Exception {
6768 .contains ("you are using 1.2" );
6869 }
6970
71+ @ Test
72+ @ EnabledForJreRange (min = JAVA_16 )
73+ void versionBelowOneDotTenIsNotAllowed () throws Exception {
74+ FormatterStep step = GoogleJavaFormatStep .create ("1.9" , "AOSP" , TestProvisioner .mavenCentral ());
75+ StepHarness .forStep (step )
76+ .testResourceExceptionMsg ("java/googlejavaformat/JavaCodeWithLicenseUnformatted.test" )
77+ .contains ("you are using 1.9" );
78+ }
79+
7080 @ Test
7181 void behaviorWithAospStyle () throws Exception {
72- FormatterStep step = GoogleJavaFormatStep .create ("1.8 " , "AOSP" , TestProvisioner .mavenCentral ());
82+ FormatterStep step = GoogleJavaFormatStep .create ("1.10.0 " , "AOSP" , TestProvisioner .mavenCentral ());
7383 StepHarness .forStep (step )
7484 .testResource ("java/googlejavaformat/JavaCodeUnformatted.test" , "java/googlejavaformat/JavaCodeFormattedAOSP.test" )
7585 .testResource ("java/googlejavaformat/JavaCodeWithLicenseUnformatted.test" , "java/googlejavaformat/JavaCodeWithLicenseFormattedAOSP.test" )
@@ -91,7 +101,7 @@ void behaviorWithReflowLongStrings() throws Exception {
91101
92102 @ Test
93103 void behaviorWithCustomGroupArtifact () throws Exception {
94- FormatterStep step = GoogleJavaFormatStep .create (GoogleJavaFormatStep .defaultGroupArtifact (), "1.8 " , GoogleJavaFormatStep .defaultStyle (), TestProvisioner .mavenCentral (), false );
104+ FormatterStep step = GoogleJavaFormatStep .create (GoogleJavaFormatStep .defaultGroupArtifact (), "1.10.0 " , GoogleJavaFormatStep .defaultStyle (), TestProvisioner .mavenCentral (), false );
95105 StepHarness .forStep (step )
96106 .testResource ("java/googlejavaformat/JavaCodeUnformatted.test" , "java/googlejavaformat/JavaCodeFormatted.test" )
97107 .testResource ("java/googlejavaformat/JavaCodeWithLicenseUnformatted.test" , "java/googlejavaformat/JavaCodeWithLicenseFormatted.test" )
@@ -102,7 +112,7 @@ void behaviorWithCustomGroupArtifact() throws Exception {
102112 @ Test
103113 void equality () throws Exception {
104114 new SerializableEqualityTester () {
105- String version = "1.8 " ;
115+ String version = "1.10.0 " ;
106116 String style = "" ;
107117 boolean reflowLongStrings = false ;
108118
@@ -111,7 +121,7 @@ protected void setupTest(API api) {
111121 // same version == same
112122 api .areDifferentThan ();
113123 // change the version, and it's different
114- version = "1.9 " ;
124+ version = "1.11.0 " ;
115125 api .areDifferentThan ();
116126 // change the style, and it's different
117127 style = "AOSP" ;
0 commit comments