From c25144ea1856b223b06025d0717b899b65dece29 Mon Sep 17 00:00:00 2001 From: lburgazzoli Date: Fri, 1 Mar 2019 15:48:14 +0100 Subject: [PATCH] camle-knative: set CloudEvents v0.2 as default spec version --- .../apache/camel/component/knative/KnativeConfiguration.java | 4 ++-- .../apache/camel/component/knative/KnativeComponentTest.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/camel-knative/src/main/java/org/apache/camel/component/knative/KnativeConfiguration.java b/camel-knative/src/main/java/org/apache/camel/component/knative/KnativeConfiguration.java index 9d8a0220e..49564748a 100644 --- a/camel-knative/src/main/java/org/apache/camel/component/knative/KnativeConfiguration.java +++ b/camel-knative/src/main/java/org/apache/camel/component/knative/KnativeConfiguration.java @@ -26,8 +26,8 @@ public class KnativeConfiguration implements Cloneable { @UriParam(defaultValue = "false") private boolean jsonSerializationEnabled; - @UriParam(defaultValue = "0.1", enums = "0.1,0.2") - private String cloudEventsSpecVersion = "0.1"; + @UriParam(defaultValue = "0.2", enums = "0.1,0.2") + private String cloudEventsSpecVersion = "0.2"; public KnativeConfiguration() { } diff --git a/camel-knative/src/test/java/org/apache/camel/component/knative/KnativeComponentTest.java b/camel-knative/src/test/java/org/apache/camel/component/knative/KnativeComponentTest.java index 358149e63..bd9107d47 100644 --- a/camel-knative/src/test/java/org/apache/camel/component/knative/KnativeComponentTest.java +++ b/camel-knative/src/test/java/org/apache/camel/component/knative/KnativeComponentTest.java @@ -27,6 +27,7 @@ import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.cloud.ServiceDefinition; +import org.apache.camel.component.knative.ce.CloudEventsProcessors; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.component.netty4.NettyEndpoint; import org.apache.camel.component.properties.PropertiesComponent; @@ -331,6 +332,7 @@ void testInvokeEndpoint() throws Exception { )); KnativeComponent component = context.getComponent("knative", KnativeComponent.class); + component.setCloudEventsSpecVersion(CloudEventsProcessors.v01.getVersion()); component.setEnvironment(env); context.addRoutes(new RouteBuilder() { @@ -385,6 +387,7 @@ void testConsumeStructuredContent() throws Exception { )); KnativeComponent component = context.getComponent("knative", KnativeComponent.class); + component.setCloudEventsSpecVersion(CloudEventsProcessors.v01.getVersion()); component.setEnvironment(env); context.addRoutes(new RouteBuilder() { @@ -448,6 +451,7 @@ void testConsumeContent() throws Exception { )); KnativeComponent component = context.getComponent("knative", KnativeComponent.class); + component.setCloudEventsSpecVersion(CloudEventsProcessors.v01.getVersion()); component.setEnvironment(env); context.addRoutes(new RouteBuilder() { @@ -521,6 +525,7 @@ void testConsumeContentWithFilter() throws Exception { )); KnativeComponent component = context.getComponent("knative", KnativeComponent.class); + component.setCloudEventsSpecVersion(CloudEventsProcessors.v01.getVersion()); component.setEnvironment(env); context.addRoutes(new RouteBuilder() {