Search in sources :

Example 6 with WorkloadRecordStore

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);
}
Also used : PrivateKeyStore(com.yahoo.athenz.auth.PrivateKeyStore) WorkloadRecordStore(com.yahoo.athenz.common.server.workload.WorkloadRecordStore) Test(org.testng.annotations.Test)

Example 7 with WorkloadRecordStore

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);
}
Also used : PrivateKeyStore(com.yahoo.athenz.auth.PrivateKeyStore) WorkloadRecordStore(com.yahoo.athenz.common.server.workload.WorkloadRecordStore) Test(org.testng.annotations.Test)

Aggregations

WorkloadRecordStore (com.yahoo.athenz.common.server.workload.WorkloadRecordStore)7 Test (org.testng.annotations.Test)7 WorkloadRecordStoreConnection (com.yahoo.athenz.common.server.workload.WorkloadRecordStoreConnection)4 PrivateKeyStore (com.yahoo.athenz.auth.PrivateKeyStore)3 WorkloadRecord (com.yahoo.athenz.common.server.workload.WorkloadRecord)2 File (java.io.File)1