Skip to content

Commit

Permalink
refactor (Mailgun/Email): Move to 'purgeSendingQueue' function name
Browse files Browse the repository at this point in the history
  • Loading branch information
JPPortier committed Dec 12, 2024
1 parent 210290b commit 1f6219f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ public interface EmailsService {

SendingQueuesStatusResponse getSendingQueuesStatus(String domain);

void purgeDomainQueues(String domainName, String storageURL);
void purgeSendingQueue(String domainName, String storageURL);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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");
}
}

0 comments on commit 1f6219f

Please sign in to comment.