17
17
18
18
import static org .junit .jupiter .api .condition .JRE .JAVA_13 ;
19
19
import static org .junit .jupiter .api .condition .JRE .JAVA_15 ;
20
+ import static org .junit .jupiter .api .condition .JRE .JAVA_16 ;
20
21
21
22
import org .junit .jupiter .api .Test ;
22
23
import org .junit .jupiter .api .condition .EnabledForJreRange ;
@@ -51,7 +52,7 @@ void behavior18() throws Exception {
51
52
52
53
@ Test
53
54
void behavior () throws Exception {
54
- FormatterStep step = GoogleJavaFormatStep .create ("1.8 " , TestProvisioner .mavenCentral ());
55
+ FormatterStep step = GoogleJavaFormatStep .create ("1.10.0 " , TestProvisioner .mavenCentral ());
55
56
StepHarness .forStep (step )
56
57
.testResource ("java/googlejavaformat/JavaCodeUnformatted.test" , "java/googlejavaformat/JavaCodeFormatted.test" )
57
58
.testResource ("java/googlejavaformat/JavaCodeWithLicenseUnformatted.test" , "java/googlejavaformat/JavaCodeWithLicenseFormatted.test" )
@@ -67,9 +68,18 @@ void versionBelowMinimumRequiredVersionIsNotAllowed() throws Exception {
67
68
.contains ("you are using 1.2" );
68
69
}
69
70
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
+
70
80
@ Test
71
81
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 ());
73
83
StepHarness .forStep (step )
74
84
.testResource ("java/googlejavaformat/JavaCodeUnformatted.test" , "java/googlejavaformat/JavaCodeFormattedAOSP.test" )
75
85
.testResource ("java/googlejavaformat/JavaCodeWithLicenseUnformatted.test" , "java/googlejavaformat/JavaCodeWithLicenseFormattedAOSP.test" )
@@ -91,7 +101,7 @@ void behaviorWithReflowLongStrings() throws Exception {
91
101
92
102
@ Test
93
103
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 );
95
105
StepHarness .forStep (step )
96
106
.testResource ("java/googlejavaformat/JavaCodeUnformatted.test" , "java/googlejavaformat/JavaCodeFormatted.test" )
97
107
.testResource ("java/googlejavaformat/JavaCodeWithLicenseUnformatted.test" , "java/googlejavaformat/JavaCodeWithLicenseFormatted.test" )
@@ -102,7 +112,7 @@ void behaviorWithCustomGroupArtifact() throws Exception {
102
112
@ Test
103
113
void equality () throws Exception {
104
114
new SerializableEqualityTester () {
105
- String version = "1.8 " ;
115
+ String version = "1.10.0 " ;
106
116
String style = "" ;
107
117
boolean reflowLongStrings = false ;
108
118
@@ -111,7 +121,7 @@ protected void setupTest(API api) {
111
121
// same version == same
112
122
api .areDifferentThan ();
113
123
// change the version, and it's different
114
- version = "1.9 " ;
124
+ version = "1.11.0 " ;
115
125
api .areDifferentThan ();
116
126
// change the style, and it's different
117
127
style = "AOSP" ;
0 commit comments