Add POJO sample and switch to using that for testing

This commit is contained in:
Dave Syer
2017-01-03 17:48:57 +00:00
parent c62216ffba
commit f8a5f02be3
9 changed files with 403 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ public class FunctionAdminController implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
deploy("sample", "maven://com.example:function-sample:1.0.0.BUILD-SNAPSHOT");
deploy("sample", "maven://com.example:function-sample-pojo:1.0.0.BUILD-SNAPSHOT");
}
private String deploy(String name, String path, String... args) throws Exception {

View File

@@ -37,6 +37,7 @@ public class FunctionExtractingAppDeployerIntegrationTests {
@BeforeClass
public static void open() {
port = SocketUtils.findAvailableTcpPort();
System.setProperty("debug", "true");
context = new ApplicationRunner().start("--server.port=" + port);
}
@@ -48,10 +49,17 @@ public class FunctionExtractingAppDeployerIntegrationTests {
}
@Test
public void test() {
public void words() {
assertThat(new TestRestTemplate()
.getForObject("http://localhost:" + port + "/words", String.class))
.isEqualTo("foobar");
.isEqualTo("{\"value\":\"foo\"}{\"value\":\"bar\"}");
}
@Test
public void uppercase() {
assertThat(new TestRestTemplate().postForObject(
"http://localhost:" + port + "/uppercase", "{\"value\":\"foo\"}",
String.class)).isEqualTo("{\"value\":\"FOO\"}");
}
}