@Test
  public void createConfirmed() throws Exception {

    toDelete.add(chatService.createChatCommunity(adminPerson.getUserName(), "confirmed", false));

    try (DbContext context = contextProvider.getDbContext()) {
      context.clearCache();

      Community c = context.getCommunityDAO().getByName("confirmed");
      assertTrue(c.isConfirmed());
    }
  }
  @After
  public void teardown() throws Exception {

    try (DbContext context = contextProvider.getDbContext()) {

      CommunityDAO communityDAO = context.getCommunityDAO();

      for (Community c : toDelete) {
        communityDAO.remove(c.getCommunityId());
      }

      PersonDAO personDao = context.getPersonDAO();

      personDao.remove(plainPerson.getPersonId());
      personDao.remove(adminPerson.getPersonId());
      personDao.remove(inActivePerson.getPersonId());

      context.commit();
    }
  }
  @Test
  public void createUnconfirmed() throws Exception {

    toDelete.add(chatService.createChatCommunity(plainPerson.getUserName(), "unconfirmed", false));

    /* one would expect this to work, albeit it does not... curse jpa, curse curse curse
     * I guess it is ok, since the entities are detached anyway...
     *
     * assertEquals(1, plainPerson.getMemberships().size() );
     */
    try (DbContext context = contextProvider.getDbContext()) {
      context.clearCache();

      Community c = context.getCommunityDAO().getByName("unconfirmed");
      assertFalse(c.isConfirmed());

      Person p = context.getPersonDAO().getById(plainPerson.getPersonId());
      assertEquals(1, p.getMemberships().size());
      assertEquals("unconfirmed", p.getMemberships().get(0).getCommunity().getName());
    }
  }