use of com.yahoo.athenz.common.server.workload.WorkloadRecordStore in project athenz by yahoo.
the class DynamoDBWorkloadRecordStoreFactoryTest method testCreate.
@Test
public void testCreate() {
System.setProperty(ZTSConsts.ZTS_PROP_WORKLOAD_DYNAMODB_TABLE_NAME, "Workload-Table");
System.setProperty(ZTSConsts.ZTS_PROP_WORKLOAD_DYNAMODB_INDEX_SERVICE_NAME, "Workload-Service-Index");
System.setProperty(ZTSConsts.ZTS_PROP_WORKLOAD_DYNAMODB_INDEX_IP_NAME, "Workload-Ip-Index");
PrivateKeyStore keyStore = Mockito.mock(PrivateKeyStore.class);
DynamoDBWorkloadRecordStoreFactoryTest.TestDynamoDBWorkloadRecordStoreFactory factory = new DynamoDBWorkloadRecordStoreFactoryTest.TestDynamoDBWorkloadRecordStoreFactory();
WorkloadRecordStore store = factory.create(keyStore);
Assert.assertNotNull(store);
System.clearProperty(ZTSConsts.ZTS_PROP_WORKLOAD_DYNAMODB_TABLE_NAME);
System.clearProperty(ZTSConsts.ZTS_PROP_WORKLOAD_DYNAMODB_INDEX_SERVICE_NAME);
System.clearProperty(ZTSConsts.ZTS_PROP_WORKLOAD_DYNAMODB_INDEX_IP_NAME);
}
use of com.yahoo.athenz.common.server.workload.WorkloadRecordStore in project athenz by yahoo.
the class JDBCWorkloadRecordStoreFactoryTest method testCreate.
@Test
public void testCreate() {
System.setProperty(ZTSConsts.ZTS_PROP_WORKLOAD_JDBC_STORE, "jdbc:mysql://localhost");
System.setProperty(ZTSConsts.ZTS_PROP_WORKLOAD_JDBC_USER, "user");
System.setProperty(ZTSConsts.ZTS_PROP_WORKLOAD_JDBC_PASSWORD, "password");
PrivateKeyStore keyStore = Mockito.mock(PrivateKeyStore.class);
Mockito.doReturn("password").when(keyStore).getApplicationSecret("jdbc", "password");
JDBCWorkloadRecordStoreFactory factory = new JDBCWorkloadRecordStoreFactory();
WorkloadRecordStore store = factory.create(keyStore);
Assert.assertNotNull(store);
}
Aggregations