|
16 | 16 | */
|
17 | 17 | package org.openapitools.codegen.languages;
|
18 | 18 |
|
| 19 | +import org.testng.annotations.Test; |
| 20 | + |
19 | 21 | import java.util.List;
|
20 | 22 |
|
21 |
| -import org.testng.Assert; |
22 |
| -import org.testng.annotations.Test; |
| 23 | +import static org.assertj.core.api.Assertions.assertThat; |
23 | 24 |
|
24 | 25 | // This test class is in this package, not org.openapitools.codegen.java.helidon, so it can refer to elements of
|
25 | 26 | // JavaHelidonCommonCodegen without making them public; package-private is sufficient and we don't want to expose those methods
|
26 | 27 | // more broadly.
|
27 |
| -class HelidonCommonCodegenTest { |
| 28 | +public class HelidonCommonCodegenTest { |
28 | 29 |
|
29 |
| - @Test |
30 |
| - void checkMajorVersionMatch() { |
31 |
| - Assert.assertEquals("1.2.3", |
32 |
| - JavaHelidonCommonCodegen.VersionUtil.instance().chooseVersion("1", |
33 |
| - List.of("3.2.1", |
34 |
| - "3.2.0", |
35 |
| - "2.0.4", |
36 |
| - "1.2.3", |
37 |
| - "1.2.2", |
38 |
| - "1.1.0"))); |
| 30 | + JavaHelidonCommonCodegen.VersionUtil test = JavaHelidonCommonCodegen.VersionUtil.instance(); |
| 31 | + |
| 32 | + @Test void checkMajorVersionMatch() { |
| 33 | + assertThat(test.chooseVersion("1", List.of("3.2.1", "3.2.0", "2.0.4", "1.2.3", "1.2.2", "1.1.0"))) |
| 34 | + .isEqualTo("1.2.3"); |
39 | 35 | }
|
40 | 36 |
|
41 |
| - @Test |
42 |
| - void checkExactMatch() { |
43 |
| - Assert.assertEquals("1.2.2", |
44 |
| - JavaHelidonCommonCodegen.VersionUtil.instance().chooseVersion("1.2.2", |
45 |
| - List.of("3.2.1", |
46 |
| - "3.2.0", |
47 |
| - "2.0.4", |
48 |
| - "1.2.3", |
49 |
| - "1.2.2", |
50 |
| - "1.1.0"))); |
| 37 | + @Test void checkExactMatch() { |
| 38 | + assertThat(test.chooseVersion("1.2.2", List.of("3.2.1", "3.2.0", "2.0.4", "1.2.3", "1.2.2", "1.1.0"))) |
| 39 | + .isEqualTo("1.2.2"); |
51 | 40 | }
|
52 | 41 | }
|
0 commit comments