Fix test (changed format of /env endpoint)

This commit is contained in:
Dave Syer
2015-10-23 17:54:21 +01:00
parent 9b7771f9be
commit 8dba793499

View File

@@ -1,5 +1,9 @@
package sample;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -15,10 +19,6 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
// Normally spring.cloud.config.enabled:true is the default but since we have the config
@@ -59,9 +59,9 @@ public class ApplicationTests {
@Test
public void contextLoads() {
String foo = new TestRestTemplate().getForObject("http://localhost:" + port
+ "/env/info.foo", String.class);
assertEquals("bar", foo);
String foo = new TestRestTemplate()
.getForObject("http://localhost:" + port + "/env/info.foo", String.class);
assertEquals("{\"info.foo\":\"bar\"}", foo);
}
public static void main(String[] args) throws IOException {