diff --git a/client/src/main/com/sinch/sdk/domains/mailgun/api/v1/EmailsService.java b/client/src/main/com/sinch/sdk/domains/mailgun/api/v1/EmailsService.java index 1f2971f1..bde9ff95 100644 --- a/client/src/main/com/sinch/sdk/domains/mailgun/api/v1/EmailsService.java +++ b/client/src/main/com/sinch/sdk/domains/mailgun/api/v1/EmailsService.java @@ -22,5 +22,5 @@ public interface EmailsService { SendingQueuesStatusResponse getSendingQueuesStatus(String domain); - void purgeDomainQueues(String domainName, String storageURL); + void purgeSendingQueue(String domainName, String storageURL); } diff --git a/client/src/main/com/sinch/sdk/domains/mailgun/api/v1/adapters/EmailsService.java b/client/src/main/com/sinch/sdk/domains/mailgun/api/v1/adapters/EmailsService.java index 0ae9f6cb..2979031c 100644 --- a/client/src/main/com/sinch/sdk/domains/mailgun/api/v1/adapters/EmailsService.java +++ b/client/src/main/com/sinch/sdk/domains/mailgun/api/v1/adapters/EmailsService.java @@ -41,7 +41,7 @@ public SendingQueuesStatusResponse getSendingQueuesStatus(String domain) { return getApi().getSendingQueuesStatus(domain); } - public void purgeDomainQueues(String domainName, String storageURL) { - getApi().purgeDomainQueues(domainName, storageURL); + public void purgeSendingQueue(String domainName, String storageURL) { + getApi().purgeSendingQueue(domainName, storageURL); } } diff --git a/client/src/test/java/com/sinch/sdk/domains/mailgun/api/v1/adapters/EmailsServiceTest.java b/client/src/test/java/com/sinch/sdk/domains/mailgun/api/v1/adapters/EmailsServiceTest.java index 660f5bf7..36d61a76 100644 --- a/client/src/test/java/com/sinch/sdk/domains/mailgun/api/v1/adapters/EmailsServiceTest.java +++ b/client/src/test/java/com/sinch/sdk/domains/mailgun/api/v1/adapters/EmailsServiceTest.java @@ -94,11 +94,11 @@ void getSendingQueuesStatus() { } @Test - void purgeDomainQueues() { + void purgeSendingQueue() { - service.purgeDomainQueues(domainName, "my foo URL"); + service.purgeSendingQueue(domainName, "my foo URL"); - verify(api).purgeDomainQueues(domainNameCaptor.capture(), storageUrlCapture.capture()); + verify(api).purgeSendingQueue(domainNameCaptor.capture(), storageUrlCapture.capture()); Assertions.assertThat(domainNameCaptor.getValue()).isEqualTo(domainName); Assertions.assertThat(storageUrlCapture.getValue()).isEqualTo("my foo URL"); diff --git a/client/src/test/java/com/sinch/sdk/e2e/domains/mailgun/v1/EmailsSteps.java b/client/src/test/java/com/sinch/sdk/e2e/domains/mailgun/v1/EmailsSteps.java index 9454dfc9..0a1bf652 100644 --- a/client/src/test/java/com/sinch/sdk/e2e/domains/mailgun/v1/EmailsSteps.java +++ b/client/src/test/java/com/sinch/sdk/e2e/domains/mailgun/v1/EmailsSteps.java @@ -89,7 +89,7 @@ public void getSendingQueuesStatus() { @When("^I send a request to purge the domain queues$") public void purgeDomainQueues() { - service.purgeDomainQueues(domainName, Config.MAILGUN_STORAGE); + service.purgeSendingQueue(domainName, Config.MAILGUN_STORAGE); purgeDomainQueuesPassed = true; } diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/mailgun/api/v1/internal/EmailsApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/mailgun/api/v1/internal/EmailsApi.java index 41c9999b..b0634dc2 100644 --- a/openapi-contracts/src/main/com/sinch/sdk/domains/mailgun/api/v1/internal/EmailsApi.java +++ b/openapi-contracts/src/main/com/sinch/sdk/domains/mailgun/api/v1/internal/EmailsApi.java @@ -354,10 +354,10 @@ private HttpRequest sendMimeEmailRequestBuilder( * @return GenericResponse * @throws ApiException if fails to make API call */ - public void purgeDomainQueues(String domainName, String storageURL) throws ApiException { + public void purgeSendingQueue(String domainName, String storageURL) throws ApiException { LOGGER.finest( - "[purgeDomainQueues]" + "[purgeSendingQueue]" + " " + "domainName: " + domainName diff --git a/sample-app/src/main/java/com/sinch/sample/mailgun/messages/PurgeDomainQueues.java b/sample-app/src/main/java/com/sinch/sample/mailgun/messages/PurgeSendingQueue.java similarity index 63% rename from sample-app/src/main/java/com/sinch/sample/mailgun/messages/PurgeDomainQueues.java rename to sample-app/src/main/java/com/sinch/sample/mailgun/messages/PurgeSendingQueue.java index b9f0fc0b..70750701 100644 --- a/sample-app/src/main/java/com/sinch/sample/mailgun/messages/PurgeDomainQueues.java +++ b/sample-app/src/main/java/com/sinch/sample/mailgun/messages/PurgeSendingQueue.java @@ -5,15 +5,15 @@ import java.io.IOException; import java.util.logging.Logger; -public class PurgeDomainQueues extends BaseApplication { +public class PurgeSendingQueue extends BaseApplication { - private static final Logger LOGGER = Logger.getLogger(PurgeDomainQueues.class.getName()); + private static final Logger LOGGER = Logger.getLogger(PurgeSendingQueue.class.getName()); - public PurgeDomainQueues() throws IOException {} + public PurgeSendingQueue() throws IOException {} public static void main(String[] args) { try { - new PurgeDomainQueues().run(); + new PurgeSendingQueue().run(); } catch (Exception e) { LOGGER.severe(e.getMessage()); e.printStackTrace(); @@ -26,6 +26,6 @@ public void run() { LOGGER.info("Purge domain: " + mailgunDomain); - service.purgeDomainQueues(mailgunDomain, "https://storage-us-east4.api.mailgun.net"); + service.purgeSendingQueue(mailgunDomain, "https://storage-us-east4.api.mailgun.net"); } }