when(mockConfig.getInt(eq(ConfigProperties.PRODUCT_CACHE_MAX))).thenReturn(100);
when(eventFactory.getEventBuilder(any(Target.class), any(Type.class))).thenReturn(eventBuilder);
when(eventBuilder.setNewEntity(any(AbstractHibernateObject.class))).thenReturn(eventBuilder);
when(eventBuilder.setOldEntity(any(AbstractHibernateObject.class))).thenReturn(eventBuilder);
this.productCache = new ProductCache(mockConfig, mockProductAdapter);
this.principal = TestUtil.createOwnerPrincipal();
this.manager = spy(new CandlepinPoolManager(mockPoolCurator, mockSubAdapter,
productCache, entCertAdapterMock, mockEventSink, eventFactory,
mockConfig, enforcerMock, poolRulesMock, entitlementCurator,