@Test
public void testGetRolesByDomain() {

    ObjectStore saveStore = zms.dbService.store;
    AthenzDomain athenzDomain = new AthenzDomain("test1");
    Domain domain = new Domain().setName("test1").setMemberExpiryDays(100).setModified(Timestamp.fromCurrentTime());
    athenzDomain.setDomain(domain);
    Role testRole = new Role();
    testRole.setName("admin");
    List<Role> roles = new ArrayList<>();
    roles.add(testRole);
    athenzDomain.setRoles(roles);
    Mockito.when(mockObjStore.getConnection(true, false)).thenReturn(mockJdbcConn);
    Mockito.when(mockJdbcConn.getDomain(eq("test1"))).thenReturn(domain);
    Mockito.when(mockJdbcConn.getAthenzDomain(eq("test1"))).thenReturn(athenzDomain);
    zms.dbService.store = mockObjStore;
    List<Role> rolesFetched = zms.dbService.getRolesByDomain("test1");
    assertEquals(1, rolesFetched.size());
    assertEquals("admin", rolesFetched.get(0).getName());
    zms.dbService.store = saveStore;
}