@Test
public void testUpdateRoleMemberDisabledState() {

    final String domainName = "test-domain";
    final String roleName = "role-name";
    final String adminUser = "user.admin";
    ObjectStoreConnection con = Mockito.mock(ObjectStoreConnection.class);
    Mockito.when(con.updateRoleMemberDisabledState(domainName, roleName, "user.john", "user.admin", 1, "auditref"))
            .thenReturn(true)
            .thenReturn(false)
            .thenThrow(new ResourceException(500, "invalid operation"));
    RoleMember roleMember = new RoleMember().setMemberName("user.john").setSystemDisabled(1);
    List<RoleMember> roleMembers = new ArrayList<>();
    roleMembers.add(roleMember);
    // first time we get successful response
    assertTrue(zms.dbService.updateRoleMemberDisabledState(null, con, roleMembers, domainName,
            roleName, adminUser, "auditref", "unit-test"));
    // second time we're getting false so no changes
    assertFalse(zms.dbService.updateRoleMemberDisabledState(null, con, roleMembers, domainName,
            roleName, adminUser, "auditref", "unit-test"));
    // last time exception so no changes
    assertFalse(zms.dbService.updateRoleMemberDisabledState(null, con, roleMembers, domainName,
            roleName, adminUser, "auditref", "unit-test"));
}