mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-03-10 08:31:23 +00:00
Bugfix/activate helidon versionutil tests (#18815)
* Reactivate tests Contrary to Junit5, classes containing TestNG tests need to have public visibility, otherwise the tests will not be discovered and run. * Reformat tests for readability * Rewrite tests using fluent assertions
This commit is contained in:
@@ -16,37 +16,26 @@
|
|||||||
*/
|
*/
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.testng.Assert;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import org.testng.annotations.Test;
|
|
||||||
|
|
||||||
// This test class is in this package, not org.openapitools.codegen.java.helidon, so it can refer to elements of
|
// This test class is in this package, not org.openapitools.codegen.java.helidon, so it can refer to elements of
|
||||||
// JavaHelidonCommonCodegen without making them public; package-private is sufficient and we don't want to expose those methods
|
// JavaHelidonCommonCodegen without making them public; package-private is sufficient and we don't want to expose those methods
|
||||||
// more broadly.
|
// more broadly.
|
||||||
class HelidonCommonCodegenTest {
|
public class HelidonCommonCodegenTest {
|
||||||
|
|
||||||
@Test
|
JavaHelidonCommonCodegen.VersionUtil test = JavaHelidonCommonCodegen.VersionUtil.instance();
|
||||||
void checkMajorVersionMatch() {
|
|
||||||
Assert.assertEquals("1.2.3",
|
@Test void checkMajorVersionMatch() {
|
||||||
JavaHelidonCommonCodegen.VersionUtil.instance().chooseVersion("1",
|
assertThat(test.chooseVersion("1", List.of("3.2.1", "3.2.0", "2.0.4", "1.2.3", "1.2.2", "1.1.0")))
|
||||||
List.of("3.2.1",
|
.isEqualTo("1.2.3");
|
||||||
"3.2.0",
|
|
||||||
"2.0.4",
|
|
||||||
"1.2.3",
|
|
||||||
"1.2.2",
|
|
||||||
"1.1.0")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test void checkExactMatch() {
|
||||||
void checkExactMatch() {
|
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")))
|
||||||
Assert.assertEquals("1.2.2",
|
.isEqualTo("1.2.2");
|
||||||
JavaHelidonCommonCodegen.VersionUtil.instance().chooseVersion("1.2.2",
|
|
||||||
List.of("3.2.1",
|
|
||||||
"3.2.0",
|
|
||||||
"2.0.4",
|
|
||||||
"1.2.3",
|
|
||||||
"1.2.2",
|
|
||||||
"1.1.0")));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user