Skip to content

Commit

Permalink
fix KotlinServerCodegenTest and PostmanCollectionCodegenTest (OpenAPI…
Browse files Browse the repository at this point in the history
…Tools#18019)

* fix KotlinServerCodegenTest and PostmanCollectionCodegenTest

* fix PostmanCollectionCodegen line endings
  • Loading branch information
martin-mfg authored Mar 4, 2024
1 parent 9231423 commit 8f74d03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,8 @@ public String formatJson(String json) {
JsonNode actualObj = objectMapper.readTree(json);
json = Json.pretty(actualObj);
json = json.replace("\"", JSON_ESCAPE_DOUBLE_QUOTE);
json = json.replace("\r\n", JSON_ESCAPE_NEW_LINE);
json = json.replace("\r", JSON_ESCAPE_NEW_LINE);
json = json.replace("\n", JSON_ESCAPE_NEW_LINE);

} catch (JsonProcessingException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.openapitools.codegen.kotlin;

import org.junit.Test;
import org.openapitools.codegen.ClientOptInput;
import org.openapitools.codegen.DefaultGenerator;
import org.openapitools.codegen.TestUtils;
import org.openapitools.codegen.languages.KotlinServerCodegen;
import org.openapitools.codegen.languages.KotlinSpringServerCodegen;
import org.testng.annotations.Test;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -180,7 +180,7 @@ public void attributesInRef() throws IOException {
.config(codegen))
.generate();

String outputPath = output.getAbsolutePath() + "src/main/kotlin/org/openapitools";
String outputPath = output.getAbsolutePath() + "/src/main/kotlin/org/openapitools";
Path order = Paths.get(outputPath + "/model/Order.kt");
assertFileContains(
order,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.swagger.v3.oas.models.tags.Tag;
import org.junit.Assert;
import org.junit.Test;
import org.openapitools.codegen.*;
import org.openapitools.codegen.config.CodegenConfigurator;
import org.openapitools.codegen.languages.PostmanCollectionCodegen;
import org.testng.annotations.Test;

import java.io.File;

Expand Down

0 comments on commit 8f74d03

Please sign in to comment.