### Question:
XWikiContextCacheKeyFactory { public String getCacheKey() { XWikiContext xcontext = xcontextProvider.get(); XWikiURLFactory urlFactory = xcontext.getURLFactory(); String urlFactoryName = urlFactory.getClass().getName(); String urlFactoryGeneratedURL = urlFactory.createSkinURL("style.css", "skin", xcontext).getPath(); return String.format("XWikiContext[URLFactory[%s, %s]]", urlFactoryName, urlFactoryGeneratedURL); }  String getCacheKey();  }### Answer:
@Test public void getCacheKey() throws Exception { XWikiURLFactory urlFactory = mock(XWikiURLFactory.class); when(xcontext.getURLFactory()).thenReturn(urlFactory); when(urlFactory.createSkinURL(any(), any(), any(XWikiContext.class))).thenReturn( new URL("http: assertEquals("XWikiContext[URLFactory[" + urlFactory.getClass().getName() + ", /path]]", mocker.getComponentUnderTest().getCacheKey()); }