Skip to content

Commit 9c7b812

Browse files
committed
update tests
1 parent 7e4df6f commit 9c7b812

File tree

5 files changed

+120
-11
lines changed

5 files changed

+120
-11
lines changed

src/test/java/com/bandwidth/sdk/smoke/MessagesApiTest.java

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import com.bandwidth.sdk.model.MessageTypeEnum;
1414
import com.bandwidth.sdk.model.MessagesList;
1515
import com.bandwidth.sdk.model.PriorityEnum;
16+
import com.bandwidth.sdk.model.ProductTypeEnum;
17+
1618
import org.junit.jupiter.api.Assertions;
1719
import org.junit.jupiter.api.Test;
1820

@@ -50,6 +52,16 @@ public class MessagesApiTest {
5052
String fromDateTime = null;
5153
String toDateTime = null;
5254
String campaignId = null;
55+
Integer fromBwLatency = null;
56+
Boolean bwQueued = null;
57+
ProductTypeEnum product = ProductTypeEnum.fromValue("TOLL_FREE");
58+
String location = null;
59+
String callingNumberCountryA3 = null;
60+
String calledNumberCountryA3 = null;
61+
Integer fromSegmentCount = null;
62+
Integer toSegmentCount = null;
63+
Integer fromMessageSize = null;
64+
Integer toMessageSize = null;
5365
String sort = "sourceTn:desc";
5466
String pageToken = null;
5567
Integer limit = 50;
@@ -72,9 +84,9 @@ public void listMessagesTest() throws ApiException {
7284
Basic.setUsername(BW_USERNAME);
7385
Basic.setPassword(BW_PASSWORD);
7486
MessagesList response = api.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus,
75-
messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort,
76-
pageToken,
77-
limit, false);
87+
messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, fromBwLatency,
88+
bwQueued, product, location, callingNumberCountryA3, calledNumberCountryA3, fromSegmentCount, toSegmentCount,
89+
fromMessageSize, toMessageSize, sort, pageToken, limit, false);
7890

7991
assertThat(response, instanceOf(MessagesList.class));
8092
assertThat(response.getTotalCount(), greaterThan(0));
@@ -99,9 +111,11 @@ public void listMessageBadRequestTest() {
99111
String pageToken = "gdEewhcJLQRB5"; // Bad Token
100112

101113
ApiException exception = Assertions.assertThrows(ApiException.class,
102-
() -> api.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection,
103-
carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort, pageToken,
104-
limit, false));
114+
() -> api.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus,
115+
messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime,
116+
campaignId, fromBwLatency, bwQueued, product, location, callingNumberCountryA3,
117+
calledNumberCountryA3, fromSegmentCount, toSegmentCount, fromMessageSize,
118+
toMessageSize, sort, pageToken, limit, false));
105119
assertThat(exception.getCode(), is(400));
106120

107121
}
@@ -113,9 +127,11 @@ public void listMessageUnauthorizedTest() {
113127
Basic.setPassword("bad_password");
114128

115129
ApiException exception = Assertions.assertThrows(ApiException.class,
116-
() -> api.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection,
117-
carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort, pageToken,
118-
limit, false));
130+
() -> api.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus,
131+
messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime,
132+
campaignId, fromBwLatency, bwQueued, product, location, callingNumberCountryA3,
133+
calledNumberCountryA3, fromSegmentCount, toSegmentCount, fromMessageSize,
134+
toMessageSize, sort, pageToken, limit, false));
119135
assertThat(exception.getCode(), is(401));
120136
}
121137

src/test/java/com/bandwidth/sdk/unit/api/MessagesApiTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void testCreateMessage() throws ApiException {
8383
public void testListMessages() throws ApiException {
8484
ApiResponse<MessagesList> response = api.listMessagesWithHttpInfo(
8585
BW_ACCOUNT_ID, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
86-
null);
86+
null, null, null, null, null, null, null, null, null, null, null);
8787

8888
assertThat(response.getStatusCode(), is(200));
8989
assertThat(response.getData(), instanceOf(MessagesList.class));
@@ -113,5 +113,10 @@ public void testListMessages() throws ApiException {
113113
assertThat(response.getData().getMessages().get(0).getRecipientCount(), instanceOf(Integer.class));
114114
assertThat(response.getData().getMessages().get(0).getCampaignClass(), instanceOf(String.class));
115115
assertThat(response.getData().getMessages().get(0).getCampaignId(), instanceOf(String.class));
116+
assertThat(response.getData().getMessages().get(0).getBwLatency(), instanceOf(Integer.class));
117+
assertThat(response.getData().getMessages().get(0).getCallingNumberCountryA3(), instanceOf(String.class));
118+
assertThat(response.getData().getMessages().get(0).getCalledNumberCountryA3(), instanceOf(String.class));
119+
assertThat(response.getData().getMessages().get(0).getProduct(), instanceOf(String.class));
120+
assertThat(response.getData().getMessages().get(0).getLocation(), instanceOf(String.class));
116121
}
117122
}

src/test/java/com/bandwidth/sdk/unit/models/ListMessageItemTest.java

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ public class ListMessageItemTest {
4444
.attachmentCount(10)
4545
.recipientCount(10)
4646
.campaignClass("campaignClass")
47-
.campaignId("campaignId");
47+
.campaignId("campaignId")
48+
.bwLatency(100)
49+
.callingNumberCountryA3("USA")
50+
.calledNumberCountryA3("USA")
51+
.product("product")
52+
.location("location");
4853

4954
/**
5055
* Model tests for ListMessageItem
@@ -190,4 +195,44 @@ public void campaignIdTest() {
190195
assertThat(model.getCampaignId(), instanceOf(String.class));
191196
}
192197

198+
/**
199+
* Test the property 'bwLatency'
200+
*/
201+
@Test
202+
public void bwLatencyTest() {
203+
assertThat(model.getBwLatency(), instanceOf(Integer.class));
204+
}
205+
206+
/**
207+
* Test the property 'callingNumberCountryA3'
208+
*/
209+
@Test
210+
public void callingNumberCountryA3Test() {
211+
assertThat(model.getCallingNumberCountryA3(), instanceOf(String.class));
212+
}
213+
214+
/**
215+
* Test the property 'calledNumberCountryA3'
216+
*/
217+
@Test
218+
public void calledNumberCountryA3Test() {
219+
assertThat(model.getCalledNumberCountryA3(), instanceOf(String.class));
220+
}
221+
222+
/**
223+
* Test the property 'product'
224+
*/
225+
@Test
226+
public void productTest() {
227+
assertThat(model.getProduct(), instanceOf(String.class));
228+
}
229+
230+
/**
231+
* Test the property 'location'
232+
*/
233+
@Test
234+
public void locationTest() {
235+
assertThat(model.getLocation(), instanceOf(String.class));
236+
}
237+
193238
}

src/test/java/com/bandwidth/sdk/unit/models/MessageTypeEnumTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class MessageTypeEnumTest {
3030
public void testMessageTypeEnum() {
3131
assertThat(MessageTypeEnum.SMS.toString(), equalTo("sms"));
3232
assertThat(MessageTypeEnum.MMS.toString(), equalTo("mms"));
33+
assertThat(MessageTypeEnum.RCS.toString(), equalTo("rcs"));
3334
}
3435

3536
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Bandwidth
3+
* Bandwidth's Communication APIs
4+
*
5+
* The version of the OpenAPI document: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
package com.bandwidth.sdk.unit.models;
14+
15+
import org.junit.jupiter.api.Test;
16+
17+
import com.bandwidth.sdk.model.ProductTypeEnum;
18+
19+
import static org.hamcrest.MatcherAssert.assertThat;
20+
import static org.hamcrest.CoreMatchers.equalTo;
21+
22+
/**
23+
* Model tests for ProductTypeEnum
24+
*/
25+
public class ProductTypeEnumTest {
26+
/**
27+
* Model tests for ProductTypeEnum
28+
*/
29+
@Test
30+
public void testPriorityEnum() {
31+
assertThat(ProductTypeEnum.LOCAL_A2_P.toString(), equalTo("LOCAL_A2P"));
32+
assertThat(ProductTypeEnum.P2_P.toString(), equalTo("P2P"));
33+
assertThat(ProductTypeEnum.SHORT_CODE_REACH.toString(), equalTo("SHORT_CODE_REACH"));
34+
assertThat(ProductTypeEnum.TOLL_FREE.toString(), equalTo("TOLL_FREE"));
35+
assertThat(ProductTypeEnum.HOSTED_SHORT_CODE.toString(), equalTo("HOSTED_SHORT_CODE"));
36+
assertThat(ProductTypeEnum.ALPHA_NUMERIC.toString(), equalTo("ALPHA_NUMERIC"));
37+
assertThat(ProductTypeEnum.RBM_MEDIA.toString(), equalTo("RBM_MEDIA"));
38+
assertThat(ProductTypeEnum.RBM_RICH.toString(), equalTo("RBM_RICH"));
39+
assertThat(ProductTypeEnum.RBM_CONVERSATIONAL.toString(), equalTo("RBM_CONVERSATIONAL"));
40+
}
41+
42+
}

0 commit comments

Comments
 (0)