use of com.yahoo.athenz.zts.store.impl.MockZMSFileChangeLogStore in project athenz by yahoo.
the class DataStoreTest method testRemoveHostEntrieNullMap.
@Test
public void testRemoveHostEntrieNullMap() {
ChangeLogStore clogStore = new MockZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root", pkey, "0");
DataStore store = new DataStore(clogStore, null);
List<String> services = new ArrayList<>();
services.add("coretech.storage");
services.add("coretech.backup");
store.hostCache.put("host1", services);
services = new ArrayList<>();
services.add("coretech.storage");
services.add("coretech.backup");
store.hostCache.put("host2", services);
store.removeHostEntries(null);
assertEquals(store.hostCache.size(), 2);
List<String> retServices = store.hostCache.get("host1");
assertEquals(retServices.size(), 2);
assertTrue(retServices.contains("coretech.storage"));
assertTrue(retServices.contains("coretech.backup"));
retServices = store.hostCache.get("host2");
assertEquals(retServices.size(), 2);
assertTrue(retServices.contains("coretech.storage"));
assertTrue(retServices.contains("coretech.backup"));
}
use of com.yahoo.athenz.zts.store.impl.MockZMSFileChangeLogStore in project athenz by yahoo.
the class DataStoreTest method DataStorContstructorTest.
@Test
public void DataStorContstructorTest() {
ChangeLogStore clogStore = new MockZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root", pkey, "0");
DataStore store = new DataStore(clogStore, null);
assertNotNull(store);
}
use of com.yahoo.athenz.zts.store.impl.MockZMSFileChangeLogStore in project athenz by yahoo.
the class DataStoreTest method testValidDomainListResponseEmpty.
@Test
public void testValidDomainListResponseEmpty() {
ChangeLogStore clogStore = new MockZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root", pkey, "0");
DataStore store = new DataStore(clogStore, null);
Set<String> domainList = new HashSet<>();
assertFalse(store.validDomainListResponse(domainList));
}
use of com.yahoo.athenz.zts.store.impl.MockZMSFileChangeLogStore in project athenz by yahoo.
the class DataStoreTest method testProcessStandardMembershipRoleCheckNull.
@Test
public void testProcessStandardMembershipRoleCheckNull() {
ChangeLogStore clogStore = new MockZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root", pkey, "0");
DataStore store = new DataStore(clogStore, null);
Set<String> accessibleRoles = new HashSet<>();
String prefix = "coretech" + ROLE_POSTFIX;
Set<MemberRole> memberRoles = new HashSet<>();
memberRoles.add(new MemberRole("coretech:role.admin", 0));
memberRoles.add(new MemberRole("coretech:role.readers", 0));
store.processStandardMembership(memberRoles, prefix, null, accessibleRoles, false);
assertEquals(accessibleRoles.size(), 2);
assertTrue(accessibleRoles.contains("admin"));
assertTrue(accessibleRoles.contains("readers"));
}
use of com.yahoo.athenz.zts.store.impl.MockZMSFileChangeLogStore in project athenz by yahoo.
the class DataStoreTest method testAddRoleToListSingleRoleSpecifiedNoMatch.
@Test
public void testAddRoleToListSingleRoleSpecifiedNoMatch() {
ChangeLogStore clogStore = new MockZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root", pkey, "0");
DataStore store = new DataStore(clogStore, null);
Set<String> accessibleRoles = new HashSet<>();
String[] requestedRoleList = { "admin2" };
store.addRoleToList("coretech:role.admin", "coretech:role.", requestedRoleList, accessibleRoles, false);
assertEquals(accessibleRoles.size(), 0);
}
Aggregations