camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhira...@apache.org
Subject [8/8] camel git commit: CAMEL-10743: Fixed CS errors
Date Thu, 03 Aug 2017 08:35:56 GMT
CAMEL-10743: Fixed CS errors


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/862be0ee
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/862be0ee
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/862be0ee

Branch: refs/heads/camel-2.19.x
Commit: 862be0eea31732ea3bfcefec465a07d429d3f27b
Parents: bb2adef
Author: Dhiraj Bokde <dhirajsb@yahoo.com>
Authored: Thu Aug 3 01:34:34 2017 -0700
Committer: Dhiraj Bokde <dhirajsb@yahoo.com>
Committed: Thu Aug 3 01:34:34 2017 -0700

----------------------------------------------------------------------
 .../salesforce/internal/SalesforceSession.java  |  2 +-
 .../component/salesforce/RawPayloadTest.java    | 32 ++++++++++----------
 .../salesforce/api/utils/JsonUtilsTest.java     | 26 +++++++++++++---
 .../CamelSalesforceMojoIntegrationTest.java     |  8 ++---
 4 files changed, 42 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/862be0ee/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
index a7a9303..9ed4404 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
@@ -247,7 +247,7 @@ public class SalesforceSession implements Service {
                 // don't log token or instance URL for security reasons
                 LOG.info("Login successful");
                 accessToken = token.getAccessToken();
-                instanceUrl = Optional.ofNullable(config.getInstanceUrl()).orElse(token.getInstanceUrl());
+                instanceUrl = token.getInstanceUrl();
                 // strip trailing '/'
                 int lastChar = instanceUrl.length() - 1;
                 if (instanceUrl.charAt(lastChar) == '/') {

http://git-wip-us.apache.org/repos/asf/camel/blob/862be0ee/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RawPayloadTest.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RawPayloadTest.java
b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RawPayloadTest.java
index 7d6941c..c7c74af 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RawPayloadTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RawPayloadTest.java
@@ -23,6 +23,12 @@ import java.util.Map;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import okhttp3.HttpUrl;
+import okhttp3.mockwebserver.Dispatcher;
+import okhttp3.mockwebserver.MockResponse;
+import okhttp3.mockwebserver.MockWebServer;
+import okhttp3.mockwebserver.RecordedRequest;
+
 import org.apache.camel.builder.RouteBuilder;
 import org.eclipse.jetty.http.HttpHeader;
 import org.junit.AfterClass;
@@ -35,16 +41,16 @@ import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameter;
 import org.junit.runners.Parameterized.Parameters;
 
-import okhttp3.HttpUrl;
-import okhttp3.mockwebserver.Dispatcher;
-import okhttp3.mockwebserver.MockResponse;
-import okhttp3.mockwebserver.MockWebServer;
-import okhttp3.mockwebserver.RecordedRequest;
-
 @Category(Standalone.class)
 @RunWith(Parameterized.class)
 public class RawPayloadTest extends AbstractSalesforceTestBase {
 
+    @Parameter
+    public static String format;
+
+    @Parameter(1)
+    public static String endpointUri;
+
     private static final String OAUTH2_TOKEN_PATH = "/services/oauth2/token";
     private static final String XML_RESPONSE = "<response/>";
     private static final String JSON_RESPONSE = "{ \"response\" : \"mock\" }";
@@ -52,12 +58,6 @@ public class RawPayloadTest extends AbstractSalesforceTestBase {
     private static HttpUrl loginUrl;
     private static MockWebServer server;
 
-    @Parameter
-    public static String format;
-
-    @Parameter(1)
-    public static String endpointUri;
-
     private static String lastFormat;
     private static String expectedResponse;
     private static String requestBody;
@@ -227,10 +227,10 @@ public class RawPayloadTest extends AbstractSalesforceTestBase {
     @Parameters(name = "format = {0}, endpoint = {1}")
     public static List<String[]> parameters() {
         final String[] endpoints = {"direct:getVersions", "direct:getResources", "direct:getGlobalObjects",
-                "direct:getBasicInfo", "direct:getDescription", "direct:getSObject", "direct:createSObject",

-                "direct:updateSObject", "direct:deleteSObject", "direct:getSObjectWithId",
"direct:upsertSObject", 
-                "direct:deleteSObjectWithId", "direct:getBlobField", "direct:query", "direct:queryAll",

-                "direct:search", "direct:apexCallGet", "direct:apexCallGetWithId", "direct:apexCallPatch"};
+            "direct:getBasicInfo", "direct:getDescription", "direct:getSObject", "direct:createSObject",

+            "direct:updateSObject", "direct:deleteSObject", "direct:getSObjectWithId", "direct:upsertSObject",

+            "direct:deleteSObjectWithId", "direct:getBlobField", "direct:query", "direct:queryAll",

+            "direct:search", "direct:apexCallGet", "direct:apexCallGetWithId", "direct:apexCallPatch"};
 
         final String[] formats = {"XML", "JSON"};
 

http://git-wip-us.apache.org/repos/asf/camel/blob/862be0ee/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/api/utils/JsonUtilsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/api/utils/JsonUtilsTest.java
b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/api/utils/JsonUtilsTest.java
index cd59a9e..ccbe730 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/api/utils/JsonUtilsTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/api/utils/JsonUtilsTest.java
@@ -1,15 +1,31 @@
+/**
+ * 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.salesforce.api.utils;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.module.jsonSchema.JsonSchema;
+import com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema;
+
 import org.apache.camel.component.salesforce.api.dto.SObjectDescription;
 import org.apache.camel.component.salesforce.dto.generated.Account;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.module.jsonSchema.JsonSchema;
-import com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -53,4 +69,4 @@ public class JsonUtilsTest {
         assertEquals(2, ((ObjectSchema)jsonSchema).getOneOf().size());
     }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/862be0ee/components/camel-salesforce/camel-salesforce-maven-plugin/src/test/java/org/apache/camel/maven/CamelSalesforceMojoIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-maven-plugin/src/test/java/org/apache/camel/maven/CamelSalesforceMojoIntegrationTest.java
b/components/camel-salesforce/camel-salesforce-maven-plugin/src/test/java/org/apache/camel/maven/CamelSalesforceMojoIntegrationTest.java
index 2f75608..4d47e2f 100644
--- a/components/camel-salesforce/camel-salesforce-maven-plugin/src/test/java/org/apache/camel/maven/CamelSalesforceMojoIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-maven-plugin/src/test/java/org/apache/camel/maven/CamelSalesforceMojoIntegrationTest.java
@@ -23,6 +23,10 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.module.jsonSchema.JsonSchema;
+import com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema;
+
 import org.apache.camel.component.salesforce.SalesforceEndpointConfig;
 import org.apache.camel.component.salesforce.SalesforceLoginConfig;
 import org.apache.camel.component.salesforce.api.utils.JsonUtils;
@@ -30,10 +34,6 @@ import org.apache.maven.plugin.logging.SystemStreamLog;
 import org.junit.Assert;
 import org.junit.Test;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.module.jsonSchema.JsonSchema;
-import com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema;
-
 public class CamelSalesforceMojoIntegrationTest {
 
     private static final String TEST_LOGIN_PROPERTIES = "../test-salesforce-login.properties";


Mime
View raw message