Ejemplo n.º 1
0
 public Space updateSpaceAvatar(Space existingSpace) {
   Identity spaceIdentity =
       identityStorage.findIdentity(SpaceIdentityProvider.NAME, existingSpace.getPrettyName());
   Profile profile = spaceIdentity.getProfile();
   profile.setProperty(Profile.AVATAR, existingSpace.getAvatarAttachment());
   identityStorage.updateProfile(profile);
   return existingSpace;
 }
Ejemplo n.º 2
0
  private void assertClean(String userBaseName, String spacePrettyBaseName) throws Exception {

    if (userBaseName != null) {
      assertEquals(null, organizationService.getUserHandler().findUserByName(userBaseName + "0"));
      assertEquals(
          null,
          identityStorage.findIdentity(OrganizationIdentityProvider.NAME, userBaseName + "0"));
    }

    if (spacePrettyBaseName != null) {
      assertEquals(
          null,
          spaceService.getSpaceByPrettyName(SpaceUtils.cleanString(spacePrettyBaseName) + "0"));
      assertEquals(
          null,
          identityStorage.findIdentity(
              SpaceIdentityProvider.NAME, spacePrettyBaseName.toLowerCase() + "0"));
    }
  }
Ejemplo n.º 3
0
  @Override
  public void tearDown() throws Exception {

    //
    for (String space : spaces) {
      spaceService.deleteSpace(spaceService.getSpaceByPrettyName(SpaceUtils.cleanString(space)));
      Identity i = identityStorage.findIdentity(SpaceIdentityProvider.NAME, space.toLowerCase());
      identityStorage.deleteIdentity(i);
    }

    //
    for (String user : users) {
      organizationService.getUserHandler().removeUser(user, false);
      Identity i = identityStorage.findIdentity(OrganizationIdentityProvider.NAME, user);
      identityStorage.deleteIdentity(i);
    }

    //
    end();
  }