Search in sources :

Example 1 with StringPayload

use of org.jclouds.io.payloads.StringPayload in project camel by apache.

the class JcloudsBlobStoreConsumerTest method testBlobStoreGetTwoBlobs.

@Test
public void testBlobStoreGetTwoBlobs() throws InterruptedException {
    String message1 = "Blob 1";
    String message2 = "Blob 2";
    MockEndpoint mockEndpoint = resolveMandatoryEndpoint("mock:results", MockEndpoint.class);
    mockEndpoint.expectedBodiesReceived(message1, message2);
    JcloudsBlobStoreHelper.writeBlob(blobStore, TEST_CONTAINER, TEST_BLOB1, new StringPayload(message1));
    JcloudsBlobStoreHelper.writeBlob(blobStore, TEST_CONTAINER, TEST_BLOB2, new StringPayload(message2));
    mockEndpoint.assertIsSatisfied();
}
Also used : MockEndpoint(org.apache.camel.component.mock.MockEndpoint) StringPayload(org.jclouds.io.payloads.StringPayload) Test(org.junit.Test)

Example 2 with StringPayload

use of org.jclouds.io.payloads.StringPayload in project camel by apache.

the class JcloudsBlobStoreConsumerTest method testBlobStoreWithDirectory.

@Test
public void testBlobStoreWithDirectory() throws InterruptedException {
    String message1 = "Blob in directory";
    MockEndpoint mockEndpoint = resolveMandatoryEndpoint("mock:results-in-dir", MockEndpoint.class);
    mockEndpoint.expectedBodiesReceived(message1);
    JcloudsBlobStoreHelper.writeBlob(blobStore, TEST_CONTAINER_WITH_DIR, TEST_BLOB_IN_DIR, new StringPayload(message1));
    mockEndpoint.assertIsSatisfied();
}
Also used : MockEndpoint(org.apache.camel.component.mock.MockEndpoint) StringPayload(org.jclouds.io.payloads.StringPayload) Test(org.junit.Test)

Example 3 with StringPayload

use of org.jclouds.io.payloads.StringPayload in project camel by apache.

the class JcloudsBlobStoreConsumerTest method testBlobStoreGetOneBlob.

@Test
public void testBlobStoreGetOneBlob() throws InterruptedException {
    String message = "Some message";
    MockEndpoint mockEndpoint = resolveMandatoryEndpoint("mock:results", MockEndpoint.class);
    mockEndpoint.expectedBodiesReceived(message);
    JcloudsBlobStoreHelper.writeBlob(blobStore, TEST_CONTAINER, TEST_BLOB1, new StringPayload(message));
    mockEndpoint.assertIsSatisfied();
}
Also used : MockEndpoint(org.apache.camel.component.mock.MockEndpoint) StringPayload(org.jclouds.io.payloads.StringPayload) Test(org.junit.Test)

Example 4 with StringPayload

use of org.jclouds.io.payloads.StringPayload in project camel by apache.

the class JcloudsBlobStoreConsumerTest method testBlobStoreWithMultipleDirectories.

@Test
public void testBlobStoreWithMultipleDirectories() throws InterruptedException {
    String message1 = "Blob in directory";
    String message2 = "Blob in other directory";
    MockEndpoint mockEndpoint = resolveMandatoryEndpoint("mock:results-in-dir", MockEndpoint.class);
    mockEndpoint.expectedBodiesReceived(message1);
    JcloudsBlobStoreHelper.writeBlob(blobStore, TEST_CONTAINER_WITH_DIR, TEST_BLOB_IN_DIR, new StringPayload(message1));
    JcloudsBlobStoreHelper.writeBlob(blobStore, TEST_CONTAINER_WITH_DIR, TEST_BLOB_IN_OTHER, new StringPayload(message2));
    mockEndpoint.assertIsSatisfied();
}
Also used : MockEndpoint(org.apache.camel.component.mock.MockEndpoint) StringPayload(org.jclouds.io.payloads.StringPayload) Test(org.junit.Test)

Example 5 with StringPayload

use of org.jclouds.io.payloads.StringPayload in project camel by apache.

the class JcloudsMultipleBlobStoreTest method testWithMultipleServices.

@Test
public void testWithMultipleServices() throws InterruptedException {
    String message1 = "Blob 1";
    String message2 = "Blob 2";
    MockEndpoint mockEndpoint1 = resolveMandatoryEndpoint("mock:results1", MockEndpoint.class);
    mockEndpoint1.expectedBodiesReceived(message1);
    MockEndpoint mockEndpoint2 = resolveMandatoryEndpoint("mock:results2", MockEndpoint.class);
    mockEndpoint2.expectedBodiesReceived(message2);
    JcloudsBlobStoreHelper.writeBlob(blobStore1, TEST_CONTAINER, TEST_BLOB1, new StringPayload(message1));
    JcloudsBlobStoreHelper.writeBlob(blobStore2, TEST_CONTAINER, TEST_BLOB2, new StringPayload(message2));
    mockEndpoint1.assertIsSatisfied();
    mockEndpoint2.assertIsSatisfied();
}
Also used : MockEndpoint(org.apache.camel.component.mock.MockEndpoint) StringPayload(org.jclouds.io.payloads.StringPayload) Test(org.junit.Test)

Aggregations

MockEndpoint (org.apache.camel.component.mock.MockEndpoint)5 StringPayload (org.jclouds.io.payloads.StringPayload)5 Test (org.junit.Test)5