From b758d7ff39201a80850b40fc2c618f18e8dc3ae3 Mon Sep 17 00:00:00 2001 From: Jake Wang Date: Thu, 17 Oct 2024 12:06:43 -0500 Subject: [PATCH 1/2] Force Local Time to UTC avoiding converting to local time in output --- .../unittest/TransactionIndustryRequestTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/java/com/braintreegateway/unittest/TransactionIndustryRequestTest.java b/src/test/java/com/braintreegateway/unittest/TransactionIndustryRequestTest.java index 28e3e827..a9d53db7 100644 --- a/src/test/java/com/braintreegateway/unittest/TransactionIndustryRequestTest.java +++ b/src/test/java/com/braintreegateway/unittest/TransactionIndustryRequestTest.java @@ -2,6 +2,7 @@ import java.io.IOException; import java.util.Calendar; +import java.util.TimeZone; import com.braintreegateway.TransactionRequest; import com.braintreegateway.TransactionIndustryRequest; @@ -21,6 +22,7 @@ public void toXMLIncludesAllElements() throws IOException, SAXException { TransactionIndustryRequest request = new TransactionIndustryRequest(txnRequest); Calendar arrivalDate = Calendar.getInstance(); + arrivalDate.setTimeZone(TimeZone.getTimeZone("UTC")); arrivalDate.set(2023, Calendar.FEBRUARY, 10, 22, 45, 30); request.industryType(Transaction.IndustryType.TRAVEL_FLIGHT) From 3879c6971418eb1d3f38c26f36d680bcc5c2314d Mon Sep 17 00:00:00 2001 From: Jake Wang Date: Thu, 17 Oct 2024 12:19:17 -0500 Subject: [PATCH 2/2] another Force Local Time to UTC avoiding converting to local time in output --- .../unittest/ThreeDSecureLookupRequestTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/java/com/braintreegateway/unittest/ThreeDSecureLookupRequestTest.java b/src/test/java/com/braintreegateway/unittest/ThreeDSecureLookupRequestTest.java index 72672b02..b65632aa 100644 --- a/src/test/java/com/braintreegateway/unittest/ThreeDSecureLookupRequestTest.java +++ b/src/test/java/com/braintreegateway/unittest/ThreeDSecureLookupRequestTest.java @@ -10,6 +10,7 @@ import java.util.Map; import com.fasterxml.jackson.jr.ob.JSON; import java.util.Calendar; +import java.util.TimeZone; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; @@ -214,6 +215,7 @@ public void serializesPriorAuthenticationDetails() { "}"; Calendar authTime = Calendar.getInstance(); + authTime.setTimeZone(TimeZone.getTimeZone("UTC")); authTime.set(2024, Calendar.FEBRUARY, 10, 22, 45, 30); ThreeDSecureLookupPriorAuthenticationDetails priorAuthenticationDetails = new ThreeDSecureLookupPriorAuthenticationDetails()