DynamoDBWorkerUtils { public static void updateETag(final AmazonDynamoDB dynamoDB, final String table, final String resource, final String eTag) { final Map<String, AttributeValue> newResource = new HashMap<>(); newResource.put(MarsDynamoDBManager.RESOURCE_TABLE_HASH_KEY, new AttributeValue(resource)); newResource.put(DynamoDBWorkerUtils.ETAG_KEY, new AttributeValue(eTag)); dynamoDB.putItem(table, newResource); } private  DynamoDBWorkerUtils(); static String getStoredETag(final AmazonDynamoDB dynamoDB, final String table, final String resource); static void updateETag(final AmazonDynamoDB dynamoDB, final String table, final String resource,
        final String eTag); static final String ETAG_KEY; }
@Test public void testUpdateETag() { AmazonDynamoDB dynamoDB = PowerMock.createMock(AmazonDynamoDB.class); Map<String, AttributeValue> newItem = new HashMap<String, AttributeValue>(); newItem.put(MarsDynamoDBManager.RESOURCE_TABLE_HASH_KEY, new AttributeValue(resource)); newItem.put(DynamoDBWorkerUtils.ETAG_KEY, new AttributeValue(eTag)); dynamoDB.putItem(table, newItem); PowerMock.expectLastCall().andReturn(null); PowerMock.replayAll(); DynamoDBWorkerUtils.updateETag(dynamoDB, table, resource, eTag); PowerMock.verifyAll(); }