diff --git a/src/main/java/com/bizo/awsstubs/services/dynamodb2/AmazonDynamoDBStub.java b/src/main/java/com/bizo/awsstubs/services/dynamodb2/AmazonDynamoDBStub.java index 140babf..a0bc513 100644 --- a/src/main/java/com/bizo/awsstubs/services/dynamodb2/AmazonDynamoDBStub.java +++ b/src/main/java/com/bizo/awsstubs/services/dynamodb2/AmazonDynamoDBStub.java @@ -23,6 +23,7 @@ import com.amazonaws.services.dynamodbv2.model.BatchWriteItemRequest; import com.amazonaws.services.dynamodbv2.model.BatchWriteItemResult; import com.amazonaws.services.dynamodbv2.model.Capacity; +import com.amazonaws.services.dynamodbv2.model.ComparisonOperator; import com.amazonaws.services.dynamodbv2.model.Condition; import com.amazonaws.services.dynamodbv2.model.ConsumedCapacity; import com.amazonaws.services.dynamodbv2.model.CreateTableRequest; @@ -360,8 +361,6 @@ public GetItemResult getItem(GetItemRequest getItemRequest) { throw new ResourceNotFoundException("Resource " + tableName + " not found."); } - List> rows = table.getRows(); - Map match = table.find(key, attributesToGet); GetItemResult getItemResult = null; @@ -481,11 +480,25 @@ public PutItemResult putItem(String tableName, public QueryResult query(QueryRequest queryRequest) { shutdownThrowsException(); - QueryResult queryResult = new QueryResult() - .withCount(new Integer(0)); + String tableName = queryRequest.getTableName(); + Map keyConditions = queryRequest.getKeyConditions(); + List attributesToGet = queryRequest.getAttributesToGet(); - if (true) { - throw new InternalServerErrorException("Operation not supported."); + Table table = dynamoDB.get(tableName); + + List> match = table.query(keyConditions, attributesToGet); + + QueryResult queryResult = null; + + if (match != null) { + queryResult = new QueryResult() + .withItems(match) + .withCount(match.size()) + .withConsumedCapacity(new ConsumedCapacity() + .withTableName(tableName) + .withCapacityUnits(CAPACITY_UNITS) + .withTable(new Capacity() + .withCapacityUnits(CAPACITY_UNITS))); } return queryResult; @@ -728,6 +741,62 @@ public List> find(List> return matches; } + public List> query(Map keyConditions, + List attributesToGet) { + List> matches = new ArrayList>(); + + List> rows = this.getRows(); + + for (Map row : rows) { + boolean match = true; + + for (Entry keyCondition : keyConditions.entrySet()) { + String columnName = keyCondition.getKey(); + Condition condition = keyCondition.getValue(); + + AttributeValue columnValue = row.get(columnName); + + boolean comparisonMatch = comparisonMatch(columnValue, condition); + match &= comparisonMatch; + } + + if (match) { + matches.add(row); + } + } + + return matches; + } + + private boolean comparisonMatch(AttributeValue columnValue, Condition condition) { + boolean comparisonMatch = false; + + ComparisonOperator comparisonOperator = ComparisonOperator.fromValue(condition.getComparisonOperator()); + AttributeValue comparisonAttributeValue = condition.getAttributeValueList().get(0); + + switch (comparisonOperator) { + case EQ: + comparisonMatch = AttributeValueComparator.equal(columnValue, comparisonAttributeValue); + break; + case LT: + comparisonMatch = AttributeValueComparator.lessThan(columnValue, comparisonAttributeValue); + break; + case GT: + comparisonMatch = AttributeValueComparator.greaterThan(columnValue, comparisonAttributeValue); + break; + case LE: + comparisonMatch = AttributeValueComparator.lessThanEqual(columnValue, comparisonAttributeValue); + break; + case GE: + comparisonMatch = AttributeValueComparator.greaterThanEqual(columnValue, comparisonAttributeValue); + break; + default: + throw new InternalServerErrorException("Operation not supported."); + } + + return comparisonMatch; + } + public Map delete(Map key) { Map match = null; diff --git a/src/main/java/com/bizo/awsstubs/services/dynamodb2/AttributeValueComparator.java b/src/main/java/com/bizo/awsstubs/services/dynamodb2/AttributeValueComparator.java new file mode 100644 index 0000000..f3ac06f --- /dev/null +++ b/src/main/java/com/bizo/awsstubs/services/dynamodb2/AttributeValueComparator.java @@ -0,0 +1,314 @@ +package com.bizo.awsstubs.services.dynamodb2; + +import com.amazonaws.services.dynamodbv2.model.AttributeValue; + +public class AttributeValueComparator { + + private AttributeValueComparator() { + } + + // value == comparisonValue + // true: 0 + public static boolean equal(AttributeValue value, AttributeValue comparisonValue) { + if (value == comparisonValue) + return true; + if ((value == null) || (comparisonValue == null)) + return false; + + if (value.getS() == null ^ comparisonValue.getS() == null) + return false; + if (value.getS() != null && value.getS().equals(comparisonValue.getS()) == false) + return false; + + if (value.getN() == null ^ value.getN() == null) + return false; + if (value.getN() != null && value.getN().equals(comparisonValue.getN()) == false) + return false; + + if (value.getB() == null ^ value.getB() == null) + return false; + if (value.getB() != null && value.getB().equals(comparisonValue.getB()) == false) + return false; + + if (value.getSS() == null ^ value.getSS() == null) + return false; + if (value.getSS() != null && value.getSS().equals(comparisonValue.getSS()) == false) + return false; + + if (value.getNS() == null ^ value.getNS() == null) + return false; + if (value.getNS() != null && value.getNS().equals(comparisonValue.getNS()) == false) + return false; + + if (value.getBS() == null ^ value.getBS() == null) + return false; + if (value.getBS() != null && value.getBS().equals(comparisonValue.getBS()) == false) + return false; + + if (value.getM() == null ^ value.getM() == null) + return false; + if (value.getM() != null && value.getM().equals(comparisonValue.getM()) == false) + return false; + + if (value.getL() == null ^ value.getL() == null) + return false; + if (value.getL() != null && value.getL().equals(comparisonValue.getL()) == false) + return false; + + if (value.getNULL() == null ^ value.getNULL() == null) + return false; + if (value.getNULL() != null && value.getNULL().equals(comparisonValue.getNULL()) == false) + return false; + + if (value.getBOOL() == null ^ value.getBOOL() == null) + return false; + if (value.getBOOL() != null && value.getBOOL().equals(comparisonValue.getBOOL()) == false) + return false; + + return true; + } + + // value < comparisonValue + // true: -1 + public static boolean lessThan(AttributeValue value, AttributeValue comparisonValue) { + if ((value == null) || (comparisonValue == null)) + throw new NullAttributeValueException("Both AttributeValue instances must be non-null."); + if (value == comparisonValue) + return false; + + if (value.getS() == null ^ value.getS() == null) + return false; + if (value.getS() != null && value.getS().compareTo(comparisonValue.getS()) < 0) + return true; + + if (value.getN() == null ^ value.getN() == null) + return false; + if (value.getN() != null && value.getN().compareTo(comparisonValue.getN()) < 0) + return true; + + if (value.getB() == null ^ value.getB() == null) + return false; + if (value.getB() != null && value.getB().compareTo(comparisonValue.getB()) < 0) + return true; + +// if (value.getSS() == null ^ comparisonValue.getSS() == null) +// return false; +// if (value.getSS() != null && value.getSS().compareTo(comparisonValue.getSS()) < 0) +// return true; + +// if (value.getNS() == null ^ comparisonValue.getNS() == null) +// return false; +// if (value.getNS() != null && value.getNS().compareTo(comparisonValue.getNS()) < 0) +// return true; + +// if (value.getBS() == null ^ comparisonValue.getBS() == null) +// return false; +// if (value.getBS() != null && value.getBS().compareTo(comparisonValue.getBS()) < 0) +// return true; + +// if (value.getM() == null ^ comparisonValue.getM() == null) +// return false; +// if (value.getM() != null && value.getM().compareTo(comparisonValue.getM()) < 0) +// return true; + +// if (value.getL() == null ^ comparisonValue.getL() == null) +// return false; +// if (value.getL() != null && value.getL().compareTo(comparisonValue.getL()) < 0) +// return true; + + if (value.getNULL() == null ^ value.getNULL() == null) + return false; + if (value.getNULL() != null && value.getNULL().compareTo(comparisonValue.getNULL()) < 0) + return true; + + if (value.getBOOL() == null ^ value.getBOOL() == null) + return false; + if (value.getBOOL() != null && value.getBOOL().compareTo(comparisonValue.getBOOL()) < 0) + return true; + + return false; + } + + // value > comparisonValue + // true: + 1 + public static boolean greaterThan(AttributeValue value, AttributeValue comparisonValue) { + if ((value == null) || (comparisonValue == null)) + throw new NullAttributeValueException("Both AttributeValue instances must be non-null."); + if (value == comparisonValue) + return false; + + if (value.getS() == null ^ value.getS() == null) + return false; + if (value.getS() != null && value.getS().compareTo(comparisonValue.getS()) > 0) + return true; + + if (value.getN() == null ^ value.getN() == null) + return false; + if (value.getN() != null && value.getN().compareTo(comparisonValue.getN()) > 0) + return true; + + if (value.getB() == null ^ value.getB() == null) + return false; + if (value.getB() != null && value.getB().compareTo(comparisonValue.getB()) > 0) + return true; + +// if (value.getSS() == null ^ comparisonValue.getSS() == null) +// return false; +// if (value.getSS() != null && value.getSS().compareTo(comparisonValue.getSS()) > 0) +// return true; + +// if (value.getNS() == null ^ comparisonValue.getNS() == null) +// return false; +// if (value.getNS() != null && value.getNS().compareTo(comparisonValue.getNS()) > 0) +// return true; + +// if (value.getBS() == null ^ comparisonValue.getBS() == null) +// return false; +// if (value.getBS() != null && value.getBS().compareTo(comparisonValue.getBS()) > 0) +// return true; + +// if (value.getM() == null ^ comparisonValue.getM() == null) +// return false; +// if (value.getM() != null && value.getM().compareTo(comparisonValue.getM()) > 0) +// return true; + +// if (value.getL() == null ^ comparisonValue.getL() == null) +// return false; +// if (value.getL() != null && value.getL().compareTo(comparisonValue.getL()) > 0) +// return true; + + if (value.getNULL() == null ^ value.getNULL() == null) + return false; + if (value.getNULL() != null && value.getNULL().compareTo(comparisonValue.getNULL()) > 0) + return true; + + if (value.getBOOL() == null ^ value.getBOOL() == null) + return false; + if (value.getBOOL() != null && value.getBOOL().compareTo(comparisonValue.getBOOL()) > 0) + return true; + + return false; + } + + // value <= comparisonValue + // true: -1, 0 + public static boolean lessThanEqual(AttributeValue value, AttributeValue comparisonValue) { + if (value == comparisonValue) + return true; + if ((value == null) || (comparisonValue == null)) + throw new NullAttributeValueException("Both AttributeValue instances must be non-null."); + + if (value.getS() == null ^ value.getS() == null) + return false; + if (value.getS() != null && value.getS().compareTo(comparisonValue.getS()) <= 0) + return true; + + if (value.getN() == null ^ value.getN() == null) + return false; + if (value.getN() != null && value.getN().compareTo(comparisonValue.getN()) <= 0) + return true; + + if (value.getB() == null ^ value.getB() == null) + return false; + if (value.getB() != null && value.getB().compareTo(comparisonValue.getB()) <= 0) + return true; + +// if (value.getSS() == null ^ comparisonValue.getSS() == null) +// return false; +// if (value.getSS() != null && value.getSS().compareTo(comparisonValue.getSS()) <= 0) +// return true; + +// if (value.getNS() == null ^ comparisonValue.getNS() == null) +// return false; +// if (value.getNS() != null && value.getNS().compareTo(comparisonValue.getNS()) <= 0) +// return true; + +// if (value.getBS() == null ^ comparisonValue.getBS() == null) +// return false; +// if (value.getBS() != null && value.getBS().compareTo(comparisonValue.getBS()) <= 0) +// return true; + +// if (value.getM() == null ^ comparisonValue.getM() == null) +// return false; +// if (value.getM() != null && value.getM().compareTo(comparisonValue.getM()) <= 0) +// return true; + +// if (value.getL() == null ^ comparisonValue.getL() == null) +// return false; +// if (value.getL() != null && value.getL().compareTo(comparisonValue.getL()) <= 0) +// return true; + + if (value.getNULL() == null ^ value.getNULL() == null) + return false; + if (value.getNULL() != null && value.getNULL().compareTo(comparisonValue.getNULL()) <= 0) + return true; + + if (value.getBOOL() == null ^ value.getBOOL() == null) + return false; + if (value.getBOOL() != null && value.getBOOL().compareTo(comparisonValue.getBOOL()) <= 0) + return true; + + return false; + } + + // value >= comparisonValue + // true: + 1, 0 + public static boolean greaterThanEqual(AttributeValue value, AttributeValue comparisonValue) { + if (value == comparisonValue) + return true; + if ((value == null) || (comparisonValue == null)) + throw new NullAttributeValueException("Both AttributeValue instances must be non-null."); + + if (value.getS() == null ^ value.getS() == null) + return false; + if (value.getS() != null && value.getS().compareTo(comparisonValue.getS()) >= 0) + return true; + + if (value.getN() == null ^ value.getN() == null) + return false; + if (value.getN() != null && value.getN().compareTo(comparisonValue.getN()) >= 0) + return true; + + if (value.getB() == null ^ value.getB() == null) + return false; + if (value.getB() != null && value.getB().compareTo(comparisonValue.getB()) >= 0) + return true; + +// if (value.getSS() == null ^ comparisonValue.getSS() == null) +// return false; +// if (value.getSS() != null && value.getSS().compareTo(comparisonValue.getSS()) >= 0) +// return true; + +// if (value.getNS() == null ^ comparisonValue.getNS() == null) +// return false; +// if (value.getNS() != null && value.getNS().compareTo(comparisonValue.getNS()) >= 0) +// return true; + +// if (value.getBS() == null ^ comparisonValue.getBS() == null) +// return false; +// if (value.getBS() != null && value.getBS().compareTo(comparisonValue.getBS()) >= 0) +// return true; + +// if (value.getM() == null ^ comparisonValue.getM() == null) +// return false; +// if (value.getM() != null && value.getM().compareTo(comparisonValue.getM()) >= 0) +// return true; + +// if (value.getL() == null ^ comparisonValue.getL() == null) +// return false; +// if (value.getL() != null && value.getL().compareTo(comparisonValue.getL()) >= 0) +// return true; + + if (value.getNULL() == null ^ value.getNULL() == null) + return false; + if (value.getNULL() != null && value.getNULL().compareTo(comparisonValue.getNULL()) >= 0) + return true; + + if (value.getBOOL() == null ^ value.getBOOL() == null) + return false; + if (value.getBOOL() != null && value.getBOOL().compareTo(comparisonValue.getBOOL()) >= 0) + return true; + + return false; + } +} diff --git a/src/main/java/com/bizo/awsstubs/services/dynamodb2/NullAttributeValueException.java b/src/main/java/com/bizo/awsstubs/services/dynamodb2/NullAttributeValueException.java new file mode 100644 index 0000000..ecab11e --- /dev/null +++ b/src/main/java/com/bizo/awsstubs/services/dynamodb2/NullAttributeValueException.java @@ -0,0 +1,12 @@ +package com.bizo.awsstubs.services.dynamodb2; + +public class NullAttributeValueException extends NullPointerException { + + public NullAttributeValueException() { + super(); + } + + public NullAttributeValueException(String message) { + super(message); + } +} diff --git a/src/test/java/com/bizo/awsstubs/services/dynamodb2/AmazonDynamoDBStubTest.java b/src/test/java/com/bizo/awsstubs/services/dynamodb2/AmazonDynamoDBStubTest.java index 1ec4b0f..4e1be57 100644 --- a/src/test/java/com/bizo/awsstubs/services/dynamodb2/AmazonDynamoDBStubTest.java +++ b/src/test/java/com/bizo/awsstubs/services/dynamodb2/AmazonDynamoDBStubTest.java @@ -3,6 +3,8 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.nullValue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; import java.util.ArrayList; @@ -22,6 +24,7 @@ import com.amazonaws.services.dynamodbv2.model.AttributeValueUpdate; import com.amazonaws.services.dynamodbv2.model.BatchGetItemResult; import com.amazonaws.services.dynamodbv2.model.BatchWriteItemResult; +import com.amazonaws.services.dynamodbv2.model.ComparisonOperator; import com.amazonaws.services.dynamodbv2.model.Condition; import com.amazonaws.services.dynamodbv2.model.ConsumedCapacity; import com.amazonaws.services.dynamodbv2.model.CreateTableResult; @@ -55,6 +58,8 @@ public class AmazonDynamoDBStubTest { private static final String TEST_ATTRIBUTE = "Attribute1"; private static final String TEST_ATTRIBUTE_VALUE = "AttributeValue1"; + private static final String TEST_ATTRIBUTE_2 = "Attribute2"; + private static final String TEST_ATTRIBUTE_VALUE_2 = "AttributeValue2"; private AmazonDynamoDBStub dynamoDb = null; @@ -75,9 +80,6 @@ public void setUp() { @Test public void test_batchGetItem_WithAllParameters() throws Exception { - String TEST_ATTRIBUTE_2 = "Attribute2"; - String TEST_ATTRIBUTE_VALUE_2 = "AttributeValue2"; - createTable(); putItem(TEST_ATTRIBUTE, TEST_ATTRIBUTE_VALUE); putItem(TEST_ATTRIBUTE_2, TEST_ATTRIBUTE_VALUE_2); @@ -169,8 +171,6 @@ private CreateTableResult createTable() throws Exception { .withAttributeType(ScalarAttributeType.S); attributeDefinitions.add(attributeDefinition); - String tableName = TEST_TABLE_NAME; - List keySchema = new ArrayList(); KeySchemaElement keySchemaElement = new KeySchemaElement() .withAttributeName(TEST_ATTRIBUTE) @@ -180,7 +180,7 @@ private CreateTableResult createTable() throws Exception { .withReadCapacityUnits(UNITS) .withWriteCapacityUnits(UNITS); - CreateTableResult result = dynamoDb.createTable(attributeDefinitions, tableName, keySchema, provisionedThroughput); + CreateTableResult result = dynamoDb.createTable(attributeDefinitions, TEST_TABLE_NAME, keySchema, provisionedThroughput); return result; } @@ -380,11 +380,27 @@ private PutItemResult putItem(String attributeName, String attributeValue) throw return result; } - @Test(expected=InternalServerErrorException.class) + @Test public void test_query() throws Exception { - QueryResult result = dynamoDb.query(new QueryRequest()); + createTable(); + putItem(TEST_ATTRIBUTE, TEST_ATTRIBUTE_VALUE); - return; + Condition keyCondition = new Condition() + .withComparisonOperator(ComparisonOperator.EQ) + .withAttributeValueList(new AttributeValue().withS(TEST_ATTRIBUTE_VALUE)); + + Map keyConditions = new HashMap(); + keyConditions.put(TEST_ATTRIBUTE, keyCondition); + + QueryRequest queryRequest = new QueryRequest() + .withTableName(TEST_TABLE_NAME) + .withKeyConditions(keyConditions); + + QueryResult result = dynamoDb.query(queryRequest); + Integer found = result.getCount(); + + assertNotNull(found); + assertEquals(found.longValue(), 1); } // @Test(expected=InternalServerErrorException.class) diff --git a/src/test/java/com/bizo/awsstubs/services/dynamodb2/AttributeValueComparatorTest.java b/src/test/java/com/bizo/awsstubs/services/dynamodb2/AttributeValueComparatorTest.java new file mode 100644 index 0000000..88e94d6 --- /dev/null +++ b/src/test/java/com/bizo/awsstubs/services/dynamodb2/AttributeValueComparatorTest.java @@ -0,0 +1,141 @@ +package com.bizo.awsstubs.services.dynamodb2; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Before; +import org.junit.Test; + +import com.amazonaws.services.dynamodbv2.model.AttributeValue; + +public class AttributeValueComparatorTest { + + private static final String STRING_VALUE_1 = "Alpha"; + private static final String STRING_VALUE_2 = "Beta"; + private static final int INT_VALUE_1 = 1; + private static final int INT_VALUE_2 = 2; + + @Before + public void setUp() { + } + + @Test + public void test_equal_Strings() throws Exception { + AttributeValue attribute1 = new AttributeValue().withS(STRING_VALUE_1); + AttributeValue attribute2 = new AttributeValue().withS(STRING_VALUE_2); + + boolean result = AttributeValueComparator.equal(attribute1, attribute2); + + assertFalse(result); + } + + @Test + public void test_equal_Numbers() throws Exception { + AttributeValue attribute1 = new AttributeValue().withN(String.valueOf(INT_VALUE_1)); + AttributeValue attribute2 = new AttributeValue().withN(String.valueOf(INT_VALUE_2)); + + boolean result = AttributeValueComparator.equal(attribute1, attribute2); + + assertFalse(result); + } + + @Test + public void test_lessThan_Strings() throws Exception { + AttributeValue attribute1 = new AttributeValue().withS(STRING_VALUE_1); + AttributeValue attribute2 = new AttributeValue().withS(STRING_VALUE_2); + + boolean result = AttributeValueComparator.lessThan(attribute1, attribute2); + + assertTrue(result); + } + + @Test + public void test_lessThan_Strings2() throws Exception { + AttributeValue attribute1 = new AttributeValue().withS(STRING_VALUE_2); + AttributeValue attribute2 = new AttributeValue().withS(STRING_VALUE_1); + + boolean result = AttributeValueComparator.lessThan(attribute1, attribute2); + + assertFalse(result); + } + + @Test + public void test_lessThan_Numbers() throws Exception { + AttributeValue attribute1 = new AttributeValue().withN(String.valueOf(INT_VALUE_1)); + AttributeValue attribute2 = new AttributeValue().withN(String.valueOf(INT_VALUE_2)); + + boolean result = AttributeValueComparator.lessThan(attribute1, attribute2); + + assertTrue(result); + } + + @Test + public void test_greaterThan_Strings() throws Exception { + AttributeValue attribute1 = new AttributeValue().withS(STRING_VALUE_1); + AttributeValue attribute2 = new AttributeValue().withS(STRING_VALUE_2); + + boolean result = AttributeValueComparator.greaterThan(attribute1, attribute2); + + assertFalse(result); + } + + @Test + public void test_greaterThan_Strings2() throws Exception { + AttributeValue attribute1 = new AttributeValue().withS(STRING_VALUE_2); + AttributeValue attribute2 = new AttributeValue().withS(STRING_VALUE_1); + + boolean result = AttributeValueComparator.greaterThan(attribute1, attribute2); + + assertTrue(result); + } + + @Test + public void test_greaterThan_Numbers() throws Exception { + AttributeValue attribute1 = new AttributeValue().withN(String.valueOf(INT_VALUE_1)); + AttributeValue attribute2 = new AttributeValue().withN(String.valueOf(INT_VALUE_2)); + + boolean result = AttributeValueComparator.greaterThan(attribute1, attribute2); + + assertFalse(result); + } + + @Test + public void test_lessThanEqual_Strings() throws Exception { + AttributeValue attribute1 = new AttributeValue().withS(STRING_VALUE_1); + AttributeValue attribute2 = new AttributeValue().withS(STRING_VALUE_2); + + boolean result = AttributeValueComparator.lessThanEqual(attribute1, attribute2); + + assertTrue(result); + } + + @Test + public void test_lessThanEqual_Numbers() throws Exception { + AttributeValue attribute1 = new AttributeValue().withN(String.valueOf(INT_VALUE_1)); + AttributeValue attribute2 = new AttributeValue().withN(String.valueOf(INT_VALUE_2)); + + boolean result = AttributeValueComparator.lessThanEqual(attribute1, attribute2); + + assertTrue(result); + } + + @Test + public void test_greaterThanEqual_Strings() throws Exception { + AttributeValue attribute1 = new AttributeValue().withS(STRING_VALUE_1); + AttributeValue attribute2 = new AttributeValue().withS(STRING_VALUE_2); + + boolean result = AttributeValueComparator.greaterThanEqual(attribute1, attribute2); + + assertFalse(result); + } + + @Test + public void test_greaterThanEqual_Numbers() throws Exception { + AttributeValue attribute1 = new AttributeValue().withN(String.valueOf(INT_VALUE_1)); + AttributeValue attribute2 = new AttributeValue().withN(String.valueOf(INT_VALUE_2)); + + boolean result = AttributeValueComparator.greaterThanEqual(attribute1, attribute2); + + assertFalse(result); + } +}