You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2017/08/04 16:10:01 UTC
[10/19] camel git commit: CAMEL-11555: ServiceNow : create a maven
plugin to generate models based on table layout
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/ServiceNowTableTest.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/ServiceNowTableTest.java b/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/ServiceNowTableTest.java
deleted file mode 100644
index e775e85..0000000
--- a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/ServiceNowTableTest.java
+++ /dev/null
@@ -1,361 +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.CamelExecutionException;
-import org.apache.camel.Exchange;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.component.servicenow.model.Incident;
-import org.apache.camel.component.servicenow.model.IncidentWithParms;
-import org.junit.Test;
-
-public class ServiceNowTableTest extends ServiceNowTestSupport {
-
- @Test
- public void testRetrieveSome() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:servicenow");
- mock.expectedMessageCount(1);
-
- template().sendBodyAndHeaders(
- "direct:servicenow",
- null,
- 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.RESPONSE_TYPE));
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.OFFSET_FIRST));
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.OFFSET_NEXT));
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.OFFSET_LAST));
- }
-
- @Test
- public void testRetrieveSomeWithParams() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:servicenow");
- mock.expectedMessageCount(1);
-
- template().sendBodyAndHeaders(
- "direct:servicenow",
- null,
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_RETRIEVE)
- .put(ServiceNowParams.SYSPARM_LIMIT, 10)
- .put(ServiceNowParams.SYSPARM_EXCLUDE_REFERENCE_LINK, false)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .put(ServiceNowConstants.MODEL, IncidentWithParms.class)
- .build()
- );
-
- mock.assertIsSatisfied();
-
- Exchange exchange = mock.getExchanges().get(0);
- List<Incident> items = exchange.getIn().getBody(List.class);
-
- assertNotNull(items);
- assertFalse(items.isEmpty());
- assertTrue(items.size() <= 10);
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.RESPONSE_TYPE));
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.OFFSET_FIRST));
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.OFFSET_NEXT));
- assertNotNull(exchange.getIn().getHeader(ServiceNowConstants.OFFSET_LAST));
- }
-
- @Test
- public void testRetrieveSomeWithDefaults() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:servicenow-defaults");
- mock.expectedMessageCount(1);
-
- template().sendBodyAndHeaders(
- "direct:servicenow-defaults",
- null,
- kvBuilder()
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_RETRIEVE)
- .put(ServiceNowParams.SYSPARM_LIMIT, 10)
- .build()
- );
-
- mock.assertIsSatisfied();
-
- Exchange exchange = mock.getExchanges().get(0);
- List<Incident> items = exchange.getIn().getBody(List.class);
-
- assertNotNull(items);
- assertTrue(items.size() <= 10);
- }
-
- @Test
- public void testIncidentWorkflow() throws Exception {
-
- Incident incident = null;
- String sysId;
- String number;
- MockEndpoint mock = getMockEndpoint("mock:servicenow");
-
- // ************************
- // Create incident
- // ************************
-
- {
- mock.reset();
- mock.expectedMessageCount(1);
-
- incident = new Incident();
- incident.setDescription("my incident");
- incident.setShortDescription("An incident");
- incident.setSeverity(1);
- incident.setImpact(1);
-
- template().sendBodyAndHeaders(
- "direct:servicenow",
- incident,
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_CREATE)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .build()
- );
-
- mock.assertIsSatisfied();
-
- incident = mock.getExchanges().get(0).getIn().getBody(Incident.class);
- sysId = incident.getId();
- number = incident.getNumber();
-
- LOGGER.info("****************************************************");
- LOGGER.info(" Incident created");
- LOGGER.info(" sysid = {}", sysId);
- LOGGER.info(" number = {}", number);
- LOGGER.info("****************************************************");
- }
-
- // ************************
- // Search for the incident
- // ************************
-
- {
- LOGGER.info("Search the record {}", sysId);
-
- mock.reset();
- mock.expectedMessageCount(1);
-
- template().sendBodyAndHeaders(
- "direct:servicenow",
- null,
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_RETRIEVE)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .put(ServiceNowParams.SYSPARM_QUERY, "number=" + number)
- .build()
- );
-
- mock.assertIsSatisfied();
-
- List<Incident> incidents = mock.getExchanges().get(0).getIn().getBody(List.class);
- assertEquals(1, incidents.size());
- assertEquals(number, incidents.get(0).getNumber());
- assertEquals(sysId, incidents.get(0).getId());
- }
-
- // ************************
- // Modify the incident
- // ************************
-
- {
- LOGGER.info("Update the record {}", sysId);
-
- mock.reset();
- mock.expectedMessageCount(1);
-
- incident = new Incident();
- incident.setDescription("my incident");
- incident.setShortDescription("The incident");
- incident.setSeverity(2);
- incident.setImpact(3);
-
- template().sendBodyAndHeaders(
- "direct:servicenow",
- incident,
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_MODIFY)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .put(ServiceNowParams.PARAM_SYS_ID, sysId)
- .build()
- );
-
- mock.assertIsSatisfied();
-
- incident = mock.getExchanges().get(0).getIn().getBody(Incident.class);
- assertEquals(number, incident.getNumber());
- assertEquals(2, incident.getSeverity());
- assertEquals(3, incident.getImpact());
- assertEquals("The incident", incident.getShortDescription());
- }
-
- // ************************
- // Retrieve it via query
- // ************************
-
- {
- LOGGER.info("Retrieve the record {}", sysId);
-
- mock.reset();
- mock.expectedMessageCount(1);
-
- template().sendBodyAndHeaders(
- "direct:servicenow",
- null,
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_RETRIEVE)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .put(ServiceNowParams.SYSPARM_QUERY, "number=" + number)
- .build()
- );
-
- mock.assertIsSatisfied();
-
- List<Incident> incidents = mock.getExchanges().get(0).getIn().getBody(List.class);
- assertEquals(1, incidents.size());
- assertEquals(number, incidents.get(0).getNumber());
- assertEquals(sysId, incidents.get(0).getId());
- assertEquals(2, incidents.get(0).getSeverity());
- assertEquals(3, incidents.get(0).getImpact());
- assertEquals("The incident", incidents.get(0).getShortDescription());
- }
-
- // ************************
- // Retrieve by sys id
- // ************************
-
- {
- LOGGER.info("Search the record {}", sysId);
-
- mock.reset();
- mock.expectedMessageCount(1);
-
- template().sendBodyAndHeaders(
- "direct:servicenow",
- null,
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_RETRIEVE)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .put(ServiceNowParams.PARAM_SYS_ID, sysId)
- .build()
- );
-
- mock.assertIsSatisfied();
-
- incident = mock.getExchanges().get(0).getIn().getBody(Incident.class);
- assertEquals(2, incident.getSeverity());
- assertEquals(3, incident.getImpact());
- assertEquals("The incident", incident.getShortDescription());
- assertEquals(number, incident.getNumber());
- }
-
- // ************************
- // Delete it
- // ************************
-
- {
- LOGGER.info("Delete the record {}", sysId);
-
- mock.reset();
- mock.expectedMessageCount(1);
-
- template().sendBodyAndHeaders(
- "direct:servicenow",
- null,
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_DELETE)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .put(ServiceNowParams.PARAM_SYS_ID, sysId)
- .build()
- );
-
- mock.assertIsSatisfied();
- }
-
- // ************************
- // Retrieve by id, should fail
- // ************************
-
- {
- LOGGER.info("Find the record {}, should fail", sysId);
-
- try {
- template().sendBodyAndHeaders(
- "direct:servicenow",
- null,
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_RETRIEVE)
- .put(ServiceNowParams.PARAM_SYS_ID, sysId)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .build()
- );
-
- fail("Record " + number + " should have been deleted");
- } catch (CamelExecutionException e) {
- assertTrue(e.getCause() instanceof ServiceNowException);
- // we are good
- }
- }
- }
-
- // *************************************************************************
- //
- // *************************************************************************
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- public void configure() {
- from("direct:servicenow")
- .to("servicenow:{{env:SERVICENOW_INSTANCE}}"
- + "?model.incident=org.apache.camel.component.servicenow.model.Incident")
- .to("log:org.apache.camel.component.servicenow?level=INFO&showAll=true")
- .to("mock:servicenow");
- from("direct:servicenow-defaults")
- .to("servicenow:{{env:SERVICENOW_INSTANCE}}"
- + "?model.incident=org.apache.camel.component.servicenow.model.Incident"
- + "&resource=table"
- + "&table=incident")
- .to("log:org.apache.camel.component.servicenow?level=INFO&showAll=true")
- .to("mock:servicenow-defaults");
- }
- };
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/ServiceNowTest.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/ServiceNowTest.java b/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/ServiceNowTest.java
deleted file mode 100644
index 426a8bfa..0000000
--- a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/ServiceNowTest.java
+++ /dev/null
@@ -1,174 +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.UUID;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import org.apache.camel.CamelExecutionException;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.component.servicenow.model.Incident;
-import org.junit.Test;
-
-public class ServiceNowTest extends ServiceNowTestSupport {
-
- @Test
- public void testExceptions() throws Exception {
- // 404
- try {
- template().sendBodyAndHeaders(
- "direct:servicenow",
- null,
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_RETRIEVE)
- .put(ServiceNowParams.SYSPARM_QUERY, "number=" + UUID.randomUUID().toString())
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .build()
- );
- } catch (CamelExecutionException e) {
- assertTrue(e.getCause() instanceof ServiceNowException);
-
- ServiceNowException sne = (ServiceNowException)e.getCause();
- assertEquals("failure", sne.getStatus());
- assertTrue(sne.getMessage().contains("No Record found"));
- assertTrue(sne.getDetail().contains("Records matching query not found"));
- }
-
- // 400
- try {
- template().sendBodyAndHeaders(
- "direct:servicenow",
- null,
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_RETRIEVE)
- .put(ServiceNowParams.SYSPARM_QUERY, "number=" + UUID.randomUUID().toString())
- .put(ServiceNowParams.PARAM_TABLE_NAME, "notExistingTable")
- .build()
- );
- } catch (CamelExecutionException e) {
- assertTrue(e.getCause() instanceof ServiceNowException);
-
- ServiceNowException sne = (ServiceNowException)e.getCause();
- assertEquals("failure", sne.getStatus());
- assertTrue(sne.getMessage().contains("Invalid table notExistingTable"));
- assertNull(sne.getDetail());
- }
- }
-
- @Test
- public void testBodyMismatch() throws Exception {
- try {
- template().sendBodyAndHeaders(
- "direct:servicenow",
- "NotAnIncidentObject",
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, "table")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_CREATE)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .build()
- );
-
- fail("Should fail as body is not compatible with model defined in route for table incident");
- } catch (CamelExecutionException e) {
- assertTrue(e.getCause() instanceof IllegalArgumentException);
- }
- }
-
- @Test
- public void testRequestResponseModels() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:servicenow");
-
- mock.reset();
- mock.expectedMessageCount(1);
-
- Incident incident = new Incident();
- incident.setDescription("my incident");
- incident.setShortDescription("An incident");
- incident.setSeverity(1);
- incident.setImpact(1);
-
- template().sendBodyAndHeaders(
- "direct:servicenow",
- incident,
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, ServiceNowConstants.RESOURCE_TABLE)
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_CREATE)
- .put(ServiceNowConstants.REQUEST_MODEL, Incident.class)
- .put(ServiceNowConstants.RESPONSE_MODEL, JsonNode.class)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .build()
- );
-
- mock.assertIsSatisfied();
-
- Object body = mock.getExchanges().get(0).getIn().getBody();
- assertNotNull(body);
- assertTrue(body instanceof JsonNode);
- }
-
- @Test
- public void testVersionedApiRequest() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:servicenow");
-
- mock.reset();
- mock.expectedMessageCount(1);
-
- Incident incident = new Incident();
- incident.setDescription("my incident");
- incident.setShortDescription("An incident");
- incident.setSeverity(1);
- incident.setImpact(1);
-
- template().sendBodyAndHeaders(
- "direct:servicenow",
- incident,
- kvBuilder()
- .put(ServiceNowConstants.RESOURCE, ServiceNowConstants.RESOURCE_TABLE)
- .put(ServiceNowConstants.API_VERSION, "v1")
- .put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_CREATE)
- .put(ServiceNowConstants.REQUEST_MODEL, Incident.class)
- .put(ServiceNowConstants.RESPONSE_MODEL, JsonNode.class)
- .put(ServiceNowParams.PARAM_TABLE_NAME, "incident")
- .build()
- );
-
- mock.assertIsSatisfied();
-
- Object body = mock.getExchanges().get(0).getIn().getBody();
- assertNotNull(body);
- assertTrue(body instanceof JsonNode);
- }
-
- // *************************************************************************
- //
- // *************************************************************************
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- public void configure() {
- from("direct:servicenow")
- .to("servicenow:{{env:SERVICENOW_INSTANCE}}")
- .to("log:org.apache.camel.component.servicenow?level=INFO&showAll=true")
- .to("mock:servicenow");
- }
- };
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/ServiceNowTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/ServiceNowTestSupport.java b/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/ServiceNowTestSupport.java
deleted file mode 100644
index b3cc5c4..0000000
--- a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/ServiceNowTestSupport.java
+++ /dev/null
@@ -1,122 +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.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.camel.util.ObjectHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-class ServiceNowTestSupport extends CamelTestSupport {
- protected static final Logger LOGGER = LoggerFactory.getLogger(ServiceNowTestSupport.class);
-
- private final boolean setUpComponent;
-
- ServiceNowTestSupport() {
- this(true);
- }
-
- ServiceNowTestSupport(boolean setUpComponent) {
- this.setUpComponent = setUpComponent;
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
- if (setUpComponent) {
- configureServicenowComponent(context);
- }
-
- return context;
- }
-
- protected Map<String, Object> getParameters() {
- HashMap<String, Object> parameters = new HashMap<>();
- parameters.put("instanceName", getSystemPropertyOrEnvVar("servicenow.instance"));
- parameters.put("userName", getSystemPropertyOrEnvVar("servicenow.username"));
- parameters.put("password", getSystemPropertyOrEnvVar("servicenow.password"));
- parameters.put("oauthClientId", getSystemPropertyOrEnvVar("servicenow.oauth2.client.id"));
- parameters.put("oauthClientSecret", getSystemPropertyOrEnvVar("servicenow.oauth2.client.secret"));
-
- return parameters;
- }
-
- public void configureServicenowComponent(CamelContext camelContext) throws Exception {
- String userName = getSystemPropertyOrEnvVar("servicenow.username");
- String password = getSystemPropertyOrEnvVar("servicenow.password");
- String oauthClientId = getSystemPropertyOrEnvVar("servicenow.oauth2.client.id");
- String oauthClientSecret = getSystemPropertyOrEnvVar("servicenow.oauth2.client.secret");
-
- if (ObjectHelper.isNotEmpty(userName) && ObjectHelper.isNotEmpty(password)) {
- ServiceNowComponent component = new ServiceNowComponent();
- component.setUserName(userName);
- component.setPassword(password);
-
- if (ObjectHelper.isNotEmpty(oauthClientId) && ObjectHelper.isNotEmpty(oauthClientSecret)) {
- component.setOauthClientId(oauthClientId);
- component.setOauthClientSecret(oauthClientSecret);
- }
-
- camelContext.addComponent("servicenow", component);
- }
- }
-
- public static String getSystemPropertyOrEnvVar(String systemProperty) {
- String answer = System.getProperty(systemProperty);
- if (ObjectHelper.isEmpty(answer)) {
- String envProperty = systemProperty.toUpperCase().replaceAll("[.-]", "_");
- answer = System.getenv(envProperty);
- }
-
- return answer;
- }
-
- protected static KVBuilder kvBuilder() {
- return new KVBuilder(new HashMap<>());
- }
-
- protected static KVBuilder kvBuilder(Map<String, Object> headers) {
- return new KVBuilder(headers);
- }
-
- protected static final class KVBuilder {
- private final Map<String, Object> headers;
-
- private KVBuilder(Map<String, Object> headers) {
- this.headers = new HashMap<>(headers);
- }
-
- public KVBuilder put(String key, Object val) {
- headers.put(key, val);
- return this;
- }
-
- public KVBuilder put(ServiceNowParam key, Object val) {
- headers.put(key.getHeader(), val);
- return this;
- }
-
- public Map<String, Object> build() {
- return Collections.unmodifiableMap(this.headers);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/AttachmentMeta.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/AttachmentMeta.java b/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/AttachmentMeta.java
deleted file mode 100644
index 21fbb38..0000000
--- a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/AttachmentMeta.java
+++ /dev/null
@@ -1,92 +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.model;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class AttachmentMeta {
- @JsonProperty("sys_id")
- private String id;
-
- @JsonProperty("download_link")
- private String downloadLink;
-
- @JsonProperty("table_name")
- private String tableName;
-
- @JsonProperty("table_sys_id")
- private String tableSysId;
-
- @JsonProperty("compressed")
- private Boolean compressed;
-
- @JsonProperty("file_name")
- private String fileName;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getDownloadLink() {
- return downloadLink;
- }
-
- public void setDownloadLink(String downloadLink) {
- this.downloadLink = downloadLink;
- }
-
- public String getTableName() {
- return tableName;
- }
-
- public void setTableName(String tableName) {
- this.tableName = tableName;
- }
-
- public String getTableSysId() {
- return tableSysId;
- }
-
- public void setTableSysId(String tableSysId) {
- this.tableSysId = tableSysId;
- }
-
- public Boolean getCompressed() {
- return compressed;
- }
-
- public void setCompressed(Boolean compressed) {
- this.compressed = compressed;
- }
-
- public String getFileName() {
- return fileName;
- }
-
- public void setFileName(String fileName) {
- this.fileName = fileName;
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/Incident.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/Incident.java b/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/Incident.java
deleted file mode 100644
index c909413..0000000
--- a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/Incident.java
+++ /dev/null
@@ -1,97 +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.model;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class Incident {
- @JsonProperty("sys_id")
- private String id;
-
- @JsonProperty("number")
- private String number;
-
- @JsonProperty("description")
- private String description;
-
- @JsonProperty("short_description")
- private String shortDescription;
-
- @JsonProperty("severity")
- private int severity;
-
- @JsonProperty("impact")
- private int impact;
-
-
- public Incident() {
- }
-
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getNumber() {
- return number;
- }
-
- public void setNumber(String number) {
- this.number = number;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getShortDescription() {
- return shortDescription;
- }
-
- public void setShortDescription(String shortDescription) {
- this.shortDescription = shortDescription;
- }
-
- public int getSeverity() {
- return severity;
- }
-
- public void setSeverity(int severity) {
- this.severity = severity;
- }
-
- public int getImpact() {
- return impact;
- }
-
- public void setImpact(int impact) {
- this.impact = impact;
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/IncidentWithParms.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/IncidentWithParms.java b/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/IncidentWithParms.java
deleted file mode 100644
index 03ff9ff..0000000
--- a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/IncidentWithParms.java
+++ /dev/null
@@ -1,64 +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.model;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.camel.component.servicenow.annotations.ServiceNowSysParm;
-
-@ServiceNowSysParm(name = "sysparm_exclude_reference_link", value = "true")
-@ServiceNowSysParm(name = "sysparm_fields", value = "id%2Cnumber%2Ccaller_id")
-@JsonIgnoreProperties(ignoreUnknown = true)
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class IncidentWithParms {
- @JsonProperty("sys_id")
- private String id;
- @JsonProperty("number")
- private String number;
- @JsonProperty("caller_id")
- private String callerId;
-
- public IncidentWithParms() {
- }
-
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getNumber() {
- return number;
- }
-
- public void setNumber(String number) {
- this.number = number;
- }
-
- public String getCallerId() {
- return callerId;
- }
-
- public void setCallerId(String callerId) {
- this.callerId = callerId;
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/Scorecard.java
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/Scorecard.java b/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/Scorecard.java
deleted file mode 100644
index dabb23e..0000000
--- a/components/camel-servicenow/src/test/java/org/apache/camel/component/servicenow/model/Scorecard.java
+++ /dev/null
@@ -1,46 +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.model;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class Scorecard {
- @JsonProperty("name")
- private String name;
- @JsonProperty("description")
- private String description;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/components/camel-servicenow/src/test/resources/OSGI-INF/blueprint/blueprint-component-auth.xml
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/test/resources/OSGI-INF/blueprint/blueprint-component-auth.xml b/components/camel-servicenow/src/test/resources/OSGI-INF/blueprint/blueprint-component-auth.xml
deleted file mode 100644
index 14c4c1f..0000000
--- a/components/camel-servicenow/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>
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/components/camel-servicenow/src/test/resources/OSGI-INF/blueprint/blueprint-endpoint-auth.xml
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/test/resources/OSGI-INF/blueprint/blueprint-endpoint-auth.xml b/components/camel-servicenow/src/test/resources/OSGI-INF/blueprint/blueprint-endpoint-auth.xml
deleted file mode 100644
index f0d1f8b..0000000
--- a/components/camel-servicenow/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>
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/components/camel-servicenow/src/test/resources/log4j2.properties
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/test/resources/log4j2.properties b/components/camel-servicenow/src/test/resources/log4j2.properties
deleted file mode 100644
index edd6b44..0000000
--- a/components/camel-servicenow/src/test/resources/log4j2.properties
+++ /dev/null
@@ -1,43 +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.
-## ---------------------------------------------------------------------------
-
-appender.file.type = File
-appender.file.name = file
-appender.file.fileName = target/camel-servicenow-test.log
-appender.file.layout.type = PatternLayout
-appender.file.layout.pattern = %d %-5p %c{1} - %m %n
-
-appender.out.type = Console
-appender.out.name = out
-appender.out.layout.type = PatternLayout
-appender.out.layout.pattern = %d{HH:mm:ss.SSS} [%-15.15t] %-30.30c{1} %-5p %m%n
-
-logger.servicenow.name = org.apache.camel.component.servicenow
-logger.servicenow.level = DEBUG
-
-#logger.metadata.name = org.apache.camel.component.servicenow.ServiceNowMetaDataExtensionTest
-#logger.metadata.level = DEBUG
-#logger.metadata.additivity = true
-#logger.metadata.appenderRef.metadata.ref = out
-
-#logger.metadata-ext.name = org.apache.camel.component.servicenow.ServiceNowMetaDataExtension
-#logger.metadata-ext.level = DEBUG
-#logger.metadata-ext.additivity = true
-#logger.metadata-ext.appenderRef.metadata-ext.ref = out
-
-rootLogger.level = INFO
-rootLogger.appenderRef.root.ref = file
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/components/camel-servicenow/src/test/resources/my-content.txt
----------------------------------------------------------------------
diff --git a/components/camel-servicenow/src/test/resources/my-content.txt b/components/camel-servicenow/src/test/resources/my-content.txt
deleted file mode 100644
index 63b8767..0000000
--- a/components/camel-servicenow/src/test/resources/my-content.txt
+++ /dev/null
@@ -1,16 +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.
-## ---------------------------------------------------------------------------
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index a919a5d..f978d4d 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -160,6 +160,7 @@
<commons-net-version>3.6</commons-net-version>
<commons-pool-version>1.6</commons-pool-version>
<commons-pool2-version>2.4.2</commons-pool2-version>
+ <commons-text-version>1.1</commons-text-version>
<commons-vfs2-version>2.0</commons-vfs2-version>
<compress-lzf-version>1.0.4</compress-lzf-version>
<consul-client-version>0.16.2</consul-client-version>
@@ -468,6 +469,8 @@
<maven-jboss-as-maven-plugin-version>7.7.Final</maven-jboss-as-maven-plugin-version>
<!-- plugin-plugin 3.5 does not work -->
<maven-plugin-plugin-version>3.4</maven-plugin-plugin-version>
+ <maven-plugin-annotations-version>3.5</maven-plugin-annotations-version>
+ <maven-plugin-testing-harness-version>3.3.0</maven-plugin-testing-harness-version>
<maven-remote-resources-plugin-version>1.5</maven-remote-resources-plugin-version>
<!-- resources plugin needed by Camel maven archetypes -->
<maven-resources-plugin-version>3.0.2</maven-resources-plugin-version>
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogKarafMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogKarafMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogKarafMojo.java
index b4235e9..7aeaa714 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogKarafMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogKarafMojo.java
@@ -160,6 +160,8 @@ public class PrepareCatalogKarafMojo extends AbstractMojo {
target = new File(dir, "camel-salesforce-component/target/classes");
} else if ("camel-linkedin".equals(dir.getName())) {
target = new File(dir, "camel-linkedin-component/target/classes");
+ } else if ("camel-servicenow".equals(dir.getName())) {
+ target = new File(dir, "camel-servicenow-component/target/classes");
}
findComponentFilesRecursive(target, jsonFiles, componentFiles, new CamelComponentsFileFilter());
@@ -387,6 +389,7 @@ public class PrepareCatalogKarafMojo extends AbstractMojo {
boolean special2 = "camel-linkedin".equals(dir.getName())
|| "camel-olingo2".equals(dir.getName())
|| "camel-olingo4".equals(dir.getName())
+ || "camel-servicenow".equals(dir.getName())
|| "camel-salesforce".equals(dir.getName());
if (special || special2) {
continue;
@@ -658,4 +661,4 @@ public class PrepareCatalogKarafMojo extends AbstractMojo {
return answer;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java
index 4f6c09b..9154da5 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java
@@ -353,6 +353,8 @@ public class PrepareCatalogMojo extends AbstractMojo {
target = new File(dir, "camel-olingo4-component/target/classes");
} else if ("camel-box".equals(dir.getName())) {
target = new File(dir, "camel-box-component/target/classes");
+ } else if ("camel-servicenow".equals(dir.getName())) {
+ target = new File(dir, "camel-servicenow-component/target/classes");
}
int before = componentFiles.size();
@@ -795,6 +797,7 @@ public class PrepareCatalogMojo extends AbstractMojo {
boolean special2 = "camel-linkedin".equals(dir.getName())
|| "camel-olingo2".equals(dir.getName())
|| "camel-olingo4".equals(dir.getName())
+ || "camel-servicenow".equals(dir.getName())
|| "camel-salesforce".equals(dir.getName());
if (special || special2) {
continue;
@@ -971,6 +974,8 @@ public class PrepareCatalogMojo extends AbstractMojo {
target = new File(dir, "camel-olingo4-component/src/main/docs");
} else if ("camel-box".equals(dir.getName())) {
target = new File(dir, "camel-box-component/src/main/docs");
+ } else if ("camel-servicenow".equals(dir.getName())) {
+ target = new File(dir, "camel-servicenow-component/src/main/docs");
}
int before = adocFiles.size();
@@ -1096,7 +1101,7 @@ public class PrepareCatalogMojo extends AbstractMojo {
component = "ftp";
}
String name = component + "-component";
- if (!docs.contains(name) && (!component.equalsIgnoreCase("linkedin") && !component.equalsIgnoreCase("salesforce"))) {
+ if (!docs.contains(name) && (!component.equalsIgnoreCase("linkedin") && !component.equalsIgnoreCase("salesforce") && !component.equalsIgnoreCase("servicenow"))) {
missing.add(name);
}
}
@@ -1624,4 +1629,4 @@ public class PrepareCatalogMojo extends AbstractMojo {
return false;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogSpringBootMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogSpringBootMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogSpringBootMojo.java
index 6618520..4557e4d 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogSpringBootMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogSpringBootMojo.java
@@ -155,6 +155,8 @@ public class PrepareCatalogSpringBootMojo extends AbstractMojo {
target = new File(dir, "camel-salesforce-component/target/classes");
} else if ("camel-linkedin".equals(dir.getName())) {
target = new File(dir, "camel-linkedin-component/target/classes");
+ } else if ("camel-servicenow".equals(dir.getName())) {
+ target = new File(dir, "camel-servicenow-component/target/classes");
}
@@ -414,6 +416,7 @@ public class PrepareCatalogSpringBootMojo extends AbstractMojo {
boolean special2 = "camel-linkedin".equals(dir.getName())
|| "camel-olingo2".equals(dir.getName())
|| "camel-olingo4".equals(dir.getName())
+ || "camel-servicenow".equals(dir.getName())
|| "camel-salesforce".equals(dir.getName());
if (special || special2) {
continue;
http://git-wip-us.apache.org/repos/asf/camel/blob/109da7c9/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/ComponentModel.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/ComponentModel.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/ComponentModel.java
index e067516..65fd4aa 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/ComponentModel.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/model/ComponentModel.java
@@ -238,6 +238,8 @@ public class ComponentModel {
return "camel-olingo4/camel-olingo4-component/src/main/docs";
} else if ("camel-salesforce".equals(artifactId)) {
return "camel-salesforce/camel-salesforce-component/src/main/docs";
+ } else if ("camel-servicenow".equals(artifactId)) {
+ return "camel-servicenow/camel-servicenow-component/src/main/docs";
}
if ("camel-core".equals(artifactId)) {