32
32
import org .codehaus .mojo .versions .ordering .MavenVersionComparator ;
33
33
import org .codehaus .mojo .versions .ordering .MercuryVersionComparator ;
34
34
import org .codehaus .mojo .versions .ordering .VersionComparator ;
35
- import org .junit .Test ;
35
+ import org .junit .jupiter . api . Test ;
36
36
37
37
import static java .util .Optional .of ;
38
38
import static org .codehaus .mojo .versions .api .Segment .INCREMENTAL ;
47
47
import static org .hamcrest .Matchers .hasToString ;
48
48
import static org .hamcrest .Matchers .is ;
49
49
import static org .hamcrest .Matchers .nullValue ;
50
- import static org .junit .Assert .assertArrayEquals ;
51
- import static org .junit .Assert .assertEquals ;
52
- import static org .junit .Assert .assertNull ;
50
+ import static org .junit .jupiter . api . Assertions .assertArrayEquals ;
51
+ import static org .junit .jupiter . api . Assertions .assertEquals ;
52
+ import static org .junit .jupiter . api . Assertions .assertNull ;
53
53
54
- public class ArtifactVersionsTest {
54
+ class ArtifactVersionsTest {
55
55
56
56
private void test4DigitVersion (VersionComparator comparator ) throws InvalidVersionSpecificationException {
57
57
ArtifactVersions instance = new ArtifactVersions (
@@ -101,17 +101,17 @@ private void test4DigitVersion(VersionComparator comparator) throws InvalidVersi
101
101
}
102
102
103
103
@ Test
104
- public void test4DigitVersionsMercury () throws Exception {
104
+ void test4DigitVersionsMercury () throws Exception {
105
105
test4DigitVersion (new MercuryVersionComparator ());
106
106
}
107
107
108
108
@ Test
109
- public void test4DigitVersionsMaven () throws Exception {
109
+ void test4DigitVersionsMaven () throws Exception {
110
110
test4DigitVersion (new MavenVersionComparator ());
111
111
}
112
112
113
113
@ Test
114
- public void testIsEmpty () throws Exception {
114
+ void testIsEmpty () throws Exception {
115
115
ArtifactVersions instance = new ArtifactVersions (
116
116
new DefaultArtifact (
117
117
"group" ,
@@ -128,7 +128,7 @@ public void testIsEmpty() throws Exception {
128
128
}
129
129
130
130
@ Test
131
- public void testSmokes () throws Exception {
131
+ void testSmokes () throws Exception {
132
132
ArtifactVersions instance = new ArtifactVersions (
133
133
new DefaultArtifact (
134
134
"group" ,
@@ -155,7 +155,7 @@ public void testSmokes() throws Exception {
155
155
}
156
156
157
157
@ Test
158
- public void testReportLabels () {
158
+ void testReportLabels () {
159
159
ArtifactVersions instance = new ArtifactVersions (
160
160
new DefaultArtifact ("default-group" , "dummy-api" , "1.1" , "foo" , "bar" , "jar" , null ),
161
161
Arrays .asList (versions (
@@ -188,7 +188,7 @@ public void testReportLabels() {
188
188
}
189
189
190
190
@ Test
191
- public void testGetNewerVersionsWithSnapshot () throws InvalidSegmentException {
191
+ void testGetNewerVersionsWithSnapshot () throws InvalidSegmentException {
192
192
ArtifactVersions instance = new ArtifactVersions (
193
193
new DefaultArtifact ("default-group" , "dummy-api" , "1.0.0-SNAPSHOT" , "foo" , "bar" , "jar" , null ),
194
194
Arrays .asList (versions ("1.0.0-SNAPSHOT" , "1.0.0" )),
@@ -207,7 +207,7 @@ private static ArtifactVersions createInstance(ArtifactVersion[] versions) {
207
207
}
208
208
209
209
@ Test
210
- public void testAllVersionsForIgnoreScopeSubIncremental () {
210
+ void testAllVersionsForIgnoreScopeSubIncremental () {
211
211
ArtifactVersions instance = createInstance (versions ("1.0.0" , "1.0.0-1" , "1.0.1" ));
212
212
ArtifactVersion [] filteredVersions = instance .getVersions (
213
213
instance .restrictionForIgnoreScope (instance .getCurrentVersion (), of (SUBINCREMENTAL )), false );
@@ -216,7 +216,7 @@ public void testAllVersionsForIgnoreScopeSubIncremental() {
216
216
}
217
217
218
218
@ Test
219
- public void testAllVersionsForIgnoreScopeIncremental () {
219
+ void testAllVersionsForIgnoreScopeIncremental () {
220
220
ArtifactVersions instance = createInstance (versions ("1.0.0" , "1.0.0-1" , "1.0.1" , "1.1.0" ));
221
221
ArtifactVersion [] filteredVersions = instance .getVersions (
222
222
instance .restrictionForIgnoreScope (instance .getCurrentVersion (), of (INCREMENTAL )), false );
@@ -225,7 +225,7 @@ public void testAllVersionsForIgnoreScopeIncremental() {
225
225
}
226
226
227
227
@ Test
228
- public void testAllVersionsForIgnoreScopeMinor () {
228
+ void testAllVersionsForIgnoreScopeMinor () {
229
229
ArtifactVersions instance = createInstance (versions ("1.0.0" , "1.0.0-1" , "1.0.1" , "1.1.0" , "2.0.0" ));
230
230
ArtifactVersion [] filteredVersions = instance .getVersions (
231
231
instance .restrictionForIgnoreScope (instance .getCurrentVersion (), of (MINOR )), false );
@@ -234,15 +234,15 @@ public void testAllVersionsForIgnoreScopeMinor() {
234
234
}
235
235
236
236
@ Test
237
- public void testAllVersionsForIgnoreScopeMajor () {
237
+ void testAllVersionsForIgnoreScopeMajor () {
238
238
ArtifactVersions instance = createInstance (versions ("1.0.0" , "1.0.0-1" , "1.0.1" , "1.1.0" , "2.0.0" ));
239
239
ArtifactVersion [] filteredVersions = instance .getVersions (
240
240
instance .restrictionForIgnoreScope (instance .getCurrentVersion (), of (MAJOR )), false );
241
241
assertThat (filteredVersions , arrayWithSize (0 ));
242
242
}
243
243
244
244
@ Test
245
- public void testGetReportNewestUpdateWithOnlyMajorUpdate () {
245
+ void testGetReportNewestUpdateWithOnlyMajorUpdate () {
246
246
ArtifactVersions instance = createInstance (versions ("1.0.0" , "2.0.0" ));
247
247
assertThat (instance .getReportNewestUpdate (Optional .empty (), true ).toString (), is ("2.0.0" ));
248
248
assertThat (instance .getReportNewestUpdate (of (MAJOR ), true ), hasToString ("2.0.0" ));
@@ -252,7 +252,7 @@ public void testGetReportNewestUpdateWithOnlyMajorUpdate() {
252
252
}
253
253
254
254
@ Test
255
- public void testGetReportNewestUpdateWithMinorAndMajor () {
255
+ void testGetReportNewestUpdateWithMinorAndMajor () {
256
256
ArtifactVersions instance = createInstance (versions ("1.0.0" , "1.1.0" , "2.0.0" ));
257
257
assertThat (instance .getReportNewestUpdate (Optional .empty (), true ).toString (), is ("2.0.0" ));
258
258
assertThat (instance .getReportNewestUpdate (of (MAJOR ), true ), hasToString ("2.0.0" ));
@@ -262,7 +262,7 @@ public void testGetReportNewestUpdateWithMinorAndMajor() {
262
262
}
263
263
264
264
@ Test
265
- public void testGetReportNewestUpdateWithIncrementalAndMajor () {
265
+ void testGetReportNewestUpdateWithIncrementalAndMajor () {
266
266
ArtifactVersions instance = createInstance (versions ("1.0.0" , "1.0.1" , "2.0.0" ));
267
267
assertThat (instance .getReportNewestUpdate (Optional .empty (), true ).toString (), is ("2.0.0" ));
268
268
assertThat (instance .getReportNewestUpdate (of (MAJOR ), true ), hasToString ("2.0.0" ));
@@ -272,7 +272,7 @@ public void testGetReportNewestUpdateWithIncrementalAndMajor() {
272
272
}
273
273
274
274
@ Test
275
- public void testGetNewestVersionWithLesserSegment () throws InvalidSegmentException {
275
+ void testGetNewestVersionWithLesserSegment () throws InvalidSegmentException {
276
276
ArtifactVersions instance = createInstance (versions ("1.0.0-1" ));
277
277
assertThat (instance .getNewestVersion ("1.0.0" , of (MAJOR ), false , false ).get (), hasToString ("1.0.0-1" ));
278
278
assertThat (instance .getNewestVersion ("1.0.0" , of (MINOR ), false , false ).get (), hasToString ("1.0.0-1" ));
@@ -283,7 +283,7 @@ public void testGetNewestVersionWithLesserSegment() throws InvalidSegmentExcepti
283
283
}
284
284
285
285
@ Test
286
- public void testGetNewestVersionWithLesserSegmentWithSnapshots () throws InvalidSegmentException {
286
+ void testGetNewestVersionWithLesserSegmentWithSnapshots () throws InvalidSegmentException {
287
287
ArtifactVersions instance = createInstance (versions ("1.0.0-1-SNAPSHOT" ));
288
288
assertThat (instance .getNewestVersion ("1.0.0" , of (MAJOR ), true , false ).get (), hasToString ("1.0.0-1-SNAPSHOT" ));
289
289
assertThat (instance .getNewestVersion ("1.0.0" , of (MINOR ), true , false ).get (), hasToString ("1.0.0-1-SNAPSHOT" ));
0 commit comments