camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhira...@apache.org
Subject [2/2] camel git commit: Polished formatting. This closes #617.
Date Tue, 22 Sep 2015 23:44:59 GMT
Polished formatting. This closes #617.


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

Branch: refs/heads/camel-2.15.x
Commit: 2dd6f688051b750ef45896cea82df6feb189bc31
Parents: c13656d
Author: Dhiraj Bokde <dhirajsb@yahoo.com>
Authored: Tue Sep 22 16:39:00 2015 -0700
Committer: Dhiraj Bokde <dhirajsb@yahoo.com>
Committed: Tue Sep 22 16:43:54 2015 -0700

----------------------------------------------------------------------
 .../salesforce/internal/dto/LoginToken.java     |  2 +-
 .../salesforce/internal/LoginTokenTest.java     | 83 ++++++++++++--------
 2 files changed, 51 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2dd6f688/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java
index cf4d212..7f7e2c6 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java
@@ -22,7 +22,7 @@ import org.codehaus.jackson.annotate.JsonProperty;
 /**
  * DTO for Salesforce login
  */
-@JsonIgnoreProperties(ignoreUnknown=true)
+@JsonIgnoreProperties(ignoreUnknown = true)
 public class LoginToken {
 
     private String accessToken;

http://git-wip-us.apache.org/repos/asf/camel/blob/2dd6f688/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java
b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java
index d20b662..5d08d49 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java
@@ -1,3 +1,19 @@
+/**
+ * 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.internal;
 
 import org.apache.camel.component.salesforce.internal.dto.LoginToken;
@@ -5,41 +21,42 @@ import org.codehaus.jackson.map.ObjectMapper;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+
 import static org.junit.Assert.*;
 
 public class LoginTokenTest {
-	
-	private static final Logger LOG = LoggerFactory.getLogger(SessionIntegrationTest.class);
-	
-	@Test
-	public void testLoginTokenWithUnknownFields() throws Exception {
-		
-		String salesforceOAuthResponse = "{\n" + 
-				"    \"access_token\": \"00XXXXXXXXXXXX!ARMAQKg_lg_hGaRElvizVFBQHoCpvX8tzwGnROQ0_MDPXSceMeZHtm3JHkPmMhlgK0Km3rpJkwxwHInd_8o022KsDy.p4O.X\",\n"
+ 
-				"    \"is_readonly\": \"false\",\n" + 
-				"    \"signature\": \"XXXXXXXXXX+MYU+JrOXPSbpHa2ihMpSvUqow1iTPh7Q=\",\n" + 
-				"    \"instance_url\": \"https://xxxxxxxx--xxxxxxx.cs5.my.salesforce.com\",\n" + 
-				"    \"id\": \"https://test.salesforce.com/id/00DO00000054tO8MAI/005O0000001cmmdIAA\",\n"
+ 
-				"    \"token_type\": \"Bearer\",\n" + 
-				"    \"issued_at\": \"1442798068621\",\n" + 
-				"    \"an_unrecognised_field\": \"foo\"\n" + 
-				"}";
-		ObjectMapper mapper = new ObjectMapper();
-		Exception e = null;
-		LoginToken token = null;
-		try {
-			token = mapper.readValue(salesforceOAuthResponse, LoginToken.class);
-		} catch (Exception ex) {
-			e = ex;
-		}
-		
-		//assert ObjectMapper deserialized the SF OAuth response and returned a valid token back
-		assertNotNull("An invalid token was returned" , token);
-		//assert No exception was thrown during the JSON deserialization process
-		assertNull("Exception was thrown during JSON deserialisation" , e);
-		//assert one of the token fields
-		assertEquals("false", token.getIsReadOnly());
-		
-	}
+
+    private static final Logger LOG = LoggerFactory.getLogger(SessionIntegrationTest.class);
+
+    @Test
+    public void testLoginTokenWithUnknownFields() throws Exception {
+
+        String salesforceOAuthResponse = "{\n"
+            + "    \"access_token\": \"00XXXXXXXXXXXX!ARMAQKg_lg_hGaRElvizVFBQHoCpvX8tzwGnROQ0_MDPXSceMeZHtm3JHkPmMhlgK0Km3rpJkwxwHInd_8o022KsDy.p4O.X\",\n"
+            + "    \"is_readonly\": \"false\",\n"
+            + "    \"signature\": \"XXXXXXXXXX+MYU+JrOXPSbpHa2ihMpSvUqow1iTPh7Q=\",\n"
+            + "    \"instance_url\": \"https://xxxxxxxx--xxxxxxx.cs5.my.salesforce.com\",\n"
+            + "    \"id\": \"https://test.salesforce.com/id/00DO00000054tO8MAI/005O0000001cmmdIAA\",\n"
+            + "    \"token_type\": \"Bearer\",\n"
+            + "    \"issued_at\": \"1442798068621\",\n"
+            + "    \"an_unrecognised_field\": \"foo\"\n"
+            + "}";
+        ObjectMapper mapper = new ObjectMapper();
+        Exception e = null;
+        LoginToken token = null;
+        try {
+            token = mapper.readValue(salesforceOAuthResponse, LoginToken.class);
+        } catch (Exception ex) {
+            e = ex;
+        }
+
+        //assert ObjectMapper deserialized the SF OAuth response and returned a valid token
back
+        assertNotNull("An invalid token was returned", token);
+        //assert No exception was thrown during the JSON deserialization process
+        assertNull("Exception was thrown during JSON deserialisation", e);
+        //assert one of the token fields
+        assertEquals("false", token.getIsReadOnly());
+
+    }
 
 }


Mime
View raw message