@Test
public void testProcessGroupMemberFailure() {

    final String domainName = "failure-group-mbr-domain";
    final String groupName = "group1";
    // mock returning failure
    Group groupOriginal = createGroupObject(domainName, groupName, "user.user1", "user.user2");
    Group groupUpdated = createGroupObject(domainName, groupName, "user.user2", "user.user3");
    Mockito.when(mockObjStore.getConnection(true, true)).thenReturn(mockJdbcConn);
    Mockito.when(mockJdbcConn.updateGroup(anyString(), any(Group.class)))
            .thenReturn(true);
    // first any update delete is marked as failure
    StringBuilder auditDetails = new StringBuilder("testAudit");
    Mockito.when(mockJdbcConn.deleteGroupMember(anyString(), anyString(), anyString(),
            anyString(), anyString())).thenReturn(false);
    assertFalse(zms.dbService.processGroup(mockJdbcConn, groupOriginal, domainName,
            groupName, groupUpdated, adminUser, auditRef, auditDetails));
    // now we're going to allow deletes to work but inserts fail
    Mockito.when(mockJdbcConn.deleteGroupMember(anyString(), anyString(), anyString(),
            anyString(), anyString())).thenReturn(true);
    Mockito.when(mockJdbcConn.insertGroupMember(anyString(), anyString(), any(GroupMember.class),
            anyString(), anyString())).thenReturn(false);
    Mockito.when(mockJdbcConn.insertGroup(anyString(), any(Group.class)))
            .thenReturn(true);
    assertFalse(zms.dbService.processGroup(mockJdbcConn, groupOriginal, domainName,
            groupName, groupUpdated, adminUser, auditRef, auditDetails));
}