when(akc.verifyAndLookupKey(eq("testKey"))).thenReturn(ak);
when(poolManager.find(eq("testPool1"))).thenReturn(p1);
when(poolManager.find(eq("testPool2"))).thenReturn(p2);
ActivationKeyResource akr = new ActivationKeyResource(
akc, i18n, poolManager, serviceLevelValidator, activationKeyRules, null);
akr.addPoolToKey("testKey", "testPool1", 1L);
assertEquals(1, ak.getPools().size());
Set<ActivationKeyPool> akPools = new HashSet<ActivationKeyPool>();
akPools.add(new ActivationKeyPool(ak, p1, 1L));
ak.setPools(akPools);
akr.addPoolToKey("testKey", "testPool2", 1L);
assertEquals(2, ak.getPools().size());
}