Skip to content

Commit

Permalink
add end2end test case
Browse files Browse the repository at this point in the history
  • Loading branch information
kaibocai committed Jul 10, 2023
1 parent 540798e commit 0994c8c
Showing 1 changed file with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
@Tag("e2e")
public class EndToEndTests {

private String waitForCompletion(String statusQueryGetUri) throws InterruptedException {
String runTimeStatus = null;
for (int i = 0; i < 15; i++) {
Response statusResponse = get(statusQueryGetUri);
runTimeStatus = statusResponse.jsonPath().get("runtimeStatus");
if (!"Completed".equals(runTimeStatus)) {
Thread.sleep(1000);
} else break;
}
return runTimeStatus;
}

@Order(1)
@Test
public void setupHost() {
Expand Down Expand Up @@ -82,16 +94,13 @@ public void restart(boolean restartWithNewInstanceId) throws InterruptedExceptio
}
}

private String waitForCompletion(String statusQueryGetUri) throws InterruptedException {
String runTimeStatus = null;
for (int i = 0; i < 15; i++) {
Response statusResponse = get(statusQueryGetUri);
runTimeStatus = statusResponse.jsonPath().get("runtimeStatus");
if (!"Completed".equals(runTimeStatus)) {
Thread.sleep(1000);
} else break;
}
return runTimeStatus;
@Test
public void customizeDataConverter() throws InterruptedException {
String startOrchestrationPath = "/api/StartCustomize";
Response response = post(startOrchestrationPath);
JsonPath jsonPath = response.jsonPath();
String statusQueryGetUri = jsonPath.get("statusQueryGetUri");
String runTimeStatus = waitForCompletion(statusQueryGetUri);
assertEquals("Completed", runTimeStatus);
}

}

0 comments on commit 0994c8c

Please sign in to comment.