@Test
public void testGetDomainUserAuthorityFilterFromMap() {

    // if the map already have an entry we return that and no
    // connection object is necessary
    Map<String, String> map = new HashMap<>();
    map.put("coretech", "OnShore-US");
    assertEquals("OnShore-US", zms.dbService.getDomainUserAuthorityFilterFromMap(null, map, "coretech"));
    // we have a domain that is null
    ObjectStoreConnection conn = Mockito.mock(ObjectStoreConnection.class);
    Mockito.when(conn.getDomain("coretech")).thenReturn(null);
    // in this case we should get back ""
    map.clear();
    assertTrue(zms.dbService.getDomainUserAuthorityFilterFromMap(conn, map, "coretech").isEmpty());
    // we're going to return domain without authority filter
    // so we'll return "" as well
    Domain domain = new Domain();
    Mockito.when(conn.getDomain("coretech")).thenReturn(domain);
    map.clear();
    assertTrue(zms.dbService.getDomainUserAuthorityFilterFromMap(conn, map, "coretech").isEmpty());
    // now we're going to return with domain filter value
    domain = new Domain().setUserAuthorityFilter("OnShore-US");
    Mockito.when(conn.getDomain("coretech")).thenReturn(domain);
    map.clear();
    assertEquals("OnShore-US", zms.dbService.getDomainUserAuthorityFilterFromMap(conn, map, "coretech"));
}