@Test
public void testCreateUserGroup() {

    HttpServletRequest request = mock(HttpServletRequest.class);
    RevisionInfo revisionInfo = new RevisionInfo("client1", 0L);
    UserGroup userGroup = new UserGroup(null, "identity");
    userGroup.setRevision(revisionInfo);
    RevisionInfo resultRevisionInfo = new RevisionInfo("client1", 1L);
    UserGroup result = new UserGroup("identifier", userGroup.getIdentity());
    result.setRevision(resultRevisionInfo);
    when(serviceFacade.createUserGroup(userGroup)).thenReturn(result);
    tenantResource.createUserGroup(request, userGroup);
    verify(serviceFacade).createUserGroup(userGroup);
    verify(eventService).publish(eq(EventFactory.userGroupCreated(result)));
}