Skip to content

Commit

Permalink
Reformat tests for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Philzen committed Jun 2, 2024
1 parent b1e1897 commit 2dbbbb6
Showing 1 changed file with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,32 @@
*/
package org.openapitools.codegen.languages;

import java.util.List;

import org.testng.Assert;
import org.testng.annotations.Test;

import java.util.List;

// 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
// more broadly.
public class HelidonCommonCodegenTest {

@Test
void checkMajorVersionMatch() {
Assert.assertEquals("1.2.3",
JavaHelidonCommonCodegen.VersionUtil.instance().chooseVersion("1",
List.of("3.2.1",
"3.2.0",
"2.0.4",
"1.2.3",
"1.2.2",
"1.1.0")));
@Test void checkMajorVersionMatch() {
final var actual = JavaHelidonCommonCodegen.VersionUtil.instance().chooseVersion(
"1", List.of("3.2.1", "3.2.0", "2.0.4", "1.2.3", "1.2.2", "1.1.0")
);

Assert.assertEquals("1.2.3", actual);
}

@Test
void checkExactMatch() {
Assert.assertEquals("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")));
final var actual = 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")
);

Assert.assertEquals(
"1.2.2", actual
);
}
}

0 comments on commit 2dbbbb6

Please # to comment.