Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 0624f33

Browse files
authored
Fix java test failure (#247)
* Fixes test for java 21 * Adds higher java * Changes to java 20 * Changes to docker convenience image * Changes to docker convenience image, fix * FIxes refs to nonexistant file * Fix yaml file extension * Comments out test * Comments out test * Changes docker image for java 20 * Updates docker image * Adds maven docker image * Reverts two files
1 parent 8aa9f56 commit 0624f33

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

samples/meta-codegen/lib/src/test/java/com/my/company/codegen/MyclientcodegenGeneratorTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public void launchCodeGenerator() {
2525
// https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapijsonschematools/codegen/cmd/Generate.java
2626
final CodegenConfigurator configurator = new CodegenConfigurator()
2727
.setGeneratorName("myClientCodegen") // use this codegen library
28-
.setInputSpec("../../../modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // sample OpenAPI file
29-
// .setInputSpec("https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // or from the server
28+
.setInputSpec("../../../modules/openapi-generator/src/test/resources/2_0/sample_spec.yml") // sample OpenAPI file
29+
// .setInputSpec("https://raw.githubusercontent.com/openapi-json-schema-tools/openapi-json-schema-generator/master/modules/openapi-generator/src/test/resources/2_0/sample_spec.yml") // or from the server
3030
.setOutputDir("out/myClientCodegen"); // output directory
3131

3232
final ClientOptInput clientOptInput = configurator.toClientOptInput();

src/test/java/org/openapijsonschematools/codegen/common/URLPathUtilsTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ public void testGetServerURLWithVariables() {
111111

112112
Server s9 = new Server().url("https://{user}.example.com/{version}").variables(
113113
new ServerVariables().addServerVariable("version", new ServerVariable()._default("v1"))
114-
.addServerVariable("user", new ServerVariable()._default("{user}")));
115-
Assert.assertEquals(URLPathUtils.getServerURL(s9, null).toString(), "https://{user}.example.com/v1");
114+
.addServerVariable("user", new ServerVariable()._default("%7Buser%7D")));
115+
Assert.assertEquals(URLPathUtils.getServerURL(s9, null).toString(), "https://%7Buser%7D.example.com/v1");
116116
}
117117

118118
private ServerVariables serverVariables(String... entries) {

src/test/java/org/openapijsonschematools/codegen/generators/PythonClientGeneratorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void testRecursiveExampleValueWithCycle() throws Exception {
6363

6464
@Test(expectedExceptions = RuntimeException.class)
6565
public void testSpecWithTooLowVersionThrowsException() {
66-
final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/2_0/petstore.yaml");
66+
final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/2_0/sample_spec.yml");
6767
final PythonClientGenerator codegen = new PythonClientGenerator();
6868
codegen.preprocessOpenAPI(openAPI);
6969
}

0 commit comments

Comments
 (0)