Details
-
New Feature
-
Resolution: Fixed
-
Major
-
4.2-milestone-3
-
None
Description
Usage:
public class RestrictParseLocationEventHandlerTest { ... /** * Capture logs with WARN or higher severity to assert them. */ @Rule public LogRule logRule = new LogRule() {{ record(LogLevel.WARN); recordLoggingForType(RestrictParseLocationEventHandler.class); }}; @Test public void includeEventWhenIllegalPath() { ... Assert.assertEquals(1, this.logRule.size()); Assert.assertTrue(this.logRule.contains( "Direct access to template file [/WEB-INF/xwiki.cfg] refused. Possible break-in attempt!")); } }