Search in sources :

Example 16 with UpdateCondition

use of com.amazonaws.services.simpledb.model.UpdateCondition in project camel by apache.

the class SdbComponentTest method putAttributesItemNameIsRequired.

@Test
public void putAttributesItemNameIsRequired() {
    final List<ReplaceableAttribute> replaceableAttributes = Arrays.asList(new ReplaceableAttribute[] { new ReplaceableAttribute("NAME1", "VALUE1", true) });
    final UpdateCondition updateCondition = new UpdateCondition("NAME1", "VALUE1", true);
    Exchange exchange = template.send("direct:start", new Processor() {

        public void process(Exchange exchange) throws Exception {
            exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.PutAttributes);
            exchange.getIn().setHeader(SdbConstants.UPDATE_CONDITION, updateCondition);
            exchange.getIn().setHeader(SdbConstants.REPLACEABLE_ATTRIBUTES, replaceableAttributes);
        }
    });
    Exception exception = exchange.getException();
    assertTrue(exception instanceof IllegalArgumentException);
}
Also used : Exchange(org.apache.camel.Exchange) Processor(org.apache.camel.Processor) UpdateCondition(com.amazonaws.services.simpledb.model.UpdateCondition) ReplaceableAttribute(com.amazonaws.services.simpledb.model.ReplaceableAttribute) Test(org.junit.Test)

Aggregations

UpdateCondition (com.amazonaws.services.simpledb.model.UpdateCondition)16 Test (org.junit.Test)15 ReplaceableAttribute (com.amazonaws.services.simpledb.model.ReplaceableAttribute)13 Exchange (org.apache.camel.Exchange)10 Processor (org.apache.camel.Processor)10 Attribute (com.amazonaws.services.simpledb.model.Attribute)8 ArrayList (java.util.ArrayList)5 AmazonS3 (com.amazonaws.services.s3.AmazonS3)1 DeleteAttributesRequest (com.amazonaws.services.simpledb.model.DeleteAttributesRequest)1 PutAttributesRequest (com.amazonaws.services.simpledb.model.PutAttributesRequest)1 AnnotationInfo (com.spaceprogram.simplejpa.AnnotationInfo)1 LazyInterceptor (com.spaceprogram.simplejpa.LazyInterceptor)1 PersistentProperty (com.spaceprogram.simplejpa.PersistentProperty)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 InputStream (java.io.InputStream)1 ObjectOutputStream (java.io.ObjectOutputStream)1 Collection (java.util.Collection)1 CascadeType (javax.persistence.CascadeType)1 ManyToOne (javax.persistence.ManyToOne)1