diff --git a/org.restlet.java/org.restlet/src/test/java/org/restlet/ApplicationContextTestCase.java b/org.restlet.java/org.restlet/src/test/java/org/restlet/ApplicationContextTestCase.java index 5781e713c9..ee477d6c56 100644 --- a/org.restlet.java/org.restlet/src/test/java/org/restlet/ApplicationContextTestCase.java +++ b/org.restlet.java/org.restlet/src/test/java/org/restlet/ApplicationContextTestCase.java @@ -14,6 +14,7 @@ import org.junit.jupiter.api.Test; import org.restlet.data.MediaType; import org.restlet.data.Protocol; +import org.restlet.engine.Engine; import org.restlet.representation.Representation; import org.restlet.resource.ClientResource; import org.restlet.resource.Get; @@ -69,6 +70,8 @@ public String hello() { @BeforeEach protected void setUpEach() throws Exception { + Engine.register(); + Engine.clearThreadLocalVariables(); this.component = new Component(); this.component.getServers().add(Protocol.HTTP, TEST_PORT); this.component.getDefaultHost().attach("/api", new WebApiApplication()); @@ -78,6 +81,7 @@ protected void setUpEach() throws Exception { @AfterEach protected void tearDownEach() throws Exception { + Engine.clearThreadLocalVariables(); this.component.stop(); }