Skip to content

SWI-2765 Fixing DldaOrder Response #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.bandwidth.sdk</groupId>
<artifactId>bandwidth-java-iris-sdk</artifactId>
<version>2.0.0</version>
<version>3.2.3</version>
<packaging>jar</packaging>
<name>bandwidth-java-iris-sdk</name>
<description>Java SDK for use with the IRIS API.</description>
Expand Down Expand Up @@ -193,6 +193,7 @@
</execution>
</executions>
<configuration>
<skip>true</skip>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/bandwidth/iris/sdk/model/DldaOrder.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
27 changes: 4 additions & 23 deletions src/test/java/com/bandwidth/iris/sdk/DldaOrderTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -43,4 +22,6 @@ public void testCreate2() throws Exception {
dldaTnGroup.setSubscriberType("BUSINESS");
assertEquals(dldaTnGroup.getSubscriberType(), "BUSINESS");
}


}