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 2017/01/05 09:45:02 UTC
camel git commit: Update camel-sap-netweaver tests to use latest
gateway URL
Repository: camel
Updated Branches:
refs/heads/camel-2.17.x 6e7bb4f2c -> e21612ab8
Update camel-sap-netweaver tests to use latest gateway URL
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e21612ab
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e21612ab
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e21612ab
Branch: refs/heads/camel-2.17.x
Commit: e21612ab8d2fc423236ed4d6917800edf932f935
Parents: 6e7bb4f
Author: James Netherton <ja...@gmail.com>
Authored: Thu Jan 5 09:35:15 2017 +0000
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jan 5 10:42:12 2017 +0100
----------------------------------------------------------------------
.../sap/netweaver/NetWeaverFlightDataTest.java | 11 ++++-----
.../NetWeaverFlightDataVelocityTest.java | 7 +++---
.../sap/netweaver/NetWeaverTestConstants.java | 26 ++++++++++++++++++++
3 files changed, 34 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/e21612ab/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverFlightDataTest.java
----------------------------------------------------------------------
diff --git a/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverFlightDataTest.java b/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverFlightDataTest.java
index dc799d5..6bb86fa 100644
--- a/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverFlightDataTest.java
+++ b/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverFlightDataTest.java
@@ -24,15 +24,13 @@ public class NetWeaverFlightDataTest extends CamelTestSupport {
private String username = "P1909969254";
private String password = "TODO";
- private String url = "https://sapes1.sapdevcenter.com/sap/opu/odata/IWBEP/RMTSAMPLEFLIGHT_2/";
- private String command = "FlightCollection(AirLineID='AA',FlightConnectionID='0017',FlightDate=datetime'2012-08-29T00%3A00%3A00')";
- private String command2 = "FlightCollection(AirLineID='AA',FlightConnectionID='0017',FlightDate=datetime'2012-08-29T00%3A00%3A00')/FlightBooking";
@Test
public void testNetWeaverFlight() throws Exception {
getMockEndpoint("mock:result").expectedMessageCount(1);
- template.sendBodyAndHeader("direct:start", "Dummy", NetWeaverConstants.COMMAND, command);
+ template.sendBodyAndHeader("direct:start", "Dummy", NetWeaverConstants.COMMAND,
+ NetWeaverTestConstants.NETWEAVER_FLIGHT_COMMAND);
assertMockEndpointsSatisfied();
}
@@ -41,7 +39,8 @@ public class NetWeaverFlightDataTest extends CamelTestSupport {
public void testNetWeaverFlight2() throws Exception {
getMockEndpoint("mock:result").expectedMessageCount(1);
- template.sendBodyAndHeader("direct:start", "Dummy", NetWeaverConstants.COMMAND, command2);
+ template.sendBodyAndHeader("direct:start", "Dummy", NetWeaverConstants.COMMAND,
+ NetWeaverTestConstants.NETWEAVER_FLIGHT_BOOKING_COMMAND);
assertMockEndpointsSatisfied();
}
@@ -52,7 +51,7 @@ public class NetWeaverFlightDataTest extends CamelTestSupport {
@Override
public void configure() throws Exception {
from("direct:start")
- .toF("sap-netweaver:%s?username=%s&password=%s", url, username, password)
+ .toF("sap-netweaver:%s?username=%s&password=%s", NetWeaverTestConstants.NETWEAVER_GATEWAY_URL, username, password)
.to("log:response")
.to("mock:result");
}
http://git-wip-us.apache.org/repos/asf/camel/blob/e21612ab/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverFlightDataVelocityTest.java
----------------------------------------------------------------------
diff --git a/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverFlightDataVelocityTest.java b/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverFlightDataVelocityTest.java
index bfeb924..e35557c 100644
--- a/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverFlightDataVelocityTest.java
+++ b/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverFlightDataVelocityTest.java
@@ -24,14 +24,13 @@ public class NetWeaverFlightDataVelocityTest extends CamelTestSupport {
private String username = "P1909969254";
private String password = "TODO";
- private String url = "https://sapes1.sapdevcenter.com/sap/opu/odata/IWBEP/RMTSAMPLEFLIGHT_2/";
- private String command = "FlightCollection(AirLineID='AA',FlightConnectionID='0017',FlightDate=datetime'2012-08-29T00%3A00%3A00')";
@Test
public void testNetWeaverFlight() throws Exception {
getMockEndpoint("mock:result").expectedMessageCount(1);
- template.sendBodyAndHeader("direct:start", "Dummy", NetWeaverConstants.COMMAND, command);
+ template.sendBodyAndHeader("direct:start", "Dummy", NetWeaverConstants.COMMAND,
+ NetWeaverTestConstants.NETWEAVER_FLIGHT_COMMAND);
assertMockEndpointsSatisfied();
}
@@ -42,7 +41,7 @@ public class NetWeaverFlightDataVelocityTest extends CamelTestSupport {
@Override
public void configure() throws Exception {
from("direct:start")
- .toF("sap-netweaver:%s?username=%s&password=%s", url, username, password)
+ .toF("sap-netweaver:%s?username=%s&password=%s", NetWeaverTestConstants.NETWEAVER_GATEWAY_URL, username, password)
.to("log:response")
.to("velocity:flight-info.vm")
.to("log:info")
http://git-wip-us.apache.org/repos/asf/camel/blob/e21612ab/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverTestConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverTestConstants.java b/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverTestConstants.java
new file mode 100644
index 0000000..dc2c7b1
--- /dev/null
+++ b/components/camel-sap-netweaver/src/test/java/org/apache/camel/component/sap/netweaver/NetWeaverTestConstants.java
@@ -0,0 +1,26 @@
+/**
+ * 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.sap.netweaver;
+
+public final class NetWeaverTestConstants {
+ public static final String NETWEAVER_GATEWAY_URL = "https://sapes4.sapdevcenter.com/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT";
+ public static final String NETWEAVER_FLIGHT_COMMAND = "FlightCollection(carrid='AA',connid='0017',fldate=datetime'2016-04-20T00%3A00%3A00')";
+ public static final String NETWEAVER_FLIGHT_BOOKING_COMMAND = NETWEAVER_FLIGHT_COMMAND + "/flightbooking";
+
+ private NetWeaverTestConstants() {
+ }
+}