Skip to content

Commit 7670ca7

Browse files
Removing unnecessary adapters
1 parent 54e50b3 commit 7670ca7

File tree

7 files changed

+7
-56
lines changed

7 files changed

+7
-56
lines changed

src/main/java/org/openapitools/client/model/bxml/adapter/DiversionReasonAdapter.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/main/java/org/openapitools/client/model/bxml/adapter/DiversionTreatmentAdapter.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/main/java/org/openapitools/client/model/bxml/package-info.java

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/test/java/org/openapitools/client/model/unit/bxml/BxmlVerbTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ public void withVerbsWorks() {
6666
@Test
6767
public void toBxmlWithDiversionWorks() throws JAXBException {
6868
jaxbContext = JAXBContext.newInstance(Bxml.class);
69+
String expectedBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Forward callTimeout=\"300.0\" diversionTreatment=\"NONE\" diversionReason=\"DO_NOT_DISTURB\"/></Bxml>";
6970
Bxml bxml = new Bxml().with(Forward.builder()
7071
.diversionReason(DiversionReason.DO_NOT_DISTURB)
7172
.build());
72-
assertThat(bxml.toBxml(jaxbContext),
73-
containsString("diversionReason=\"do-not-disturb\""));
73+
assertThat(bxml.toBxml(jaxbContext), is(expectedBxml));
7474
}
75-
7675
};

src/test/java/org/openapitools/client/model/unit/bxml/ForwardVerbTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class ForwardVerbTest {
3838
@Test
3939
public void forwardVerbWorks() throws JAXBException {
4040
jaxbContext = JAXBContext.newInstance(Bxml.class);
41-
String expectedBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Forward to=\"+19195554321\" from=\"19195554322\" uui=\"93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt\" callTimeout=\"15.0\" diversionTreatment=\"propagate\" diversionReason=\"away\"/></Bxml>";
41+
String expectedBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Forward to=\"+19195554321\" from=\"19195554322\" uui=\"93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt\" callTimeout=\"15.0\" diversionTreatment=\"PROPAGATE\" diversionReason=\"AWAY\"/></Bxml>";
4242

4343
assertThat(new Bxml().with(forward).toBxml(jaxbContext), is(expectedBxml));
4444
}

src/test/java/org/openapitools/client/model/unit/bxml/ResponseVerbTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ public void withVerbsWorks() {
6666
@Test
6767
public void toBxmlWithDiversionWorks() throws JAXBException {
6868
jaxbContext = JAXBContext.newInstance(Response.class);
69+
String expectedBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Response><Forward callTimeout=\"300.0\" diversionTreatment=\"NONE\" diversionReason=\"DO_NOT_DISTURB\"/></Response>";
6970
Response response = new Response().with(Forward.builder()
7071
.diversionReason(DiversionReason.DO_NOT_DISTURB)
7172
.build());
72-
assertThat(response.toBxml(jaxbContext),
73-
containsString("diversionReason=\"do-not-disturb\""));
73+
assertThat(response.toBxml(jaxbContext), is(expectedBxml));
7474
}
7575

7676
};

src/test/java/org/openapitools/client/model/unit/bxml/TransferVerbTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public class TransferVerbTest {
5757
@Test
5858
public void transferVerbWorks() throws JAXBException {
5959
jaxbContext = JAXBContext.newInstance(Bxml.class);
60-
String expectedSipUriBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Transfer transferCallerId=\"+19195554321\" callTimeout=\"15.0\" transferCompleteMethod=\"POST\" transferCompleteFallbackMethod=\"POST\" tag=\"test\" diversionTreatment=\"none\" diversionReason=\"unknown\"><SipUri uui=\"test\" transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\">[email protected]</SipUri></Transfer></Bxml>";
61-
String expectedPhoneNumberBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Transfer transferCallerId=\"+19195554321\" callTimeout=\"15.0\" transferCompleteMethod=\"POST\" transferCompleteFallbackMethod=\"POST\" tag=\"test\" diversionTreatment=\"none\" diversionReason=\"unknown\"><PhoneNumber transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\">+19195551234</PhoneNumber></Transfer></Bxml>";
60+
String expectedSipUriBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Transfer transferCallerId=\"+19195554321\" callTimeout=\"15.0\" transferCompleteMethod=\"POST\" transferCompleteFallbackMethod=\"POST\" tag=\"test\" diversionTreatment=\"NONE\" diversionReason=\"UNKNOWN\"><SipUri uui=\"test\" transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\">[email protected]</SipUri></Transfer></Bxml>";
61+
String expectedPhoneNumberBxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Bxml><Transfer transferCallerId=\"+19195554321\" callTimeout=\"15.0\" transferCompleteMethod=\"POST\" transferCompleteFallbackMethod=\"POST\" tag=\"test\" diversionTreatment=\"NONE\" diversionReason=\"UNKNOWN\"><PhoneNumber transferAnswerUrl=\"https://example.com/webhooks/transfer_answer\" transferAnswerMethod=\"POST\" transferAnswerFallbackMethod=\"POST\" transferDisconnectMethod=\"POST\" tag=\"test\">+19195551234</PhoneNumber></Transfer></Bxml>";
6262

6363
assertThat(new Bxml().with(transfer1).toBxml(jaxbContext), is(expectedSipUriBxml));
6464
assertThat(new Bxml().with(transfer2).toBxml(jaxbContext), is(expectedPhoneNumberBxml));

0 commit comments

Comments
 (0)