@Test
public void testEnforcedUserAuthorityFilter() {

    Authority savedAuthority = zms.userAuthority;
    // null authority, filter or empty filter
    zms.userAuthority = null;
    assertNull(zms.enforcedUserAuthorityFilter("validFilter", null));
    assertNull(zms.enforcedUserAuthorityFilter(null, "validFilter"));
    assertNull(zms.enforcedUserAuthorityFilter("validFilter", "validFilter"));
    assertNull(zms.enforcedUserAuthorityFilter(null, null));
    zms.userAuthority = Mockito.mock(Authority.class);
    assertNull(zms.enforcedUserAuthorityFilter(null, null));
    assertNull(zms.enforcedUserAuthorityFilter("", null));
    assertNull(zms.enforcedUserAuthorityFilter(null, ""));
    // valid filter
    assertEquals("validFilter", zms.enforcedUserAuthorityFilter("validFilter", null));
    assertEquals("validFilter", zms.enforcedUserAuthorityFilter(null, "validFilter"));
    assertEquals("validFilter", zms.enforcedUserAuthorityFilter("validFilter", ""));
    assertEquals("validFilter", zms.enforcedUserAuthorityFilter("", "validFilter"));
    assertEquals("validFilter1,validFilter2", zms.enforcedUserAuthorityFilter("validFilter1", "validFilter2"));
    assertEquals("validFilter,validFilter", zms.enforcedUserAuthorityFilter("validFilter", "validFilter"));
    zms.userAuthority = savedAuthority;
}