Skip to content

Commit 439535a

Browse files
Fixed getCalls
1 parent 0acb9af commit 439535a

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/test/java/com/bandwidth/sdk/api/CallsApiTest.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.net.URISyntaxException;
2828
import java.util.ArrayList;
2929
import java.util.List;
30+
import java.time.OffsetDateTime;
3031
import java.util.concurrent.TimeUnit;
3132

3233
import static org.hamcrest.MatcherAssert.assertThat;
@@ -61,7 +62,7 @@ public class CallsApiTest {
6162
private static CallbackMethodEnum callbackMethod = CallbackMethodEnum.POST;
6263
private static String testCallId = "Call-Id";
6364
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>";
64-
private static int TEST_SLEEP = 3;
65+
private static int TEST_SLEEP = 6;
6566

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

204205
assertThat(response.getStatusCode(), is(200));
205-
assertThat(response.getData(), is(instanceOf(Array.class)));
206-
assertThat(response.getData(0), hasProperty("accountId", is(BW_ACCOUNT_ID)));
207-
assertThat(response.getData(0), hasProperty("applicationId", is(BW_VOICE_APPLICATION_ID)));
208-
assertThat(response.getData(0), hasProperty("to", is(USER_NUMBER)));
209-
assertThat(response.getData(0), hasProperty("from", is(BW_NUMBER)));
210-
assertThat(response.getData(0), hasProperty("callId", is(instanceOf(String.class))));
211-
assertThat(response.getData(0), hasProperty("state", is(instanceOf(String.class))))
212-
;
206+
System.out.println(response.getData());
207+
assertThat(response.getData(), is(instanceOf(ArrayList.class)));
208+
assertThat(response.getData().get(0), hasProperty("accountId", is(instanceOf(String.class))));
209+
assertThat(response.getData().get(0), hasProperty("applicationId", is(instanceOf(String.class))));
210+
assertThat(response.getData().get(0), hasProperty("callId", is(instanceOf(String.class))));
211+
assertThat(response.getData().get(0), hasProperty("state", is(instanceOf(String.class))));
212+
assertThat(response.getData().get(0), hasProperty("direction", is(instanceOf(CallDirectionEnum.class))));
213+
assertThat(response.getData().get(0), hasProperty("startTime", is(instanceOf(OffsetDateTime.class))));
214+
assertThat(response.getData().get(0), hasProperty("endTime", is(instanceOf(OffsetDateTime.class))));
215+
assertThat(response.getData().get(0), hasProperty("errorMessage", is(instanceOf(String.class))));
216+
assertThat(response.getData().get(0), hasProperty("errorId", is(instanceOf(String.class))));
213217

214218
}
215219

0 commit comments

Comments
 (0)