use of com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException in project athenz by yahoo.
the class DynamoDBCertRecordStoreConnectionTest method testDeleteX509RecordException.
@Test
public void testDeleteX509RecordException() {
Mockito.doThrow(new AmazonDynamoDBException("invalid operation")).when(table).deleteItem(any(DeleteItemSpec.class));
DynamoDBCertRecordStoreConnection dbConn = getDBConnection();
boolean requestSuccess = dbConn.deleteX509CertRecord("athenz.provider", "12345", "cn");
assertFalse(requestSuccess);
dbConn.close();
}
use of com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException in project athenz by yahoo.
the class DynamoDBCertRecordStoreConnectionTest method testInsertX509RecordException.
@Test
public void testInsertX509RecordException() {
Date now = new Date();
X509CertRecord certRecord = getRecordNonNullableColumns(now);
Mockito.doThrow(new AmazonDynamoDBException("invalid operation")).when(table).putItem(any(Item.class));
DynamoDBCertRecordStoreConnection dbConn = getDBConnection();
boolean requestSuccess = dbConn.insertX509CertRecord(certRecord);
assertFalse(requestSuccess);
dbConn.close();
}
use of com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException in project athenz by yahoo.
the class DynamoDBCertRecordStoreConnectionTest method testGetX509CertRecordNotFoundException.
@Test
public void testGetX509CertRecordNotFoundException() {
Mockito.doThrow(new AmazonDynamoDBException("item not found")).when(table).getItem("primaryKey", "athenz.provider:cn:1234");
DynamoDBCertRecordStoreConnection dbConn = getDBConnection();
X509CertRecord certRecord = dbConn.getX509CertRecord("athenz.provider", "1234", "cn");
assertNull(certRecord);
dbConn.close();
}
use of com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException in project athenz by yahoo.
the class DynamoDBCertRecordStoreConnectionTest method testUpdateX509RecordException.
@Test
public void testUpdateX509RecordException() {
Date now = new Date();
X509CertRecord certRecord = getRecordNonNullableColumns(now);
Mockito.doThrow(new AmazonDynamoDBException("invalid operation")).when(table).updateItem(any(UpdateItemSpec.class));
DynamoDBCertRecordStoreConnection dbConn = getDBConnection();
boolean requestSuccess = dbConn.updateX509CertRecord(certRecord);
assertFalse(requestSuccess);
dbConn.close();
}
use of com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException in project athenz by yahoo.
the class DynamoDBSSHRecordStoreConnectionTest method testUpdateSSHRecordException.
@Test
public void testUpdateSSHRecordException() {
SSHCertRecord certRecord = new SSHCertRecord();
Mockito.doThrow(new AmazonDynamoDBException("invalid operation")).when(table).updateItem(ArgumentMatchers.any(UpdateItemSpec.class));
DynamoDBSSHRecordStoreConnection dbConn = new DynamoDBSSHRecordStoreConnection(dynamoDB, tableName);
boolean requestSuccess = dbConn.updateSSHCertRecord(certRecord);
assertFalse(requestSuccess);
dbConn.close();
}
Aggregations