use of java.util.ArrayList in project camel by apache.
the class AmazonS3ClientMock method listBuckets.
@Override
public List<Bucket> listBuckets() throws AmazonClientException, AmazonServiceException {
ArrayList<Bucket> list = new ArrayList<Bucket>();
Bucket bucket = new Bucket("camel-bucket");
bucket.setOwner(new Owner("Camel", "camel"));
bucket.setCreationDate(new Date());
list.add(bucket);
return list;
}
use of java.util.ArrayList in project camel by apache.
the class BatchDeleteAttributesCommandTest method determineDeletableItems.
@Test
public void determineDeletableItems() {
assertNull(this.command.determineDeletableItems());
List<Item> deletableItems = new ArrayList<Item>();
deletableItems.add(new Item());
exchange.getIn().setHeader(SdbConstants.DELETABLE_ITEMS, deletableItems);
assertEquals(deletableItems, this.command.determineDeletableItems());
}
use of java.util.ArrayList in project camel by apache.
the class BatchPutAttributesCommandTest method determineReplaceableItems.
@Test
public void determineReplaceableItems() {
assertNull(this.command.determineReplaceableItems());
List<ReplaceableItem> replaceableItems = new ArrayList<ReplaceableItem>();
replaceableItems.add(new ReplaceableItem("ITEM1"));
exchange.getIn().setHeader(SdbConstants.REPLACEABLE_ITEMS, replaceableItems);
assertEquals(replaceableItems, this.command.determineReplaceableItems());
}
use of java.util.ArrayList in project camel by apache.
the class EC2ComponentSpringTest method ec2DescribeStatusSpecificInstancesTest.
@Test
public void ec2DescribeStatusSpecificInstancesTest() throws Exception {
Exchange exchange = template.request("direct:describeStatus", new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
Collection l = new ArrayList();
l.add("test-1");
exchange.getIn().setHeader(EC2Constants.INSTANCES_IDS, l);
}
});
assertMockEndpointsSatisfied();
DescribeInstanceStatusResult resultGet = (DescribeInstanceStatusResult) exchange.getOut().getBody();
assertEquals(resultGet.getInstanceStatuses().size(), 1);
assertEquals(resultGet.getInstanceStatuses().get(0).getInstanceState().getName(), InstanceStateName.Running.toString());
}
use of java.util.ArrayList in project camel by apache.
the class EC2ComponentSpringTest method stopInstances.
@Test
public void stopInstances() {
Exchange exchange = template.request("direct:stop", new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
Collection l = new ArrayList();
l.add("test-1");
exchange.getIn().setHeader(EC2Constants.INSTANCES_IDS, l);
}
});
StopInstancesResult resultGet = (StopInstancesResult) exchange.getOut().getBody();
assertEquals(resultGet.getStoppingInstances().get(0).getInstanceId(), "test-1");
assertEquals(resultGet.getStoppingInstances().get(0).getPreviousState().getName(), InstanceStateName.Running.toString());
assertEquals(resultGet.getStoppingInstances().get(0).getCurrentState().getName(), InstanceStateName.Stopped.toString());
}
Aggregations