Skip to content

Commit 0994c8c

Browse files
committed
add end2end test case
1 parent 540798e commit 0994c8c

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

samples-azure-functions/src/test/java/com/functions/EndToEndTests.java

+20-11
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@
1515
@Tag("e2e")
1616
public class EndToEndTests {
1717

18+
private String waitForCompletion(String statusQueryGetUri) throws InterruptedException {
19+
String runTimeStatus = null;
20+
for (int i = 0; i < 15; i++) {
21+
Response statusResponse = get(statusQueryGetUri);
22+
runTimeStatus = statusResponse.jsonPath().get("runtimeStatus");
23+
if (!"Completed".equals(runTimeStatus)) {
24+
Thread.sleep(1000);
25+
} else break;
26+
}
27+
return runTimeStatus;
28+
}
29+
1830
@Order(1)
1931
@Test
2032
public void setupHost() {
@@ -82,16 +94,13 @@ public void restart(boolean restartWithNewInstanceId) throws InterruptedExceptio
8294
}
8395
}
8496

85-
private String waitForCompletion(String statusQueryGetUri) throws InterruptedException {
86-
String runTimeStatus = null;
87-
for (int i = 0; i < 15; i++) {
88-
Response statusResponse = get(statusQueryGetUri);
89-
runTimeStatus = statusResponse.jsonPath().get("runtimeStatus");
90-
if (!"Completed".equals(runTimeStatus)) {
91-
Thread.sleep(1000);
92-
} else break;
93-
}
94-
return runTimeStatus;
97+
@Test
98+
public void customizeDataConverter() throws InterruptedException {
99+
String startOrchestrationPath = "/api/StartCustomize";
100+
Response response = post(startOrchestrationPath);
101+
JsonPath jsonPath = response.jsonPath();
102+
String statusQueryGetUri = jsonPath.get("statusQueryGetUri");
103+
String runTimeStatus = waitForCompletion(statusQueryGetUri);
104+
assertEquals("Completed", runTimeStatus);
95105
}
96-
97106
}

0 commit comments

Comments
 (0)