Add POJO sample and switch to using that for testing
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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\"}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user