Skip to content

Commit ad19a24

Browse files
Fix unit tests
Need to reset request log generation
1 parent ec4b1ab commit ad19a24

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

cf-java-logging-support-servlet/src/test/java/com/sap/hcp/cf/logging/servlet/filter/GenerateRequestLogFilterTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ public void directlyForwardsRequestResponseWhenLogIsDisabled() throws Exception
126126

127127
verify(chain).doFilter(request, response);
128128
assertThat(systemOut.toString(), isEmptyOrNullString());
129+
130+
((LoggerContext) LoggerFactory.getILoggerFactory()).getLogger(RequestLogger.class).setLevel(Level.INFO);
131+
129132
}
130133

131134
}

cf-java-logging-support-servlet/src/test/java/com/sap/hcp/cf/logging/servlet/filter/LogContextToRequestAttributeFilterTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class LogContextToRequestAttributeFilterTest {
3636

3737
@Test
3838
public void addsContextMapAsRequestAttribute() throws Exception {
39+
MDC.clear();
3940
MDC.put("this key", "this value");
4041
MDC.put("that key", "that value");
4142

0 commit comments

Comments
 (0)