public void testCreate() throws Exception {
    user.addPermanentRole(RoleFactory.ACTIVATION_KEY_ADMIN);
    String note = "Test";
    final ActivationKey key = manager.createNewActivationKey(user, note);
    assertEquals(user.getOrg(), key.getOrg());
    assertEquals(note, key.getNote());
    assertNotNull(key.getKey());
    Server server = ServerFactoryTest.createTestServer(user, true);

    final ActivationKey key1 = manager.createNewReActivationKey(user, server, note);
    assertEquals(server, key1.getServer());

    ActivationKey temp = manager.lookupByKey(key.getKey(), user);
    assertNotNull(temp);
    assertEquals(user.getOrg(), temp.getOrg());
    assertEquals(note, temp.getNote());

    String keyName = "I_RULE_THE_WORLD";
    Long usageLimit = new Long(1200);
    Channel baseChannel = ChannelTestUtils.createBaseChannel(user);

    final ActivationKey key2 =
        manager.createNewReActivationKey(
            user, server, keyName, note, usageLimit, baseChannel, true, null);

    temp = (ActivationKey) reload(key2);
    assertTrue(temp.getKey().endsWith(keyName));
    assertEquals(note, temp.getNote());
    assertEquals(usageLimit, temp.getUsageLimit());
    Set channels = new HashSet();
    channels.add(baseChannel);
    assertEquals(channels, temp.getChannels());

    // since universal default == true we have to
    // check if the user org has it..
    Token token = user.getOrg().getToken();
    assertEquals(channels, token.getChannels());
    assertEquals(usageLimit, token.getUsageLimit());
  }