Skip to content

Commit

Permalink
refactor (Mailgun) SDK adaptation
Browse files Browse the repository at this point in the history
  • Loading branch information
JPPortier committed Dec 17, 2024
1 parent ef1127d commit 2ebed1e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import com.sinch.sdk.domains.mailgun.api.v1.EmailsService;
import com.sinch.sdk.domains.mailgun.models.v1.emails.request.SendEmailRequest;
import com.sinch.sdk.domains.mailgun.models.v1.emails.request.SendMimeEmailRequest;
import com.sinch.sdk.domains.mailgun.models.v1.emails.response.ExceededQueueQuotaRegular;
import com.sinch.sdk.domains.mailgun.models.v1.emails.response.ExceededQueueQuotaScheduled;
import com.sinch.sdk.domains.mailgun.models.v1.emails.response.ExceededQueueQuota;
import com.sinch.sdk.domains.mailgun.models.v1.emails.response.GetStoredEmailResponse;
import com.sinch.sdk.domains.mailgun.models.v1.emails.response.QueueStatusDisabledDetails;
import com.sinch.sdk.domains.mailgun.models.v1.emails.response.SendEmailResponse;
Expand Down Expand Up @@ -160,15 +159,15 @@ public void getSendingQueuesStatusResult() {
SendingQueuesStatusResponse expected =
SendingQueuesStatusResponse.builder()
.setRegular(
ExceededQueueQuotaRegular.builder()
ExceededQueueQuota.builder()
.setIsDisabled(false)
.setDisabled(
.setDetails(
QueueStatusDisabledDetails.builder().setUntil("").setReason("").build())
.build())
.setScheduled(
ExceededQueueQuotaScheduled.builder()
ExceededQueueQuota.builder()
.setIsDisabled(false)
.setDisabled(
.setDetails(
QueueStatusDisabledDetails.builder().setUntil("").setReason("").build())
.build())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.sinch.sdk.core.http.HttpMapper;
import com.sinch.sdk.domains.mailgun.models.v1.emails.request.SendEmailRequest.TrackingClicksEnum;
import com.sinch.sdk.domains.mailgun.models.v1.emails.request.SendEmailRequest.TrackingEnum;
import com.sinch.sdk.domains.mailgun.models.v1.emails.request.SendEmailRequest.TrackingPixelLocationTopEnum;
import java.io.File;
import java.time.Instant;
import java.util.Arrays;
Expand Down Expand Up @@ -61,7 +62,7 @@ public class SendEmailRequestTest extends BaseTest {
"o:skip-verification","true",
"o:sending-ip","192.168.0.10",
"o:sending-ip-pool","sending pool ID",
"o:tracking-pixel-location-top","foo",
"o:tracking-pixel-location-top","htmlonly",
"recipient-variables","{\"[email protected]\": {\"variable1\": \"value1\"}}"
// spotless:on
);
Expand Down Expand Up @@ -97,7 +98,7 @@ public class SendEmailRequestTest extends BaseTest {
.setSkipVerification(true)
.setSendingIp("192.168.0.10")
.setSendingIpPool("sending pool ID")
.setTrackingPixelLocationTop("foo")
.setTrackingPixelLocationTop(TrackingPixelLocationTopEnum.HTMLONLY)
.setRecipientVariables("{\"[email protected]\": {\"variable1\": \"value1\"}}")
.setTemplate("template value")
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.sinch.sdk.core.databind.multipart.ObjectMapperTest;
import com.sinch.sdk.core.http.HttpMapper;
import com.sinch.sdk.domains.mailgun.models.v1.emails.request.SendMimeEmailRequest.TrackingClicksEnum;
import com.sinch.sdk.domains.mailgun.models.v1.emails.request.SendMimeEmailRequest.TrackingPixelLocationTopEnum;
import java.io.File;
import java.time.Instant;
import java.util.Arrays;
Expand Down Expand Up @@ -52,7 +53,7 @@ public class SendMimeEmailRequestTest extends BaseTest {
"o:skip-verification","false",
"o:sending-ip","192.168.0.10",
"o:sending-ip-pool","sending pool ID",
"o:tracking-pixel-location-top","foo",
"o:tracking-pixel-location-top","htmlonly",
"recipient-variables","{\"[email protected]\": {\"variable1\": \"value1\"}}"
// spotless:on
);
Expand Down Expand Up @@ -80,7 +81,7 @@ public class SendMimeEmailRequestTest extends BaseTest {
.setSkipVerification(false)
.setSendingIp("192.168.0.10")
.setSendingIpPool("sending pool ID")
.setTrackingPixelLocationTop("foo")
.setTrackingPixelLocationTop(TrackingPixelLocationTopEnum.HTMLONLY)
.setRecipientVariables("{\"[email protected]\": {\"variable1\": \"value1\"}}")
.setTemplate("template value")
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ public class SendingQueuesStatusResponseTest extends BaseTest {
public static SendingQueuesStatusResponse expectedSendingQueuesStatusResponse =
SendingQueuesStatusResponse.builder()
.setRegular(
ExceededQueueQuotaRegular.builder()
ExceededQueueQuota.builder()
.setIsDisabled(true)
.setDisabled(
.setDetails(
QueueStatusDisabledDetails.builder()
.setUntil("Mon, 24 Jan 2006 16:00:00 MST")
.setReason("You have too many messages in regular queue")
.build())
.build())
.setScheduled(
ExceededQueueQuotaScheduled.builder()
ExceededQueueQuota.builder()
.setIsDisabled(true)
.setDisabled(
.setDetails(
QueueStatusDisabledDetails.builder()
.setUntil("Mon, 12 Jan 2006 15:04:05 MST")
.setReason("You have too many messages in scheduled queue")
Expand Down

0 comments on commit 2ebed1e

Please sign in to comment.