Fix integration test

This commit is contained in:
Dave Syer
2014-12-12 11:23:42 +00:00
parent aeda3cb3f3
commit 0ef78db45c

View File

@@ -4,6 +4,7 @@ import static org.junit.Assert.assertEquals;
import java.io.IOException;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -15,6 +16,7 @@ import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.TestRestTemplate;
import org.springframework.cloud.config.server.ConfigServerTestUtils;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
@@ -40,6 +42,11 @@ public class ApplicationTests {
.getEmbeddedServletContainer().getPort();
System.setProperty("config.port", "" + configPort);
}
@AfterClass
public static void close() {
System.clearProperty("config.port");
}
@Test
public void contextLoads() {