You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/03/24 11:31:15 UTC
[camel] 01/02: Camel-Servicenow: Removed refs to
camel-test-blueprint (camel-karaf migration)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 838ae3218732986e19d00ef3acdf147213700671
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Mar 24 12:26:43 2020 +0100
Camel-Servicenow: Removed refs to camel-test-blueprint (camel-karaf migration)
---
.../camel-servicenow-component/pom.xml | 5 --
.../ServiceNowBlueprintComponentAuthTest.java | 67 ----------------------
.../ServiceNowBlueprintEndpointAuthTest.java | 60 -------------------
.../blueprint/blueprint-component-auth.xml | 55 ------------------
.../OSGI-INF/blueprint/blueprint-endpoint-auth.xml | 37 ------------
5 files changed, 224 deletions(-)
diff --git a/components/camel-servicenow/camel-servicenow-component/pom.xml b/components/camel-servicenow/camel-servicenow-component/pom.xml
index ef072fc..41c34bd 100644
--- a/components/camel-servicenow/camel-servicenow-component/pom.xml
+++ b/components/camel-servicenow/camel-servicenow-component/pom.xml
@@ -105,11 +105,6 @@
<artifactId>camel-test</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-blueprint</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
diff --git a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowBlueprintComponentAuthTest.java b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowBlueprintComponentAuthTest.java
deleted file mode 100644
index 5e80bae..0000000
--- a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowBlueprintComponentAuthTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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.component.servicenow;
-
-import java.util.List;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.component.servicenow.model.Incident;
-import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
-import org.junit.Test;
-
-public class ServiceNowBlueprintComponentAuthTest extends CamelBlueprintTestSupport {
- @Override
- protected String getBlueprintDescriptor() {
- return "OSGI-INF/blueprint/blueprint-component-auth.xml";
- }
-
- @Test
- public void testAuth() throws Exception {
- MockEndpoint mock1 = getMockEndpoint("mock:servicenow-1");
- mock1.expectedMessageCount(1);
- MockEndpoint mock2 = getMockEndpoint("mock:servicenow-2");
- mock2.expectedMessageCount(1);
-
- template().sendBodyAndHeaders(
- "direct:servicenow",
- null,
- ServiceNowTestSupport.kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_RETRIEVE)
- .put(ServiceNowParams.SYSPARM_LIMIT, 10)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .build()
- );
-
- mock1.assertIsSatisfied();
- mock2.assertIsSatisfied();
-
- validate(mock1.getExchanges().get(0));
- validate(mock2.getExchanges().get(0));
- }
-
- private void validate(Exchange exchange) {
- List<Incident> items = exchange.getIn().getBody(List.class);
-
- assertNotNull(items);
- assertTrue(items.size() <= 10);
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.OFFSET_FIRST));
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.OFFSET_NEXT));
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.OFFSET_LAST));
- }
-}
diff --git a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowBlueprintEndpointAuthTest.java b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowBlueprintEndpointAuthTest.java
deleted file mode 100644
index fbb1b55..0000000
--- a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowBlueprintEndpointAuthTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.component.servicenow;
-
-import java.util.List;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.component.servicenow.model.Incident;
-import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
-import org.junit.Test;
-
-public class ServiceNowBlueprintEndpointAuthTest extends CamelBlueprintTestSupport {
- @Override
- protected String getBlueprintDescriptor() {
- return "OSGI-INF/blueprint/blueprint-endpoint-auth.xml";
- }
-
- @Test
- public void testAuth() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:servicenow");
- mock.expectedMessageCount(1);
-
- template().sendBodyAndHeaders(
- "direct:servicenow",
- null,
- ServiceNowTestSupport.kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_RETRIEVE)
- .put(ServiceNowParams.SYSPARM_LIMIT, 10)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .build()
- );
-
- mock.assertIsSatisfied();
-
- Exchange exchange = mock.getExchanges().get(0);
- List<Incident> items = exchange.getIn().getBody(List.class);
-
- assertNotNull(items);
- assertTrue(items.size() <= 10);
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.OFFSET_FIRST));
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.OFFSET_NEXT));
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.OFFSET_LAST));
- }
-}
diff --git a/components/camel-servicenow/camel-servicenow-component/src/test/resources/OSGI-INF/blueprint/blueprint-component-auth.xml b/components/camel-servicenow/camel-servicenow-component/src/test/resources/OSGI-INF/blueprint/blueprint-component-auth.xml
deleted file mode 100644
index 14c4c1f..0000000
--- a/components/camel-servicenow/camel-servicenow-component/src/test/resources/OSGI-INF/blueprint/blueprint-component-auth.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
-
- <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"/>
-
- <bean id="servicenow" class="org.apache.camel.component.servicenow.ServiceNowComponent">
- <property name="userName" value="$[servicenow.username]"/>
- <property name="password" value="$[servicenow.password]"/>
- </bean>
-
- <camelContext xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="direct:servicenow"/>
- <multicast>
- <to uri="direct:route-1"/>
- <to uri="direct:route-2"/>
- </multicast>
- </route>
-
- <route>
- <from uri="direct:route-1"/>
- <to uri="servicenow:{{sys:servicenow.instance}}?excludeReferenceLink=true"/>
- <to uri="log:org.apache.camel.component.servicenow-1?level=INFO"/>
- <to uri="mock:servicenow-1"/>
- </route>
-
- <route>
- <from uri="direct:route-2"/>
- <to uri="servicenow:{{sys:servicenow.instance}}?excludeReferenceLink=false"/>
- <to uri="log:org.apache.camel.component.servicenow-2?level=INFO"/>
- <to uri="mock:servicenow-2"/>
- </route>
-
- </camelContext>
-
-</blueprint>
diff --git a/components/camel-servicenow/camel-servicenow-component/src/test/resources/OSGI-INF/blueprint/blueprint-endpoint-auth.xml b/components/camel-servicenow/camel-servicenow-component/src/test/resources/OSGI-INF/blueprint/blueprint-endpoint-auth.xml
deleted file mode 100644
index f0d1f8b..0000000
--- a/components/camel-servicenow/camel-servicenow-component/src/test/resources/OSGI-INF/blueprint/blueprint-endpoint-auth.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
-
- <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"/>
-
- <bean id="servicenow" class="org.apache.camel.component.servicenow.ServiceNowComponent">
- </bean>
-
- <camelContext xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="direct:servicenow"/>
- <to uri="servicenow:{{sys:servicenow.instance}}?userName={{sys:servicenow.username}}&password={{sys:servicenow.password}}"/>
- <to uri="log:org.apache.camel.component.servicenow?level=INFO"/>
- <to uri="mock:servicenow"/>
- </route>
- </camelContext>
-
-</blueprint>