### Question:
EnvironmentSkin extends AbstractSkin { @Override public Resource<?> getLocalResource(String resourceName) { String resourcePath = getSkinResourcePath(resourceName); if (this.environment.getResource(resourcePath) != null) { return createResource(resourcePath, resourceName); } return null; } EnvironmentSkin(String id, InternalSkinManager skinManager, InternalSkinConfiguration configuration,
        Logger logger, Environment environment, Provider<XWikiContext> xcontextProvider,
        URLConfiguration urlConfiguration); Configuration getProperties(); String getSkinFolder(); @Override Resource<?> getLocalResource(String resourceName); @Override String getOutputSyntaxString();  }### Answer:
@Test public void getLocalResource() throws Exception { String relativePath = "o;ne/t?w&o/../t=hr#e e"; String fullPath = "/skins/test/" + relativePath; when(this.environment.getResource(fullPath)).thenReturn(new URL("http: Resource<?> resource = skin.getLocalResource(relativePath); assertEquals(fullPath, resource.getPath()); }
@Test public void getLocalResourceWithBreakInAttempt() throws Exception { assertNull(skin.getLocalResource("one/../../two")); assertEquals("Direct access to skin file [/skins/two] refused. Possible break-in attempt!", allLogRule.getMessage(0)); }