Commit 8067a536 authored by Andy Wilkinson's avatar Andy Wilkinson

Prevent run failures in tests from polluting LoggerContext

parent 9e88dced
......@@ -16,13 +16,17 @@
package org.springframework.boot.devtools;
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import ch.qos.logback.classic.Logger;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
......@@ -38,6 +42,12 @@ public class RemoteUrlPropertyExtractorTests {
@Rule
public ExpectedException thrown = ExpectedException.none();
@After
public void preventRunFailuresFromPollutingLoggerContext() {
((Logger) LoggerFactory.getLogger(RemoteUrlPropertyExtractorTests.class))
.getLoggerContext().getTurboFilterList().clear();
}
@Test
public void missingUrl() throws Exception {
this.thrown.expect(IllegalStateException.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment