Skip to content

Commit

Permalink
Fixed getCalls
Browse files Browse the repository at this point in the history
  • Loading branch information
brianluisgomez committed Oct 31, 2023
1 parent 0acb9af commit 439535a
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/test/java/com/bandwidth/sdk/api/CallsApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.time.OffsetDateTime;
import java.util.concurrent.TimeUnit;

import static org.hamcrest.MatcherAssert.assertThat;
Expand Down Expand Up @@ -61,7 +62,7 @@ public class CallsApiTest {
private static CallbackMethodEnum callbackMethod = CallbackMethodEnum.POST;
private static String testCallId = "Call-Id";
private static String testXmlBody = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Bxml><SpeakSentence locale=\"en_US\" gender=\"female\" voice=\"susan\">This is a test bxml response</SpeakSentence><Pause duration=\"3\"/></Bxml>";
private static int TEST_SLEEP = 3;
private static int TEST_SLEEP = 6;

@BeforeAll
public static void setupBeforeClass() throws URISyntaxException {
Expand Down Expand Up @@ -202,14 +203,17 @@ public void getCalls() throws ApiException {
ApiResponse<List<CallState>> response = api.listCallsWithHttpInfo(BW_ACCOUNT_ID, USER_NUMBER, BW_NUMBER, null, null, null, null, null);

assertThat(response.getStatusCode(), is(200));
assertThat(response.getData(), is(instanceOf(Array.class)));
assertThat(response.getData(0), hasProperty("accountId", is(BW_ACCOUNT_ID)));
assertThat(response.getData(0), hasProperty("applicationId", is(BW_VOICE_APPLICATION_ID)));
assertThat(response.getData(0), hasProperty("to", is(USER_NUMBER)));
assertThat(response.getData(0), hasProperty("from", is(BW_NUMBER)));
assertThat(response.getData(0), hasProperty("callId", is(instanceOf(String.class))));
assertThat(response.getData(0), hasProperty("state", is(instanceOf(String.class))))
;
System.out.println(response.getData());
assertThat(response.getData(), is(instanceOf(ArrayList.class)));
assertThat(response.getData().get(0), hasProperty("accountId", is(instanceOf(String.class))));
assertThat(response.getData().get(0), hasProperty("applicationId", is(instanceOf(String.class))));
assertThat(response.getData().get(0), hasProperty("callId", is(instanceOf(String.class))));
assertThat(response.getData().get(0), hasProperty("state", is(instanceOf(String.class))));
assertThat(response.getData().get(0), hasProperty("direction", is(instanceOf(CallDirectionEnum.class))));
assertThat(response.getData().get(0), hasProperty("startTime", is(instanceOf(OffsetDateTime.class))));
assertThat(response.getData().get(0), hasProperty("endTime", is(instanceOf(OffsetDateTime.class))));
assertThat(response.getData().get(0), hasProperty("errorMessage", is(instanceOf(String.class))));
assertThat(response.getData().get(0), hasProperty("errorId", is(instanceOf(String.class))));

}

Expand Down

0 comments on commit 439535a

Please sign in to comment.