This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 05ad9fbcfec439f1bf6bd3fd6dbcbdcca7df30c9
Author: Guillaume Nodet <gno...@gmail.com>
AuthorDate: Thu Jun 25 11:34:30 2020 +0200

    [CAMEL-11807] Upgrade camel-google-sheets to junit5
---
 components/camel-google-sheets/pom.xml             |  2 +-
 .../sheets/AbstractGoogleSheetsTestSupport.java    | 16 ++---
 .../sheets/GoogleSheetsVerifierExtensionTest.java  | 11 +--
 .../google/sheets/SheetsConfigurationTest.java     |  7 +-
 .../sheets/SheetsSpreadsheetsIntegrationTest.java  | 10 +--
 .../SheetsSpreadsheetsValuesIntegrationTest.java   | 15 ++--
 .../server/GoogleSheetsApiTestServerRule.java      | 42 ++++--------
 .../SheetsStreamConsumerIntegrationTest.java       | 79 +++++++++++-----------
 8 files changed, 87 insertions(+), 95 deletions(-)

diff --git a/components/camel-google-sheets/pom.xml 
b/components/camel-google-sheets/pom.xml
index 6d3a41a..669cdfe 100644
--- a/components/camel-google-sheets/pom.xml
+++ b/components/camel-google-sheets/pom.xml
@@ -129,7 +129,7 @@
         <!-- testing -->
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-test</artifactId>
+            <artifactId>camel-test-junit5</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
diff --git 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/AbstractGoogleSheetsTestSupport.java
 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/AbstractGoogleSheetsTestSupport.java
index 89fa4d1..eb10439 100644
--- 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/AbstractGoogleSheetsTestSupport.java
+++ 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/AbstractGoogleSheetsTestSupport.java
@@ -38,20 +38,22 @@ import 
org.apache.camel.component.google.sheets.internal.GoogleSheetsConstants;
 import 
org.apache.camel.component.google.sheets.server.GoogleSheetsApiTestServer;
 import 
org.apache.camel.component.google.sheets.server.GoogleSheetsApiTestServerRule;
 import org.apache.camel.support.PropertyBindingSupport;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.ClassRule;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.TestInstance;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 /**
  * Abstract base class for GoogleSheets Integration tests generated by Camel 
API
  * component maven plugin.
  */
+@TestInstance(TestInstance.Lifecycle.PER_METHOD)
 public class AbstractGoogleSheetsTestSupport extends CamelTestSupport {
 
     protected static final String TEST_SHEET = "TestData";
     private static final String TEST_OPTIONS_PROPERTIES = 
"/test-options.properties";
     
-    @ClassRule
-    public static GoogleSheetsApiTestServerRule googleSheetsApiTestServerRule 
= new GoogleSheetsApiTestServerRule(TEST_OPTIONS_PROPERTIES);
+    @RegisterExtension
+    protected GoogleSheetsApiTestServerRule googleSheetsApiTestServerRule = 
new GoogleSheetsApiTestServerRule(TEST_OPTIONS_PROPERTIES);
 
     private Spreadsheet spreadsheet;
 
@@ -145,12 +147,6 @@ public class AbstractGoogleSheetsTestSupport extends 
CamelTestSupport {
         return options;
     }
 
-    @Override
-    public boolean isCreateCamelContextPerClass() {
-        // only create the context once for this class
-        return true;
-    }
-
     @SuppressWarnings("unchecked")
     protected <T> T requestBodyAndHeaders(String endpointUri, Object body, 
Map<String, Object> headers) throws CamelExecutionException {
         return (T)template().requestBodyAndHeaders(endpointUri, body, headers);
diff --git 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/GoogleSheetsVerifierExtensionTest.java
 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/GoogleSheetsVerifierExtensionTest.java
index 8988c9d..850efc4 100644
--- 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/GoogleSheetsVerifierExtensionTest.java
+++ 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/GoogleSheetsVerifierExtensionTest.java
@@ -22,9 +22,10 @@ import java.util.UUID;
 
 import org.apache.camel.Component;
 import org.apache.camel.component.extension.ComponentVerifierExtension;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Assert;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class GoogleSheetsVerifierExtensionTest extends CamelTestSupport {
 
@@ -46,7 +47,7 @@ public class GoogleSheetsVerifierExtensionTest extends 
CamelTestSupport {
         parameters.put("applicationName", "test");
 
         ComponentVerifierExtension.Result result = 
verifier.verify(ComponentVerifierExtension.Scope.PARAMETERS, parameters);
-        Assert.assertEquals(ComponentVerifierExtension.Result.Status.OK, 
result.getStatus());
+        assertEquals(ComponentVerifierExtension.Result.Status.OK, 
result.getStatus());
     }
 
     @Test
@@ -62,7 +63,7 @@ public class GoogleSheetsVerifierExtensionTest extends 
CamelTestSupport {
         parameters.put("spreadsheetId", UUID.randomUUID().toString());
 
         ComponentVerifierExtension.Result result = 
verifier.verify(ComponentVerifierExtension.Scope.CONNECTIVITY, parameters);
-        Assert.assertEquals(ComponentVerifierExtension.Result.Status.ERROR, 
result.getStatus());
+        assertEquals(ComponentVerifierExtension.Result.Status.ERROR, 
result.getStatus());
     }
 
 }
diff --git 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsConfigurationTest.java
 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsConfigurationTest.java
index 2fd2c08..38395ae 100644
--- 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsConfigurationTest.java
+++ 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsConfigurationTest.java
@@ -21,8 +21,11 @@ import org.apache.camel.builder.RouteBuilder;
 import 
org.apache.camel.component.google.sheets.internal.GoogleSheetsApiCollection;
 import 
org.apache.camel.component.google.sheets.internal.SheetsSpreadsheetsApiMethod;
 import org.apache.camel.impl.DefaultCamelContext;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 public class SheetsConfigurationTest extends CamelTestSupport {
 
diff --git 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsIntegrationTest.java
 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsIntegrationTest.java
index 4be016b..271fa3a 100644
--- 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsIntegrationTest.java
+++ 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsIntegrationTest.java
@@ -31,11 +31,13 @@ import org.apache.camel.builder.RouteBuilder;
 import 
org.apache.camel.component.google.sheets.internal.GoogleSheetsApiCollection;
 import org.apache.camel.component.google.sheets.internal.GoogleSheetsConstants;
 import 
org.apache.camel.component.google.sheets.internal.SheetsSpreadsheetsApiMethod;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static 
org.apache.camel.component.google.sheets.server.GoogleSheetsApiTestServerAssert.assertThatGoogleApi;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 /**
  * Test class for {@link 
com.google.api.services.sheets.v4.Sheets.Spreadsheets} APIs.
@@ -61,7 +63,7 @@ public class SheetsSpreadsheetsIntegrationTest extends 
AbstractGoogleSheetsTestS
 
         final Spreadsheet result = requestBody("direct://CREATE", 
sheetToCreate);
 
-        assertNotNull("create result is null", result);
+        assertNotNull(result, "create result is null");
         assertEquals(title, result.getProperties().getTitle());
 
         LOG.debug("create: " + result);
@@ -83,7 +85,7 @@ public class SheetsSpreadsheetsIntegrationTest extends 
AbstractGoogleSheetsTestS
         // using String message body for single parameter "spreadsheetId"
         final Spreadsheet result = requestBody("direct://GET", 
testSheet.getSpreadsheetId());
 
-        assertNotNull("get result is null", result);
+        assertNotNull(result, "get result is null");
         assertEquals(testSheet.getSpreadsheetId(), result.getSpreadsheetId());
 
         LOG.debug("get: " + result);
@@ -116,7 +118,7 @@ public class SheetsSpreadsheetsIntegrationTest extends 
AbstractGoogleSheetsTestS
 
         final BatchUpdateSpreadsheetResponse result = 
requestBodyAndHeaders("direct://BATCHUPDATE", null, headers);
 
-        assertNotNull("batchUpdate result is null", result);
+        assertNotNull(result, "batchUpdate result is null");
         assertEquals(updateTitle, 
result.getUpdatedSpreadsheet().getProperties().getTitle());
 
         LOG.debug("batchUpdate: " + result);
diff --git 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsValuesIntegrationTest.java
 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsValuesIntegrationTest.java
index ceffd5b..d0dbf02 100644
--- 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsValuesIntegrationTest.java
+++ 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsValuesIntegrationTest.java
@@ -34,11 +34,14 @@ import 
org.apache.camel.component.google.sheets.internal.GoogleSheetsApiCollecti
 import org.apache.camel.component.google.sheets.internal.GoogleSheetsConstants;
 import 
org.apache.camel.component.google.sheets.internal.SheetsSpreadsheetsValuesApiMethod;
 import org.apache.camel.util.ObjectHelper;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static 
org.apache.camel.component.google.sheets.server.GoogleSheetsApiTestServerAssert.assertThatGoogleApi;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * Test class for {@link 
com.google.api.services.sheets.v4.Sheets.Spreadsheets.Values} APIs.
@@ -69,9 +72,9 @@ public class SheetsSpreadsheetsValuesIntegrationTest extends 
AbstractGoogleSheet
 
         final ValueRange result = requestBodyAndHeaders("direct://GET", null, 
headers);
 
-        assertNotNull("get result is null", result);
+        assertNotNull(result, "get result is null");
         assertEquals(TEST_SHEET + "!A1:B2", result.getRange());
-        assertTrue("expected empty value range but found entries", 
ObjectHelper.isEmpty(result.getValues()));
+        assertTrue(ObjectHelper.isEmpty(result.getValues()), "expected empty 
value range but found entries");
 
         LOG.debug("get: " + result);
     }
@@ -110,7 +113,7 @@ public class SheetsSpreadsheetsValuesIntegrationTest 
extends AbstractGoogleSheet
 
         final UpdateValuesResponse result = 
requestBodyAndHeaders("direct://UPDATE", null, headers);
 
-        assertNotNull("update result is null", result);
+        assertNotNull(result, "update result is null");
         assertEquals(testSheet.getSpreadsheetId(), result.getSpreadsheetId());
         assertEquals(TEST_SHEET + "!A1:B2", result.getUpdatedRange());
         assertEquals(Integer.valueOf(2), result.getUpdatedRows());
@@ -147,7 +150,7 @@ public class SheetsSpreadsheetsValuesIntegrationTest 
extends AbstractGoogleSheet
 
         final AppendValuesResponse result = 
requestBodyAndHeaders("direct://APPEND", null, headers);
 
-        assertNotNull("append result is null", result);
+        assertNotNull(result, "append result is null");
         assertEquals(testSheet.getSpreadsheetId(), result.getSpreadsheetId());
         assertEquals(TEST_SHEET + "!A10:C10", 
result.getUpdates().getUpdatedRange());
         assertEquals(Integer.valueOf(1), result.getUpdates().getUpdatedRows());
@@ -187,7 +190,7 @@ public class SheetsSpreadsheetsValuesIntegrationTest 
extends AbstractGoogleSheet
 
         final ClearValuesResponse result = 
requestBodyAndHeaders("direct://CLEAR", null, headers);
 
-        assertNotNull("clear result is null", result);
+        assertNotNull(result, "clear result is null");
         assertEquals(testSheet.getSpreadsheetId(), result.getSpreadsheetId());
         assertEquals(TEST_SHEET + "!A1:B2", result.getClearedRange());
 
diff --git 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/server/GoogleSheetsApiTestServerRule.java
 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/server/GoogleSheetsApiTestServerRule.java
index a6e7c8d..b4f0b3e 100644
--- 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/server/GoogleSheetsApiTestServerRule.java
+++ 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/server/GoogleSheetsApiTestServerRule.java
@@ -17,21 +17,22 @@
 package org.apache.camel.component.google.sheets.server;
 
 import java.io.IOException;
+import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
 import com.consol.citrus.dsl.endpoint.CitrusEndpoints;
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.InvocationInterceptor;
+import org.junit.jupiter.api.extension.ReflectiveInvocationContext;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.http.HttpStatus;
 import org.springframework.util.SocketUtils;
 
 import static 
org.apache.camel.component.google.sheets.server.GoogleSheetsApiTestServerAssert.assertThatGoogleApi;
 
-public class GoogleSheetsApiTestServerRule implements TestRule {
+public class GoogleSheetsApiTestServerRule implements InvocationInterceptor {
 
     public static final String SERVER_KEYSTORE = "googleapis.jks";
     public static final String SERVER_KEYSTORE_PASSWORD = "secret";
@@ -55,11 +56,17 @@ public class GoogleSheetsApiTestServerRule implements 
TestRule {
     }
 
     @Override
-    public Statement apply(Statement base, Description description) {
-        return new GoogleSheetsApiTestServerStatement(base);
+    public void interceptTestMethod(Invocation<Void> invocation, 
ReflectiveInvocationContext<Method> invocationContext,
+                                    ExtensionContext extensionContext) throws 
Throwable {
+        googleApiTestServer.init();
+        try {
+            invocation.proceed();
+        } finally {
+            googleApiTestServer.reset();
+        }
     }
 
-    /**
+   /**
      * Read component configuration from TEST_OPTIONS_PROPERTIES.
      * 
      * @return Map of component options.
@@ -76,27 +83,6 @@ public class GoogleSheetsApiTestServerRule implements 
TestRule {
         return options;
     }
 
-    /**
-     * Rule statement initializes and resets test server after each method.
-     */
-    private class GoogleSheetsApiTestServerStatement extends Statement {
-        private final Statement base;
-
-        GoogleSheetsApiTestServerStatement(Statement base) {
-            this.base = base;
-        }
-
-        @Override
-        public void evaluate() throws Throwable {
-            googleApiTestServer.init();
-            try {
-                base.evaluate();
-            } finally {
-                googleApiTestServer.reset();
-            }
-        }
-    }
-
     public GoogleSheetsApiTestServer getGoogleApiTestServer() {
         return googleApiTestServer;
     }
diff --git 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/stream/SheetsStreamConsumerIntegrationTest.java
 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/stream/SheetsStreamConsumerIntegrationTest.java
index 3e9c5a8..1c7cf6c 100644
--- 
a/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/stream/SheetsStreamConsumerIntegrationTest.java
+++ 
b/components/camel-google-sheets/src/test/java/org/apache/camel/component/google/sheets/stream/SheetsStreamConsumerIntegrationTest.java
@@ -25,8 +25,7 @@ import com.google.api.services.sheets.v4.model.ValueRange;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static 
org.apache.camel.component.google.sheets.server.GoogleSheetsApiTestServerAssert.assertThatGoogleApi;
 import static 
org.apache.camel.component.google.sheets.stream.GoogleSheetsStreamConstants.MAJOR_DIMENSION;
@@ -34,6 +33,8 @@ import static 
org.apache.camel.component.google.sheets.stream.GoogleSheetsStream
 import static 
org.apache.camel.component.google.sheets.stream.GoogleSheetsStreamConstants.RANGE_INDEX;
 import static 
org.apache.camel.component.google.sheets.stream.GoogleSheetsStreamConstants.SPREADSHEET_ID;
 import static 
org.apache.camel.component.google.sheets.stream.GoogleSheetsStreamConstants.VALUE_INDEX;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class SheetsStreamConsumerIntegrationTest extends 
AbstractGoogleSheetsStreamTestSupport {
 
@@ -72,21 +73,21 @@ public class SheetsStreamConsumerIntegrationTest extends 
AbstractGoogleSheetsStr
         assertMockEndpointsSatisfied();
 
         Exchange exchange = mock.getReceivedExchanges().get(0);
-        
Assert.assertTrue(exchange.getIn().getHeaders().containsKey(SPREADSHEET_ID));
-        Assert.assertTrue(exchange.getIn().getHeaders().containsKey(RANGE));
-        
Assert.assertTrue(exchange.getIn().getHeaders().containsKey(RANGE_INDEX));
-        
Assert.assertTrue(exchange.getIn().getHeaders().containsKey(MAJOR_DIMENSION));
-        Assert.assertEquals(testSheet.getSpreadsheetId(), 
exchange.getIn().getHeaders().get(SPREADSHEET_ID));
-        Assert.assertEquals(range, exchange.getIn().getHeaders().get(RANGE));
-        Assert.assertEquals(1, exchange.getIn().getHeaders().get(RANGE_INDEX));
-        Assert.assertEquals("ROWS", 
exchange.getIn().getHeaders().get(MAJOR_DIMENSION));
+        assertTrue(exchange.getIn().getHeaders().containsKey(SPREADSHEET_ID));
+        assertTrue(exchange.getIn().getHeaders().containsKey(RANGE));
+        assertTrue(exchange.getIn().getHeaders().containsKey(RANGE_INDEX));
+        assertTrue(exchange.getIn().getHeaders().containsKey(MAJOR_DIMENSION));
+        assertEquals(testSheet.getSpreadsheetId(), 
exchange.getIn().getHeaders().get(SPREADSHEET_ID));
+        assertEquals(range, exchange.getIn().getHeaders().get(RANGE));
+        assertEquals(1, exchange.getIn().getHeaders().get(RANGE_INDEX));
+        assertEquals("ROWS", 
exchange.getIn().getHeaders().get(MAJOR_DIMENSION));
 
         ValueRange values = (ValueRange) exchange.getIn().getBody();
-        Assert.assertEquals(2L, values.getValues().size());
-        Assert.assertEquals("a1", values.getValues().get(0).get(0));
-        Assert.assertEquals("b1", values.getValues().get(0).get(1));
-        Assert.assertEquals("a2", values.getValues().get(1).get(0));
-        Assert.assertEquals("b2", values.getValues().get(1).get(1));
+        assertEquals(2L, values.getValues().size());
+        assertEquals("a1", values.getValues().get(0).get(0));
+        assertEquals("b1", values.getValues().get(0).get(1));
+        assertEquals("a2", values.getValues().get(1).get(0));
+        assertEquals("b2", values.getValues().get(1).get(1));
     }
 
     @Test
@@ -123,36 +124,36 @@ public class SheetsStreamConsumerIntegrationTest extends 
AbstractGoogleSheetsStr
         assertMockEndpointsSatisfied();
 
         Exchange exchange = mock.getReceivedExchanges().get(0);
-        
Assert.assertTrue(exchange.getIn().getHeaders().containsKey(SPREADSHEET_ID));
-        Assert.assertTrue(exchange.getIn().getHeaders().containsKey(RANGE));
-        
Assert.assertTrue(exchange.getIn().getHeaders().containsKey(RANGE_INDEX));
-        
Assert.assertTrue(exchange.getIn().getHeaders().containsKey(VALUE_INDEX));
-        
Assert.assertTrue(exchange.getIn().getHeaders().containsKey(MAJOR_DIMENSION));
-        Assert.assertEquals(testSheet.getSpreadsheetId(), 
exchange.getIn().getHeaders().get(SPREADSHEET_ID));
-        Assert.assertEquals(range, exchange.getIn().getHeaders().get(RANGE));
-        Assert.assertEquals(1, exchange.getIn().getHeaders().get(RANGE_INDEX));
-        Assert.assertEquals(1, exchange.getIn().getHeaders().get(VALUE_INDEX));
-        Assert.assertEquals("ROWS", 
exchange.getIn().getHeaders().get(MAJOR_DIMENSION));
+        assertTrue(exchange.getIn().getHeaders().containsKey(SPREADSHEET_ID));
+        assertTrue(exchange.getIn().getHeaders().containsKey(RANGE));
+        assertTrue(exchange.getIn().getHeaders().containsKey(RANGE_INDEX));
+        assertTrue(exchange.getIn().getHeaders().containsKey(VALUE_INDEX));
+        assertTrue(exchange.getIn().getHeaders().containsKey(MAJOR_DIMENSION));
+        assertEquals(testSheet.getSpreadsheetId(), 
exchange.getIn().getHeaders().get(SPREADSHEET_ID));
+        assertEquals(range, exchange.getIn().getHeaders().get(RANGE));
+        assertEquals(1, exchange.getIn().getHeaders().get(RANGE_INDEX));
+        assertEquals(1, exchange.getIn().getHeaders().get(VALUE_INDEX));
+        assertEquals("ROWS", 
exchange.getIn().getHeaders().get(MAJOR_DIMENSION));
 
         List<?> values = (List) exchange.getIn().getBody();
-        Assert.assertEquals(2L, values.size());
-        Assert.assertEquals("a1", values.get(0));
-        Assert.assertEquals("b1", values.get(1));
+        assertEquals(2L, values.size());
+        assertEquals("a1", values.get(0));
+        assertEquals("b1", values.get(1));
 
         exchange = mock.getReceivedExchanges().get(1);
-        
Assert.assertTrue(exchange.getIn().getHeaders().containsKey(SPREADSHEET_ID));
-        Assert.assertTrue(exchange.getIn().getHeaders().containsKey(RANGE));
-        
Assert.assertTrue(exchange.getIn().getHeaders().containsKey(RANGE_INDEX));
-        
Assert.assertTrue(exchange.getIn().getHeaders().containsKey(VALUE_INDEX));
-        
Assert.assertTrue(exchange.getIn().getHeaders().containsKey(MAJOR_DIMENSION));
-        Assert.assertEquals(testSheet.getSpreadsheetId(), 
exchange.getIn().getHeaders().get(SPREADSHEET_ID));
-        Assert.assertEquals(1, exchange.getIn().getHeaders().get(RANGE_INDEX));
-        Assert.assertEquals(2, exchange.getIn().getHeaders().get(VALUE_INDEX));
+        assertTrue(exchange.getIn().getHeaders().containsKey(SPREADSHEET_ID));
+        assertTrue(exchange.getIn().getHeaders().containsKey(RANGE));
+        assertTrue(exchange.getIn().getHeaders().containsKey(RANGE_INDEX));
+        assertTrue(exchange.getIn().getHeaders().containsKey(VALUE_INDEX));
+        assertTrue(exchange.getIn().getHeaders().containsKey(MAJOR_DIMENSION));
+        assertEquals(testSheet.getSpreadsheetId(), 
exchange.getIn().getHeaders().get(SPREADSHEET_ID));
+        assertEquals(1, exchange.getIn().getHeaders().get(RANGE_INDEX));
+        assertEquals(2, exchange.getIn().getHeaders().get(VALUE_INDEX));
 
         values = (List) exchange.getIn().getBody();
-        Assert.assertEquals(2L, values.size());
-        Assert.assertEquals("a2", values.get(0));
-        Assert.assertEquals("b2", values.get(1));
+        assertEquals(2L, values.size());
+        assertEquals("a2", values.get(0));
+        assertEquals("b2", values.get(1));
     }
 
     private RouteBuilder createGoogleStreamRouteBuilder(String spreadsheetId, 
boolean splitResults) throws Exception {

Reply via email to