@Test
public void testDeleteUserGroup() {

    HttpServletRequest request = mock(HttpServletRequest.class);
    UserGroup userGroup = new UserGroup("identifier", "identity");
    Long version = new Long(0);
    ClientIdParameter clientId = new ClientIdParameter();
    when(serviceFacade.deleteUserGroup(eq(userGroup.getIdentifier()), any(RevisionInfo.class))).thenReturn(userGroup);
    tenantResource.removeUserGroup(request, new LongParameter(version.toString()), clientId, userGroup.getIdentifier());
    verify(serviceFacade).deleteUserGroup(eq(userGroup.getIdentifier()), any(RevisionInfo.class));
    verify(eventService).publish(eq(EventFactory.userGroupDeleted(userGroup)));
}