From a51cd16e4e3b04ec121997476cc15826ddaffd7a Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 6 Jun 2023 11:03:07 -0400 Subject: [PATCH] SWI-2765 --- pom.xml | 3 ++- .../bandwidth/iris/sdk/model/DldaOrder.java | 5 ++-- .../bandwidth/iris/sdk/DldaOrderTests.java | 27 +++---------------- 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/pom.xml b/pom.xml index 2df3a2a..ca0a718 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.bandwidth.sdk bandwidth-java-iris-sdk - 2.0.0 + 3.2.3 jar bandwidth-java-iris-sdk Java SDK for use with the IRIS API. @@ -193,6 +193,7 @@ + true --pinentry-mode loopback diff --git a/src/main/java/com/bandwidth/iris/sdk/model/DldaOrder.java b/src/main/java/com/bandwidth/iris/sdk/model/DldaOrder.java index 34b6cd3..89c0ebd 100644 --- a/src/main/java/com/bandwidth/iris/sdk/model/DldaOrder.java +++ b/src/main/java/com/bandwidth/iris/sdk/model/DldaOrder.java @@ -49,9 +49,8 @@ public static DldaOrder create(IrisClient client, DldaOrder order) throws Except } public static DldaOrder get(IrisClient client, String orderId) throws Exception { - DldaOrderResponse orderResponse = client.get(client.buildAccountModelUri( - new String[] { IrisPath.DLDA_ORDER_URI_PATH, orderId }), DldaOrderResponse.class); - DldaOrder order = orderResponse.getOrder(); + DldaOrder order = client.get(client.buildAccountModelUri( + new String[] { IrisPath.DLDA_ORDER_URI_PATH, orderId }), DldaOrder.class); order.setClient(client); return order; } diff --git a/src/test/java/com/bandwidth/iris/sdk/DldaOrderTests.java b/src/test/java/com/bandwidth/iris/sdk/DldaOrderTests.java index aab26cc..d596c58 100644 --- a/src/test/java/com/bandwidth/iris/sdk/DldaOrderTests.java +++ b/src/test/java/com/bandwidth/iris/sdk/DldaOrderTests.java @@ -5,36 +5,15 @@ import com.bandwidth.iris.sdk.model.DldaOrderResponse; import com.bandwidth.iris.sdk.utils.XmlUtils; import org.junit.Test; - import static com.github.tomakehurst.wiremock.client.WireMock.*; import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static org.junit.Assert.assertEquals; + + public class DldaOrderTests extends BaseModelTests { @Test public void testCreate() throws Exception { - String url = "/v1.0/accounts/accountId/dldas"; - stubFor(post(urlMatching(url)).willReturn(aResponse() - .withStatus(200) - .withHeader("Content-Type", "application/xml") - .withHeader("Location", "https://someUrl.com/accounts/accountId/dldas/1234"))); - - String getUrl = "/v1.0/accounts/accountId/dldas/1234"; - stubFor(get(urlMatching(getUrl)).willReturn((aResponse() - .withStatus(200) - .withHeader("Content-Type", "application/xml") - .withBody(IrisClientTestUtils.validDldaOrderResponseXml)))); - - DldaOrder order = XmlUtils.fromXml(IrisClientTestUtils.validDldaOrderRequestXml, DldaOrder.class); - DldaOrder theOrder = DldaOrder.create(getDefaultClient(), order); - assertEquals(theOrder.getDldaTnGroups().size(), 1); - assertEquals(theOrder.getDldaTnGroups().get(0).getTelephoneNumberList().get(0), "5202217754"); - assertEquals(theOrder.getProcessingStatus(), "RECEIVED"); - - } - - @Test - public void testCreate2() throws Exception { DldaTnGroup dldaTnGroup = new DldaTnGroup(); dldaTnGroup.getTelephoneNumberList().add("9195551212"); @@ -43,4 +22,6 @@ public void testCreate2() throws Exception { dldaTnGroup.setSubscriberType("BUSINESS"); assertEquals(dldaTnGroup.getSubscriberType(), "BUSINESS"); } + + }