You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/02/25 06:05:03 UTC

[camel] branch camel-3.14.x updated: CAMEL-17702: Compile wiht JDK8

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

davsclaus pushed a commit to branch camel-3.14.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.14.x by this push:
     new 9f29c33  CAMEL-17702: Compile wiht JDK8
9f29c33 is described below

commit 9f29c3378452c85f1e553fcd9770f786c72c2919
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Feb 24 20:30:40 2022 +0100

    CAMEL-17702: Compile wiht JDK8
---
 .../google/storage/unit/ProducerStoreFileTest.java | 48 ----------------------
 1 file changed, 48 deletions(-)

diff --git a/components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/unit/ProducerStoreFileTest.java b/components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/unit/ProducerStoreFileTest.java
index fdda3cf..12cfaf0 100644
--- a/components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/unit/ProducerStoreFileTest.java
+++ b/components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/unit/ProducerStoreFileTest.java
@@ -17,11 +17,6 @@
 package org.apache.camel.component.google.storage.unit;
 
 import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
 import java.util.Arrays;
 
 import com.google.cloud.storage.Blob;
@@ -29,8 +24,6 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.file.FileConsumer;
-import org.apache.camel.component.file.GenericFile;
 import org.apache.camel.component.google.storage.GoogleCloudStorageConstants;
 import org.junit.jupiter.api.Test;
 
@@ -57,47 +50,6 @@ public class ProducerStoreFileTest extends GoogleCloudStorageBaseTest {
     }
 
     @Test
-    public void testStoreFromFileWithContentLength() throws InterruptedException, IOException {
-        Path filePath = Path.of(FILE_ENDPOINT, FILE_NAME);
-        Exchange storeFileExchange = template.request("direct:fromFile", exchange -> {
-            exchange.getIn().setHeader(GoogleCloudStorageConstants.OBJECT_NAME, FILE_NAME);
-            exchange.getIn().setHeader(GoogleCloudStorageConstants.CONTENT_ENCODING, "text/plain");
-            exchange.getIn().setHeader(GoogleCloudStorageConstants.CONTENT_LENGTH, Files.size(filePath));
-            GenericFile<File> genericFile = FileConsumer.asGenericFile(FILE_ENDPOINT,
-                    filePath.toFile(), StandardCharsets.UTF_8.name(), false);
-            exchange.getIn().setBody(genericFile);
-        });
-        assertNotNull(storeFileExchange);
-        Blob fileBlob = storeFileExchange.getMessage().getBody(Blob.class);
-        assertNotNull(fileBlob);
-        assertEquals(FILE_NAME, fileBlob.getName());
-        assertEquals(Files.size(filePath), Long.valueOf(fileBlob.getMetadata().get("Content-Length")));
-        byte[] blobContents = fileBlob.getContent();
-        assertNotNull(blobContents);
-        assertEquals(Files.readString(filePath), new String(blobContents));
-    }
-
-    @Test
-    public void testStoreFromFileWithNoContentLength() throws InterruptedException, IOException {
-        Path filePath = Path.of(FILE_ENDPOINT, FILE_NAME);
-        Exchange storeFileExchange = template.request("direct:fromFile", exchange -> {
-            exchange.getIn().setHeader(GoogleCloudStorageConstants.OBJECT_NAME, FILE_NAME);
-            exchange.getIn().setHeader(GoogleCloudStorageConstants.CONTENT_ENCODING, "text/plain");
-            GenericFile<File> genericFile = FileConsumer.asGenericFile(FILE_ENDPOINT,
-                    filePath.toFile(), StandardCharsets.UTF_8.name(), false);
-            exchange.getIn().setBody(genericFile);
-        });
-        assertNotNull(storeFileExchange);
-        Blob fileBlob = storeFileExchange.getMessage().getBody(Blob.class);
-        assertNotNull(fileBlob);
-        assertEquals(FILE_NAME, fileBlob.getName());
-        assertEquals(Files.size(filePath), Long.valueOf(fileBlob.getMetadata().get("Content-Length")));
-        byte[] blobContents = fileBlob.getContent();
-        assertNotNull(blobContents);
-        assertEquals(Files.readString(filePath), new String(blobContents));
-    }
-
-    @Test
     public void testStoreFromstream() throws InterruptedException {
         final String fileName = "FromStream.txt";
         byte[] payload = "Hi, How are you ?".getBytes();