@Test
public void testCreateMissingIndexName() {

    PrivateKeyStore keyStore = Mockito.mock(PrivateKeyStore.class);
    System.setProperty(ZTSConsts.ZTS_PROP_CERT_DYNAMODB_TABLE_NAME, "Athenz-ZTS-Table");
    System.clearProperty(ZTSConsts.ZTS_PROP_CERT_DYNAMODB_INDEX_CURRENT_TIME_NAME);
    DynamoDBCertRecordStoreFactory factory = new DynamoDBCertRecordStoreFactory();
    try {
        factory.create(keyStore);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), ResourceException.SERVICE_UNAVAILABLE);
    }
    System.setProperty(ZTSConsts.ZTS_PROP_CERT_DYNAMODB_INDEX_CURRENT_TIME_NAME, "");
    try {
        factory.create(keyStore);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), ResourceException.SERVICE_UNAVAILABLE);
    }
    System.clearProperty(ZTSConsts.ZTS_PROP_CERT_DYNAMODB_INDEX_CURRENT_TIME_NAME);
}