From 61065adb9395bfcf467f54e8b6a9c78558894cd7 Mon Sep 17 00:00:00 2001 From: lburgazzoli Date: Tue, 12 Mar 2019 14:00:26 +0100 Subject: [PATCH] AtlasMap is unable to find mapping #4846 --- .../camelk/CamelKPublishHandler.java | 28 +++++++++---------- .../camelk/CamelKPublishHandlerTest.java | 3 +- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app/server/controller/src/main/java/io/syndesis/server/controller/integration/camelk/CamelKPublishHandler.java b/app/server/controller/src/main/java/io/syndesis/server/controller/integration/camelk/CamelKPublishHandler.java index 56543be69ff..e6231603a67 100644 --- a/app/server/controller/src/main/java/io/syndesis/server/controller/integration/camelk/CamelKPublishHandler.java +++ b/app/server/controller/src/main/java/io/syndesis/server/controller/integration/camelk/CamelKPublishHandler.java @@ -15,6 +15,19 @@ */ package io.syndesis.server.controller.integration.camelk; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Properties; +import java.util.Set; +import java.util.TreeSet; +import java.util.stream.Collectors; + +import static java.nio.charset.StandardCharsets.UTF_8; + import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectWriter; import io.fabric8.kubernetes.api.model.Secret; @@ -55,19 +68,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Properties; -import java.util.Set; -import java.util.TreeSet; -import java.util.stream.Collectors; - -import static java.nio.charset.StandardCharsets.UTF_8; - @Component @Qualifier("camel-k") @ConditionalOnProperty(value = "controllers.integration", havingValue = "camel-k") @@ -341,7 +341,7 @@ private void addMappingRules(Integration integration, ImmutableIntegrationSpec.B builder.addResources( new ResourceSpec.Builder() .compression(compress) - .name(Names.sanitize(name)) + .name(name) .content(content) .type("data") .build() diff --git a/app/server/controller/src/test/java/io/syndesis/server/controller/integration/camelk/CamelKPublishHandlerTest.java b/app/server/controller/src/test/java/io/syndesis/server/controller/integration/camelk/CamelKPublishHandlerTest.java index 8046f5d392b..917d5b79c49 100644 --- a/app/server/controller/src/test/java/io/syndesis/server/controller/integration/camelk/CamelKPublishHandlerTest.java +++ b/app/server/controller/src/test/java/io/syndesis/server/controller/integration/camelk/CamelKPublishHandlerTest.java @@ -17,7 +17,6 @@ import java.util.Properties; -import com.jcabi.manifests.Manifests; import io.fabric8.kubernetes.api.model.Secret; import io.syndesis.common.model.action.ConnectorAction; import io.syndesis.common.model.action.ConnectorDescriptor; @@ -34,7 +33,6 @@ import io.syndesis.integration.project.generator.ProjectGeneratorConfiguration; import io.syndesis.server.endpoint.v1.VersionService; import io.syndesis.server.openshift.OpenShiftServiceNoOp; -import org.junit.BeforeClass; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -159,5 +157,6 @@ public void testCamelkIntegration() throws Exception { assertThat(i.getSpec().getSources()).isNotEmpty(); assertThat(i.getSpec().getDependencies()).isNotEmpty(); assertThat(i.getSpec().getResources()).isNotEmpty(); + assertThat(i.getSpec().getResources()).anyMatch(r -> "mapping-flow-0-step-1.json".equals(r.getName())); } }