### Question:
VersionedClientlibsTransformerFactory extends AbstractGuavaCacheMBean<VersionedClientLibraryMd5CacheKey, String> implements TransformerFactory, EventHandler, CacheMBean { @Activate @SuppressWarnings("squid:S1149") protected void activate(ComponentContext componentContext) { final BundleContext bundleContext = componentContext.getBundleContext(); final Dictionary<?, ?> props = componentContext.getProperties(); final int size = PropertiesUtil.toInteger(props.get(PROP_MD5_CACHE_SIZE), DEFAULT_MD5_CACHE_SIZE); this.md5Cache = CacheBuilder.newBuilder().recordStats().maximumSize(size).build(); this.disableVersioning = PropertiesUtil.toBoolean(props.get(PROP_DISABLE_VERSIONING), DEFAULT_DISABLE_VERSIONING); this.enforceMd5 = PropertiesUtil.toBoolean(props.get(PROP_ENFORCE_MD5), DEFAULT_ENFORCE_MD5); if (enforceMd5) { Dictionary<String, Object> filterProps = new Hashtable<String, Object>(); filterProps.put("sling.filter.scope", "REQUEST"); filterProps.put("service.ranking", Integer.valueOf(0)); filterReg = bundleContext.registerService(Filter.class, new BadMd5VersionedClientLibsFilter(), filterProps); } } VersionedClientlibsTransformerFactory(); Transformer createTransformer(); @Override void handleEvent(Event event);  }### Answer:
@Test public void testRegisterFilter() throws Exception { Hashtable<String, Object> props = new Hashtable<String, Object>(); props.put("enforce.md5", Boolean.TRUE); when(componentContext.getProperties()).thenReturn(props); factory.activate(componentContext); verify(bundleContext).registerService(eq(Filter.class), any(Filter.class), any()); }