This is an automated email from the ASF dual-hosted git repository.
ffang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new bb26ab6 Fix JSON Jackson jacksonConversionPojo test-squashed #2726
(#2790)
bb26ab6 is described below
commit bb26ab660c543b3caca5bf914399501ad9acdc68
Author: Freeman(Yue) Fang <[email protected]>
AuthorDate: Wed Jun 16 16:02:38 2021 -0400
Fix JSON Jackson jacksonConversionPojo test-squashed #2726 (#2790)
---
extensions/jackson/deployment/pom.xml | 10 +++
.../jackson/JacksonTypeConverterPojoTest.java | 62 ++++++++++++++++++
.../jackson/JacksonTypeConverterSimpleTest.java | 76 ++++++++++++++++++++++
.../camel/quarkus/component/jackson/Order.java | 71 ++++++++++++++++++++
extensions/jacksonxml/deployment/pom.xml | 10 +++
.../deployment/JacksonxmlTypeConverterTest.java | 71 ++++++++++++++++++++
.../component/jacksonxml/deployment/TestPojo.java | 45 +++++++++++++
.../jackson/json/JacksonJsonResource.java | 49 +-------------
.../dataformats/jackson/json/JacksonJsonRoute.java | 3 +
.../jackson/xml/JacksonXmlResource.java | 27 --------
.../dataformats/jackson/json/JacksonJsonTest.java | 9 ---
.../dataformats/jackson/xml/JacksonXmlTest.java | 8 ---
12 files changed, 349 insertions(+), 92 deletions(-)
diff --git a/extensions/jackson/deployment/pom.xml
b/extensions/jackson/deployment/pom.xml
index 1841476..5a10257 100644
--- a/extensions/jackson/deployment/pom.xml
+++ b/extensions/jackson/deployment/pom.xml
@@ -45,6 +45,16 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jackson</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5-internal</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git
a/extensions/jackson/deployment/src/test/java/org/apache/camel/quarkus/component/jackson/JacksonTypeConverterPojoTest.java
b/extensions/jackson/deployment/src/test/java/org/apache/camel/quarkus/component/jackson/JacksonTypeConverterPojoTest.java
new file mode 100644
index 0000000..8332fff
--- /dev/null
+++
b/extensions/jackson/deployment/src/test/java/org/apache/camel/quarkus/component/jackson/JacksonTypeConverterPojoTest.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jackson;
+
+import javax.inject.Inject;
+
+import io.quarkus.test.QuarkusUnitTest;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.jackson.JacksonConstants;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class JacksonTypeConverterPojoTest {
+ @RegisterExtension
+ static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
+ .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
+ .addClass(Routes.class)
+ .addClass(Order.class));
+
+ @Inject
+ ProducerTemplate producerTemplate;
+
+ @Test
+ public void jacksonConversionPojo() throws Exception {
+ Order order = new Order();
+ order.setAmount(1);
+ order.setCustomerName("Acme");
+ order.setPartName("Camel");
+
+ String json = (String)
producerTemplate.requestBody("direct:jackson-conversion-pojo", order);
+
assertEquals("{\"id\":0,\"partName\":\"Camel\",\"amount\":1,\"customerName\":\"Acme\"}",
json);
+
+ }
+
+ public static final class Routes extends RouteBuilder {
+ @Override
+ public void configure() {
+
this.getContext().getGlobalOptions().put(JacksonConstants.ENABLE_TYPE_CONVERTER,
"true");
+
this.getContext().getGlobalOptions().put(JacksonConstants.TYPE_CONVERTER_TO_POJO,
"true");
+ from("direct:jackson-conversion-pojo").convertBodyTo(String.class);
+ }
+ }
+}
diff --git
a/extensions/jackson/deployment/src/test/java/org/apache/camel/quarkus/component/jackson/JacksonTypeConverterSimpleTest.java
b/extensions/jackson/deployment/src/test/java/org/apache/camel/quarkus/component/jackson/JacksonTypeConverterSimpleTest.java
new file mode 100644
index 0000000..05946d1
--- /dev/null
+++
b/extensions/jackson/deployment/src/test/java/org/apache/camel/quarkus/component/jackson/JacksonTypeConverterSimpleTest.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jackson;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.inject.Inject;
+
+import io.quarkus.test.QuarkusUnitTest;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.jackson.JacksonConstants;
+import org.apache.camel.support.DefaultExchange;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class JacksonTypeConverterSimpleTest {
+ @RegisterExtension
+ static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
+ .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
+ .addClass(Routes.class)
+ .addClass(Order.class));
+ @Inject
+ CamelContext context;
+
+ @Test
+ public void jacksonConversionSimple() throws Exception {
+ Exchange exchange = new DefaultExchange(context);
+
+ Map<String, String> map = new HashMap<>();
+ Object convertedObject =
context.getTypeConverter().convertTo(String.class, exchange, map);
+ // will do a toString which is an empty map
+ assertEquals(map.toString(), convertedObject);
+
+ convertedObject = context.getTypeConverter().convertTo(Long.class,
exchange,
+ new HashMap<String, String>());
+ assertNull(convertedObject);
+
+ convertedObject = context.getTypeConverter().convertTo(long.class,
exchange,
+ new HashMap<String, String>());
+ assertNull(convertedObject);
+
+ convertedObject =
context.getTypeConverter().convertTo(ExchangePattern.class, exchange, "InOnly");
+ assertEquals(ExchangePattern.InOnly, convertedObject);
+ }
+
+ public static final class Routes extends RouteBuilder {
+ @Override
+ public void configure() {
+
this.getContext().getGlobalOptions().put(JacksonConstants.ENABLE_TYPE_CONVERTER,
"true");
+ }
+ }
+
+}
diff --git
a/extensions/jackson/deployment/src/test/java/org/apache/camel/quarkus/component/jackson/Order.java
b/extensions/jackson/deployment/src/test/java/org/apache/camel/quarkus/component/jackson/Order.java
new file mode 100644
index 0000000..b7ac89e
--- /dev/null
+++
b/extensions/jackson/deployment/src/test/java/org/apache/camel/quarkus/component/jackson/Order.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jackson;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import io.quarkus.runtime.annotations.RegisterForReflection;
+
+@XmlRootElement(name = "order")
+@XmlAccessorType(XmlAccessType.FIELD)
+@RegisterForReflection
+public class Order {
+
+ @XmlAttribute
+ private int id;
+ @XmlAttribute
+ private String partName;
+ @XmlAttribute
+ private int amount;
+ @XmlAttribute(name = "customer_name")
+ private String customerName;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getPartName() {
+ return partName;
+ }
+
+ public void setPartName(String partName) {
+ this.partName = partName;
+ }
+
+ public int getAmount() {
+ return amount;
+ }
+
+ public void setAmount(int amount) {
+ this.amount = amount;
+ }
+
+ public String getCustomerName() {
+ return customerName;
+ }
+
+ public void setCustomerName(String customerName) {
+ this.customerName = customerName;
+ }
+}
diff --git a/extensions/jacksonxml/deployment/pom.xml
b/extensions/jacksonxml/deployment/pom.xml
index f3ed3af..14f8754 100644
--- a/extensions/jacksonxml/deployment/pom.xml
+++ b/extensions/jacksonxml/deployment/pom.xml
@@ -42,6 +42,16 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jacksonxml</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5-internal</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git
a/extensions/jacksonxml/deployment/src/test/java/org/apache/camel/quarkus/component/jacksonxml/deployment/JacksonxmlTypeConverterTest.java
b/extensions/jacksonxml/deployment/src/test/java/org/apache/camel/quarkus/component/jacksonxml/deployment/JacksonxmlTypeConverterTest.java
new file mode 100644
index 0000000..10b507b
--- /dev/null
+++
b/extensions/jacksonxml/deployment/src/test/java/org/apache/camel/quarkus/component/jacksonxml/deployment/JacksonxmlTypeConverterTest.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jacksonxml.deployment;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.inject.Inject;
+
+import io.quarkus.test.QuarkusUnitTest;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.jacksonxml.JacksonXMLConstants;
+import org.apache.camel.support.DefaultExchange;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class JacksonxmlTypeConverterTest {
+ @RegisterExtension
+ static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
+ .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
+ .addClass(Routes.class)
+ .addClass(TestPojo.class));
+ @Inject
+ CamelContext context;
+
+ @Test
+ public void jacksonxmlConversion() throws Exception {
+ Exchange exchange = new DefaultExchange(context);
+ Map<String, String> body = new HashMap<>();
+ Object convertedObject =
context.getTypeConverter().convertTo(String.class, exchange, body);
+ // will do a toString which is an empty map
+ assertEquals(body.toString(), convertedObject);
+
+ convertedObject = context.getTypeConverter().convertTo(Long.class,
exchange,
+ new HashMap<String, String>());
+ assertNull(convertedObject);
+
+ convertedObject = context.getTypeConverter().convertTo(long.class,
exchange,
+ new HashMap<String, String>());
+ assertNull(convertedObject);
+ }
+
+ public static final class Routes extends RouteBuilder {
+ @Override
+ public void configure() {
+
this.getContext().getGlobalOptions().put(JacksonXMLConstants.ENABLE_TYPE_CONVERTER,
"true");
+ }
+ }
+
+}
diff --git
a/extensions/jacksonxml/deployment/src/test/java/org/apache/camel/quarkus/component/jacksonxml/deployment/TestPojo.java
b/extensions/jacksonxml/deployment/src/test/java/org/apache/camel/quarkus/component/jacksonxml/deployment/TestPojo.java
new file mode 100644
index 0000000..1ff1053
--- /dev/null
+++
b/extensions/jacksonxml/deployment/src/test/java/org/apache/camel/quarkus/component/jacksonxml/deployment/TestPojo.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jacksonxml.deployment;
+
+public class TestPojo {
+
+ private String name;
+
+ public String getName() {
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return this.name.equals(((TestPojo) obj).getName());
+ }
+
+ @Override
+ public int hashCode() {
+ return name != null ? name.hashCode() : 0;
+ }
+
+ @Override
+ public String toString() {
+ return "TestPojo[" + name + "]";
+ }
+}
diff --git
a/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonResource.java
b/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonResource.java
index 7d7c079..8a9e55a 100644
---
a/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonResource.java
+++
b/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonResource.java
@@ -35,11 +35,9 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
import org.apache.camel.CamelContext;
import org.apache.camel.ConsumerTemplate;
import org.apache.camel.Exchange;
-import org.apache.camel.ExchangePattern;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.component.jackson.JacksonConstants;
import org.apache.camel.component.mock.MockEndpoint;
@@ -50,7 +48,6 @@ import
org.apache.camel.quarkus.component.dataformats.json.model.TestJAXBPojo;
import org.apache.camel.quarkus.component.dataformats.json.model.TestOtherPojo;
import org.apache.camel.quarkus.component.dataformats.json.model.TestPojo;
import org.apache.camel.quarkus.component.dataformats.json.model.TestPojoView;
-import org.apache.camel.support.DefaultExchange;
import org.jboss.logging.Logger;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -493,32 +490,13 @@ public class JacksonJsonResource {
@GET
public void jacksonConversionPojo(String body) throws Exception {
synchronized (context) {
-
context.getGlobalOptions().put(JacksonConstants.ENABLE_TYPE_CONVERTER, "true");
-
context.getGlobalOptions().put(JacksonConstants.TYPE_CONVERTER_TO_POJO, "true");
-
Order order = new Order();
order.setAmount(1);
order.setCustomerName("Acme");
order.setPartName("Camel");
String json = (String)
producerTemplate.requestBody("direct:jackson-conversion-pojo-test", order);
-
assertEquals("{\"id\":0,\"partName\":\"Camel\",\"amount\":1,\"customerName\":\"Acme\"}",
json);
-
-
context.getGlobalOptions().put(JacksonConstants.TYPE_CONVERTER_MODULE_CLASS_NAMES,
- JaxbAnnotationModule.class.getName());
-
- order = new Order();
- order.setAmount(1);
- order.setCustomerName("Acme");
- order.setPartName("Camel");
-
- json = (String)
producerTemplate.requestBody("direct:jackson-conversion-pojo-test", order);
- /*
- * somehow jaxb annotation @XmlAttribute(name = "customer_name")
can't be taken into account so the
- * following asserts failed, need to investigate more
- *
assertEquals("{\"id\":0,\"partName\":\"Camel\",\"amount\":1,\"customer_name\":\"Acme\"}",
- * json);
- */
+
assertEquals("{\"id\":0,\"partName\":\"Camel\",\"amount\":1,\"customer_name\":\"Acme\"}",
json);
}
}
@@ -538,31 +516,6 @@ public class JacksonJsonResource {
}
}
- @Path("jackson/conversion-simple")
- @GET
- public void jacksonConversionSimple(String body) throws Exception {
- synchronized (context) {
-
context.getGlobalOptions().put(JacksonConstants.ENABLE_TYPE_CONVERTER, "true");
- Exchange exchange = new DefaultExchange(context);
-
- Map<String, String> map = new HashMap<>();
- Object convertedObject =
context.getTypeConverter().convertTo(String.class, exchange, map);
- // will do a toString which is an empty map
- assertEquals(map.toString(), convertedObject);
-
- convertedObject = context.getTypeConverter().convertTo(Long.class,
exchange,
- new HashMap<String, String>());
- assertNull(convertedObject);
-
- convertedObject = context.getTypeConverter().convertTo(long.class,
exchange,
- new HashMap<String, String>());
- assertNull(convertedObject);
-
- convertedObject =
context.getTypeConverter().convertTo(ExchangePattern.class, exchange, "InOnly");
- assertEquals(ExchangePattern.InOnly, convertedObject);
- }
- }
-
@Path("jackson/jaxb-annotation")
@GET
public void jacksonJaxbAnnotation() throws Exception {
diff --git
a/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonRoute.java
b/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonRoute.java
index 60a091f..a62e049 100644
---
a/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonRoute.java
+++
b/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonRoute.java
@@ -132,6 +132,9 @@ public class JacksonJsonRoute extends RouteBuilder {
.to("mock:jackson-list-unmarshal-reversePojo");
this.getContext().getGlobalOptions().put(JacksonConstants.ENABLE_TYPE_CONVERTER,
"true");
+
this.getContext().getGlobalOptions().put(JacksonConstants.TYPE_CONVERTER_TO_POJO,
"true");
+
this.getContext().getGlobalOptions().put(JacksonConstants.TYPE_CONVERTER_MODULE_CLASS_NAMES,
+ JaxbAnnotationModule.class.getName());
from("direct:jackson-conversion-pojo-test").convertBodyTo(String.class);
diff --git
a/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlResource.java
b/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlResource.java
index e1506da..7c1d122 100644
---
a/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlResource.java
+++
b/integration-tests/dataformats-json/src/main/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlResource.java
@@ -45,7 +45,6 @@ import
org.apache.camel.quarkus.component.dataformats.json.model.TestJAXBPojo;
import org.apache.camel.quarkus.component.dataformats.json.model.TestOtherPojo;
import org.apache.camel.quarkus.component.dataformats.json.model.TestPojo;
import org.apache.camel.quarkus.component.dataformats.json.model.TestPojoView;
-import org.apache.camel.support.DefaultExchange;
import org.jboss.logging.Logger;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -425,32 +424,6 @@ public class JacksonXmlResource {
mock.assertIsSatisfied();
}
- @Path("jacksonxml/jackson-conversion")
- @GET
- public void jacksonXmlJacksonConversion() throws Exception {
- synchronized (context) {
- String original =
context.getGlobalOptions().get(JacksonXMLConstants.ENABLE_TYPE_CONVERTER);
- try {
- Exchange exchange = new DefaultExchange(context);
-
context.getGlobalOptions().put(JacksonXMLConstants.ENABLE_TYPE_CONVERTER,
"true");
- Map<String, String> body = new HashMap<>();
- Object convertedObject =
context.getTypeConverter().convertTo(String.class, exchange, body);
- // will do a toString which is an empty map
- assertEquals(body.toString(), convertedObject);
-
- convertedObject =
context.getTypeConverter().convertTo(Long.class, exchange,
- new HashMap<String, String>());
- assertNull(convertedObject);
-
- convertedObject =
context.getTypeConverter().convertTo(long.class, exchange,
- new HashMap<String, String>());
- assertNull(convertedObject);
- } finally {
-
context.getGlobalOptions().put(JacksonXMLConstants.ENABLE_TYPE_CONVERTER,
original);
- }
- }
- }
-
@Path("jacksonxml/jaxb-annotation")
@GET
public void jacksonXmlJaxbAnnotation() throws Exception {
diff --git
a/integration-tests/dataformats-json/src/test/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonTest.java
b/integration-tests/dataformats-json/src/test/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonTest.java
index 9349096..e889d8c 100644
---
a/integration-tests/dataformats-json/src/test/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonTest.java
+++
b/integration-tests/dataformats-json/src/test/java/org/apache/camel/quarkus/component/dataformats/jackson/json/JacksonJsonTest.java
@@ -18,7 +18,6 @@ package
org.apache.camel.quarkus.component.dataformats.jackson.json;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import static org.hamcrest.Matchers.equalTo;
@@ -146,7 +145,6 @@ public class JacksonJsonTest {
}
@Test
- @Disabled("https://github.com/apache/camel-quarkus/issues/2726")
void jacksonConversionPojo() {
RestAssured.get("/dataformats-json/jackson/conversion-pojo")
.then()
@@ -161,13 +159,6 @@ public class JacksonJsonTest {
}
@Test
- void jacksonConversionSimple() {
- RestAssured.get("/dataformats-json/jackson/conversion-simple")
- .then()
- .statusCode(204);
- }
-
- @Test
void jacksonJaxbAnnotation() {
RestAssured.get("/dataformats-json/jackson/jaxb-annotation")
.then()
diff --git
a/integration-tests/dataformats-json/src/test/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlTest.java
b/integration-tests/dataformats-json/src/test/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlTest.java
index 6f2b31e..affdb23 100644
---
a/integration-tests/dataformats-json/src/test/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlTest.java
+++
b/integration-tests/dataformats-json/src/test/java/org/apache/camel/quarkus/component/dataformats/jackson/xml/JacksonXmlTest.java
@@ -176,14 +176,6 @@ public class JacksonXmlTest {
}
@Test
- void jacksonXmlJacksonConversion() {
- RestAssured.get("/dataformats-json/jacksonxml/jackson-conversion")
- .then()
- .statusCode(204);
-
- }
-
- @Test
void jacksonXmlJaxbAnnotation() {
RestAssured.get("/dataformats-json/jacksonxml/jaxb-annotation")
.then()