Skip to content

Commit 2d184a0

Browse files
committed
add unit tests for new models
1 parent 226079c commit 2d184a0

15 files changed

+1235
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
14+
package com.bandwidth.sdk.unit.models;
15+
16+
import org.junit.jupiter.api.Test;
17+
18+
import com.bandwidth.sdk.model.Callback;
19+
import com.bandwidth.sdk.model.InboundCallback;
20+
import com.bandwidth.sdk.model.StatusCallback;
21+
22+
import static org.hamcrest.MatcherAssert.assertThat;
23+
import static org.hamcrest.CoreMatchers.instanceOf;
24+
25+
/**
26+
* Model tests for Callback
27+
*/
28+
public class CallbackTest {
29+
private final Callback modelInboundCallback = new Callback(new InboundCallback());
30+
private final Callback modelStatusCallback = new Callback(new StatusCallback());
31+
32+
/**
33+
* Model tests for Callback
34+
*/
35+
@Test
36+
public void testCallback() {
37+
assertThat(modelStatusCallback, instanceOf(Callback.class));
38+
assertThat(modelStatusCallback.getActualInstance(), instanceOf(StatusCallback.class));
39+
assertThat(modelInboundCallback, instanceOf(Callback.class));
40+
assertThat(modelInboundCallback.getActualInstance(), instanceOf(InboundCallback.class));
41+
42+
}
43+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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+
14+
package com.bandwidth.sdk.unit.models;
15+
16+
import org.junit.jupiter.api.Test;
17+
18+
import com.bandwidth.sdk.model.ErrorSource;
19+
20+
import static org.hamcrest.CoreMatchers.instanceOf;
21+
import static org.hamcrest.MatcherAssert.assertThat;
22+
23+
/**
24+
* Model tests for ErrorSource
25+
*/
26+
public class ErrorSourceTest {
27+
private final ErrorSource model = new ErrorSource()
28+
.parameter("parameter")
29+
.field("field")
30+
.header("header")
31+
.reference("reference");
32+
33+
/**
34+
* Model tests for ErrorSource
35+
*/
36+
@Test
37+
public void testErrorSource() {
38+
assertThat(model, instanceOf(ErrorSource.class));
39+
}
40+
41+
/**
42+
* Test the property 'parameter'
43+
*/
44+
@Test
45+
public void parameterTest() {
46+
assertThat(model.getParameter(), instanceOf(String.class));
47+
}
48+
49+
/**
50+
* Test the property 'field'
51+
*/
52+
@Test
53+
public void fieldTest() {
54+
assertThat(model.getField(), instanceOf(String.class));
55+
}
56+
57+
/**
58+
* Test the property 'header'
59+
*/
60+
@Test
61+
public void headerTest() {
62+
assertThat(model.getHeader(), instanceOf(String.class));
63+
}
64+
65+
/**
66+
* Test the property 'reference'
67+
*/
68+
@Test
69+
public void referenceTest() {
70+
assertThat(model.getReference(), instanceOf(String.class));
71+
}
72+
73+
}
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
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+
14+
package com.bandwidth.sdk.unit.models;
15+
16+
import org.junit.jupiter.api.Test;
17+
import org.mockito.internal.util.collections.Sets;
18+
19+
import java.time.OffsetDateTime;
20+
import java.util.ArrayList;
21+
import java.util.LinkedHashSet;
22+
import com.bandwidth.sdk.model.InboundCallbackMessage;
23+
import com.bandwidth.sdk.model.MessageDirectionEnum;
24+
import com.bandwidth.sdk.model.MultiChannelMessageChannelEnum;
25+
import com.bandwidth.sdk.model.MultiChannelMessageContent;
26+
import com.bandwidth.sdk.model.PriorityEnum;
27+
import com.bandwidth.sdk.model.RbmLocationResponse;
28+
import com.bandwidth.sdk.model.RbmSuggestionResponse;
29+
30+
import static org.hamcrest.CoreMatchers.instanceOf;
31+
import static org.hamcrest.MatcherAssert.assertThat;
32+
33+
/**
34+
* Model tests for InboundCallbackMessage
35+
*/
36+
public class InboundCallbackMessageTest {
37+
private final InboundCallbackMessage model = new InboundCallbackMessage()
38+
.id("id")
39+
.owner("owner")
40+
.applicationId("applicationId")
41+
.time(OffsetDateTime.now())
42+
.segmentCount(1)
43+
.direction(MessageDirectionEnum.IN)
44+
.to(Sets.newSet("to"))
45+
.from("from")
46+
.text("text")
47+
.tag("tag")
48+
.media(new ArrayList<>())
49+
.priority(PriorityEnum.DEFAULT)
50+
.channel(MultiChannelMessageChannelEnum.SMS)
51+
.content(new MultiChannelMessageContent())
52+
.suggestionResponse(new RbmSuggestionResponse())
53+
.locationResponse(new RbmLocationResponse());
54+
55+
/**
56+
* Model tests for InboundCallbackMessage
57+
*/
58+
@Test
59+
public void testInboundCallbackMessage() {
60+
assertThat(model, instanceOf(InboundCallbackMessage.class));
61+
}
62+
63+
/**
64+
* Test the property 'id'
65+
*/
66+
@Test
67+
public void idTest() {
68+
assertThat(model.getId(), instanceOf(String.class));
69+
}
70+
71+
/**
72+
* Test the property 'owner'
73+
*/
74+
@Test
75+
public void ownerTest() {
76+
assertThat(model.getOwner(), instanceOf(String.class));
77+
}
78+
79+
/**
80+
* Test the property 'applicationId'
81+
*/
82+
@Test
83+
public void applicationIdTest() {
84+
assertThat(model.getApplicationId(), instanceOf(String.class));
85+
}
86+
87+
/**
88+
* Test the property 'time'
89+
*/
90+
@Test
91+
public void timeTest() {
92+
assertThat(model.getTime(), instanceOf(OffsetDateTime.class));
93+
}
94+
95+
/**
96+
* Test the property 'segmentCount'
97+
*/
98+
@Test
99+
public void segmentCountTest() {
100+
assertThat(model.getSegmentCount(), instanceOf(Integer.class));
101+
}
102+
103+
/**
104+
* Test the property 'direction'
105+
*/
106+
@Test
107+
public void directionTest() {
108+
assertThat(model.getDirection(), instanceOf(MessageDirectionEnum.class));
109+
}
110+
111+
/**
112+
* Test the property 'to'
113+
*/
114+
@Test
115+
public void toTest() {
116+
assertThat(model.getTo(), instanceOf(LinkedHashSet.class));
117+
}
118+
119+
/**
120+
* Test the property 'from'
121+
*/
122+
@Test
123+
public void fromTest() {
124+
assertThat(model.getFrom(), instanceOf(String.class));
125+
}
126+
127+
/**
128+
* Test the property 'text'
129+
*/
130+
@Test
131+
public void textTest() {
132+
assertThat(model.getText(), instanceOf(String.class));
133+
}
134+
135+
/**
136+
* Test the property 'tag'
137+
*/
138+
@Test
139+
public void tagTest() {
140+
141+
}
142+
143+
/**
144+
* Test the property 'media'
145+
*/
146+
@Test
147+
public void mediaTest() {
148+
assertThat(model.getMedia(), instanceOf(ArrayList.class));
149+
}
150+
151+
/**
152+
* Test the property 'priority'
153+
*/
154+
@Test
155+
public void priorityTest() {
156+
assertThat(model.getPriority(), instanceOf(PriorityEnum.class));
157+
}
158+
159+
/**
160+
* Test the property 'channel'
161+
*/
162+
@Test
163+
public void channelTest() {
164+
assertThat(model.getChannel(), instanceOf(MultiChannelMessageChannelEnum.class));
165+
}
166+
167+
/**
168+
* Test the property 'content'
169+
*/
170+
@Test
171+
public void contentTest() {
172+
assertThat(model.getContent(), instanceOf(MultiChannelMessageContent.class));
173+
}
174+
175+
/**
176+
* Test the property 'suggestionResponse'
177+
*/
178+
@Test
179+
public void suggestionResponseTest() {
180+
assertThat(model.getSuggestionResponse(), instanceOf(RbmSuggestionResponse.class));
181+
}
182+
183+
/**
184+
* Test the property 'locationResponse'
185+
*/
186+
@Test
187+
public void locationResponseTest() {
188+
assertThat(model.getLocationResponse(), instanceOf(RbmLocationResponse.class));
189+
}
190+
191+
}

0 commit comments

Comments
 (0)