fix KotlinServerCodegenTest and PostmanCollectionCodegenTest (#18019)

* fix KotlinServerCodegenTest and PostmanCollectionCodegenTest

* fix PostmanCollectionCodegen line endings
This commit is contained in:
martin-mfg
2024-03-04 06:08:33 +01:00
committed by GitHub
parent 92314232f8
commit 8f74d03290
3 changed files with 5 additions and 3 deletions

View File

@@ -715,6 +715,8 @@ public class PostmanCollectionCodegen extends DefaultCodegen implements CodegenC
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) {

View File

@@ -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;
@@ -180,7 +180,7 @@ public class KotlinServerCodegenTest {
.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,

View File

@@ -6,10 +6,10 @@ import com.fasterxml.jackson.databind.node.ArrayNode;
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;