You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2020/08/19 10:06:19 UTC
[camel-quarkus] branch master updated: Fixed flatpack itests as
test data would not be available on platform
This is an automated email from the ASF dual-hosted git repository.
aldettinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/master by this push:
new cc863ae Fixed flatpack itests as test data would not be available on platform
cc863ae is described below
commit cc863ae1b2b9be61135f7195dde737e9ee544798
Author: aldettinger <al...@gmail.com>
AuthorDate: Wed Aug 19 11:48:28 2020 +0200
Fixed flatpack itests as test data would not be available on platform
---
.../camel/quarkus/component/flatpack/it/FlatpackTest.java | 10 +++++-----
.../delim/INVENTORY-CommaDelimitedWithQualifier.txt | 0
.../src/test/{data => resources}/fixed/PEOPLE-FixedLength.txt | 0
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/integration-tests/flatpack/src/test/java/org/apache/camel/quarkus/component/flatpack/it/FlatpackTest.java b/integration-tests/flatpack/src/test/java/org/apache/camel/quarkus/component/flatpack/it/FlatpackTest.java
index da1b563..295a495 100644
--- a/integration-tests/flatpack/src/test/java/org/apache/camel/quarkus/component/flatpack/it/FlatpackTest.java
+++ b/integration-tests/flatpack/src/test/java/org/apache/camel/quarkus/component/flatpack/it/FlatpackTest.java
@@ -16,8 +16,8 @@
*/
package org.apache.camel.quarkus.component.flatpack.it;
-import java.io.File;
import java.io.IOException;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
@@ -25,7 +25,7 @@ import java.util.Map;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.http.ContentType;
-import org.apache.camel.converter.IOConverter;
+import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.Test;
import static io.restassured.RestAssured.given;
@@ -37,7 +37,8 @@ class FlatpackTest {
@Test
public void delimitedUnmarshalShouldSucceed() throws IOException {
- String data = IOConverter.toString(new File("src/test/data/delim/INVENTORY-CommaDelimitedWithQualifier.txt"), null);
+ String data = IOUtils.toString(getClass().getResourceAsStream("/delim/INVENTORY-CommaDelimitedWithQualifier.txt"),
+ StandardCharsets.UTF_8);
given().body(data).when().get("/flatpack/delimited-unmarshal").then().statusCode(200).body(is("4-SOME VALVE"));
}
@@ -66,8 +67,7 @@ class FlatpackTest {
@Test
public void fixedLengthUnmarshalShouldSucceed() throws IOException {
- String data = IOConverter.toString(new File("src/test/data/fixed/PEOPLE-FixedLength.txt"), null);
-
+ String data = IOUtils.toString(getClass().getResourceAsStream("/fixed/PEOPLE-FixedLength.txt"), StandardCharsets.UTF_8);
given().body(data).when().get("/flatpack/fixed-length-unmarshal").then().statusCode(200).body(is("4-JOHN"));
}
diff --git a/integration-tests/flatpack/src/test/data/delim/INVENTORY-CommaDelimitedWithQualifier.txt b/integration-tests/flatpack/src/test/resources/delim/INVENTORY-CommaDelimitedWithQualifier.txt
similarity index 100%
rename from integration-tests/flatpack/src/test/data/delim/INVENTORY-CommaDelimitedWithQualifier.txt
rename to integration-tests/flatpack/src/test/resources/delim/INVENTORY-CommaDelimitedWithQualifier.txt
diff --git a/integration-tests/flatpack/src/test/data/fixed/PEOPLE-FixedLength.txt b/integration-tests/flatpack/src/test/resources/fixed/PEOPLE-FixedLength.txt
similarity index 100%
rename from integration-tests/flatpack/src/test/data/fixed/PEOPLE-FixedLength.txt
rename to integration-tests/flatpack/src/test/resources/fixed/PEOPLE-FixedLength.txt