ActivationKeyCurator akc = mock(ActivationKeyCurator.class);
Pool p = genPool();
p.setProductAttribute("requires_consumer_type", "candlepin", "id");
PoolManager poolManager = mock(PoolManager.class);
when(akc.verifyAndLookupKey(eq("testKey"))).thenReturn(ak);
when(poolManager.find(eq("testPool"))).thenReturn(p);
ActivationKeyResource akr = new ActivationKeyResource(
akc, i18n, poolManager, serviceLevelValidator, activationKeyRules, null);
assertNotNull(akr.addPoolToKey("testKey", "testPool", 1L));