5
5
import com .bandwidth .iris .sdk .model .DldaOrderResponse ;
6
6
import com .bandwidth .iris .sdk .utils .XmlUtils ;
7
7
import org .junit .Test ;
8
-
9
8
import static com .github .tomakehurst .wiremock .client .WireMock .*;
10
9
import static com .github .tomakehurst .wiremock .client .WireMock .aResponse ;
11
10
import static org .junit .Assert .assertEquals ;
12
11
12
+
13
+
13
14
public class DldaOrderTests extends BaseModelTests {
14
15
@ Test
15
16
public void testCreate () throws Exception {
16
- String url = "/v1.0/accounts/accountId/dldas" ;
17
- stubFor (post (urlMatching (url )).willReturn (aResponse ()
18
- .withStatus (200 )
19
- .withHeader ("Content-Type" , "application/xml" )
20
- .withHeader ("Location" , "https://someUrl.com/accounts/accountId/dldas/1234" )));
21
-
22
- String getUrl = "/v1.0/accounts/accountId/dldas/1234" ;
23
- stubFor (get (urlMatching (getUrl )).willReturn ((aResponse ()
24
- .withStatus (200 )
25
- .withHeader ("Content-Type" , "application/xml" )
26
- .withBody (IrisClientTestUtils .validDldaOrderResponseXml ))));
27
-
28
- DldaOrder order = XmlUtils .fromXml (IrisClientTestUtils .validDldaOrderRequestXml , DldaOrder .class );
29
- DldaOrder theOrder = DldaOrder .create (getDefaultClient (), order );
30
- assertEquals (theOrder .getDldaTnGroups ().size (), 1 );
31
- assertEquals (theOrder .getDldaTnGroups ().get (0 ).getTelephoneNumberList ().get (0 ), "5202217754" );
32
- assertEquals (theOrder .getProcessingStatus (), "RECEIVED" );
33
-
34
- }
35
-
36
- @ Test
37
- public void testCreate2 () throws Exception {
38
17
39
18
DldaTnGroup dldaTnGroup = new DldaTnGroup ();
40
19
dldaTnGroup .getTelephoneNumberList ().add ("9195551212" );
@@ -43,4 +22,6 @@ public void testCreate2() throws Exception {
43
22
dldaTnGroup .setSubscriberType ("BUSINESS" );
44
23
assertEquals (dldaTnGroup .getSubscriberType (), "BUSINESS" );
45
24
}
25
+
26
+
46
27
}
0 commit comments