-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from CallFire/develop
Develop
- Loading branch information
Showing
42 changed files
with
1,166 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
group = com.callfire | ||
baseName = callfire-api-client | ||
version = 1.7.11 | ||
version = 1.7.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 81 additions & 17 deletions
98
src/itest/java/com/callfire/api/client/integration/contacts/DncApiTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,103 @@ | ||
package com.callfire.api.client.integration.contacts; | ||
|
||
import com.callfire.api.client.CallfireClient; | ||
import com.callfire.api.client.api.common.model.Page; | ||
import com.callfire.api.client.api.contacts.model.DoNotContact; | ||
import com.callfire.api.client.api.contacts.model.request.FindDncContactsRequest; | ||
import com.callfire.api.client.integration.AbstractIntegrationTest; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* integration tests for /contacts/dncs api endpoint | ||
*/ | ||
public class DncApiTest extends AbstractIntegrationTest { | ||
|
||
@Test | ||
// TODO vmalinovskiy: uncomment when dnc apis will be tested and available on docs site | ||
/*@Test | ||
public void testFind() throws Exception { | ||
FindDncContactsRequest request = FindDncContactsRequest.create() | ||
.textDnc(true) | ||
CallfireClient client = getCallfireClient(); | ||
FindDncNumbersRequest request = FindDncNumbersRequest.create() | ||
.text(true) | ||
.limit(1L) | ||
.numbers(Arrays.asList("12135551189")) | ||
.build(); | ||
CallfireClient client = getCallfireClient(); | ||
Page<DoNotContact> dncContacts = client.dncApi().find(request); | ||
System.out.println(dncContacts); | ||
Assert.assertEquals(1, dncContacts.getItems().size()); | ||
} | ||
@Test | ||
public void testUpdate() throws Exception { | ||
public void testCrudAndGetDnc() throws Exception { | ||
CallfireClient client = getCallfireClient(); | ||
CreateDncsRequest crRequest = CreateDncsRequest.create() | ||
.call(true) | ||
.text(true) | ||
.numbers(Arrays.asList("12135551188")) | ||
.source("testSource") | ||
.build(); | ||
client.dncApi().create(crRequest); | ||
DoNotContact dnc = client.dncApi().get("12135551188"); | ||
Assert.assertEquals(dnc.getNumber(), "12135551188"); | ||
Assert.assertEquals(dnc.getCall(), true); | ||
Assert.assertEquals(dnc.getText(), true); | ||
UpdateDncRequest updRequest = UpdateDncRequest.create() | ||
.call(true) | ||
.text(false) | ||
.number("12135551188") | ||
.build(); | ||
client.dncApi().update(updRequest); | ||
dnc = client.dncApi().get("12135551188"); | ||
Assert.assertEquals(dnc.getCall(), true); | ||
Assert.assertEquals(dnc.getText(), false); | ||
client.dncApi().delete("12135551188"); | ||
dnc = client.dncApi().get("12135551188"); | ||
Assert.assertEquals(dnc.getCall(), false); | ||
Assert.assertEquals(dnc.getText(), false); | ||
} | ||
@Test | ||
public void testDeleteDncsFromSource() throws Exception { | ||
CallfireClient client = getCallfireClient(); | ||
DoNotContact number = new DoNotContact(); | ||
number.setListId(2109601003L); | ||
number.setNumber("12234565432"); | ||
number.setCall(true); | ||
number.setText(true); | ||
client.dncApi().update(number); | ||
CreateDncsRequest crRequest = CreateDncsRequest.create() | ||
.call(true) | ||
.text(true) | ||
.numbers(Arrays.asList("12135551189")) | ||
.source("testSourceForDeleteDncs") | ||
.build(); | ||
client.dncApi().create(crRequest); | ||
FindDncNumbersRequest request = FindDncNumbersRequest.create() | ||
.source("testSourceForDeleteDncs") | ||
.build(); | ||
Page<DoNotContact> dncContacts = client.dncApi().find(request); | ||
Assert.assertTrue(dncContacts.getItems().size() > 0); | ||
client.dncApi().deleteDncsFromSource("testSourceForDeleteDncs"); | ||
dncContacts = client.dncApi().find(request); | ||
Assert.assertTrue(dncContacts.getItems().size() == 0); | ||
} | ||
@Test | ||
public void testFindUniversalDncs() throws Exception { | ||
CallfireClient client = getCallfireClient(); | ||
FindUniversalDncsRequest request = FindUniversalDncsRequest.create() | ||
.toNumber("12135551188") | ||
.fromNumber("18442800143") | ||
.build(); | ||
List<UniversalDnc> uDncs = client.dncApi().findUniversalDncs(request); | ||
Assert.assertEquals("18442800143", uDncs.get(0).getFromNumber()); | ||
Assert.assertEquals("12135551188", uDncs.get(0).getToNumber()); | ||
Assert.assertNotNull(uDncs.get(0).isInboundCall()); | ||
Assert.assertNotNull(uDncs.get(0).isOutboundCall()); | ||
Assert.assertNotNull(uDncs.get(0).isInboundText()); | ||
Assert.assertNotNull(uDncs.get(0).isOutboundText()); | ||
}*/ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.