Skip to content

Commit 4280b4f

Browse files
Added Thread Sleep To CreateAndGetCall Tests
Our system returns a 404 when getting Calls if the request is made too quickly after the Call is created. Added a 750ms sleep before the GetCall requests to give the system time to know the Call has been created.
1 parent 1119cd3 commit 4280b4f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/test/java/com/bandwidth/VoiceApiTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public void testCreateCallAndGetCallState() throws Exception {
4949
assertEquals("From phone number for create call not equal", BW_NUMBER, createCallResponse.getFrom());
5050

5151
//get call state
52+
Thread.sleep(750); // Wait to get Call because of current system latency issues
5253
ApiResponse<CallState> callStateApiResponse = controller.getCall(ACCOUNT_ID, createCallResponse.getCallId());
5354
assertEquals("Response Code is not 200", 200, callStateApiResponse.getStatusCode());
5455

@@ -95,6 +96,7 @@ public void testCreateCallWithAmdAndGetCallState() throws Exception {
9596
assertEquals("From phone number for create call not equal", BW_NUMBER, createCallResponse.getFrom());
9697

9798
//get call state
99+
Thread.sleep(750); // Wait to get Call because of current system latency issues
98100
ApiResponse<CallState> callStateApiResponse = controller.getCall(ACCOUNT_ID, createCallResponse.getCallId());
99101
CallState callStateResponse = callStateApiResponse.getResult();
100102
assertEquals("Application ID for call state not equal", VOICE_APPLICATION_ID, callStateResponse.getApplicationId());

0 commit comments

Comments
 (0)