// Path: src/test/java/com/cardinity/CardinityBaseTest.java
// public abstract class CardinityBaseTest {
// 
//     protected final static SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
//     protected final static SimpleDateFormat formatterWithMillis = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
//     protected final static SimpleDateFormat formatterWithMillisEET = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
// 
//     static {
//         formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
//         formatterWithMillis.setTimeZone(TimeZone.getTimeZone("UTC"));
//         formatterWithMillisEET.setTimeZone(TimeZone.getTimeZone("EET"));
//     }
// 
//     protected String resource(String path) throws IOException {
// 
//         InputStream resource = getClass().getResourceAsStream(path);
// 
//         ByteArrayOutputStream os = new ByteArrayOutputStream(1024);
//         byte[] buf = new byte[1024];
// 
//         for (int i = resource.read(buf); i > 0; i = resource.read(buf)) {
//             os.write(buf, 0, i);
//         }
// 
//         return os.toString(Cardinity.ENCODING_CHARSET);
// 
//     }
// }
// 
// Path: src/main/java/com/cardinity/rest/RestResource.java
// public abstract class RestResource {
// 
//     // @formatter:off
//     public static final Gson GSON = new GsonBuilder()
//             .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
//             .registerTypeAdapter(Payment.class, new PaymentDeserializer())
//             .registerTypeAdapter(Card.class, new CardSerializer())
//             .registerTypeAdapter(Date.class, new UtcDateTypeAdapter())
//             .create();
//     // @formatter:on
// 
// 
//     public enum RequestMethod {
//         GET, PATCH, POST
//     }
// 
//     public enum Resource {
//         PAYMENTS, REFUNDS, SETTLEMENTS, VOIDS, CHARGEBACKS
//     }
// 
// }


import com.cardinity.CardinityBaseTest;
import com.cardinity.rest.RestResource;
import org.junit.Test;
import java.io.IOException;
import java.math.BigDecimal;
import static org.junit.Assert.assertEquals;
        browserInfo.setTimeZone(-60);
        browserInfo.setIpAddress("216.58.207.35");
        browserInfo.setJavaEnabled(true);
        browserInfo.setJavascriptEnabled(false);
        threeds2Data.setBrowserInfo(browserInfo);

        Address billingAddress = new Address();
        billingAddress.setAddressLine1("8239 Louie Street");
        billingAddress.setAddressLine2("line2");
        billingAddress.setAddressLine3("line3");
        billingAddress.setCity("Coltenburgh");
        billingAddress.setCountry("USA");
        billingAddress.setPostalCode("84603");
        billingAddress.setState("DC");
        threeds2Data.setBillingAddress(billingAddress);

        Address deliveryAddress = new Address();
        deliveryAddress.setAddressLine1("Schallerallee 33");
        deliveryAddress.setCity("Ravensburg");
        deliveryAddress.setCountry("DEU");
        deliveryAddress.setPostalCode("82940");
        threeds2Data.setDeliveryAddress(deliveryAddress);

        CardholderInfo cardholderInfo = new CardholderInfo();
        cardholderInfo.setEmailAddress("card.holder@example.com");
        cardholderInfo.setMobilePhoneNumber("+353209120599");
        cardholderInfo.setHomePhoneNumber("+353209174412");
        cardholderInfo.setWorkPhoneNumber("+353209134251");
        threeds2Data.setCardholderInfo(cardholderInfo);

// Path: src/test/java/com/cardinity/CardinityBaseTest.java
// public abstract class CardinityBaseTest {
// 
//     protected final static SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
//     protected final static SimpleDateFormat formatterWithMillis = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
//     protected final static SimpleDateFormat formatterWithMillisEET = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
// 
//     static {
//         formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
//         formatterWithMillis.setTimeZone(TimeZone.getTimeZone("UTC"));
//         formatterWithMillisEET.setTimeZone(TimeZone.getTimeZone("EET"));
//     }
// 
//     protected String resource(String path) throws IOException {
// 
//         InputStream resource = getClass().getResourceAsStream(path);
// 
//         ByteArrayOutputStream os = new ByteArrayOutputStream(1024);
//         byte[] buf = new byte[1024];
// 
//         for (int i = resource.read(buf); i > 0; i = resource.read(buf)) {
//             os.write(buf, 0, i);
//         }
// 
//         return os.toString(Cardinity.ENCODING_CHARSET);
// 
//     }
// }
// 
// Path: src/main/java/com/cardinity/rest/RestResource.java
// public abstract class RestResource {
// 
//     // @formatter:off
//     public static final Gson GSON = new GsonBuilder()
//             .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
//             .registerTypeAdapter(Payment.class, new PaymentDeserializer())
//             .registerTypeAdapter(Card.class, new CardSerializer())
//             .registerTypeAdapter(Date.class, new UtcDateTypeAdapter())
//             .create();
//     // @formatter:on
// 
// 
//     public enum RequestMethod {
//         GET, PATCH, POST
//     }
// 
//     public enum Resource {
//         PAYMENTS, REFUNDS, SETTLEMENTS, VOIDS, CHARGEBACKS
//     }
// 
// }


// Path: src/test/java/com/cardinity/model/SerializationTest.java
import com.cardinity.CardinityBaseTest;
import com.cardinity.rest.RestResource;
import org.junit.Test;
import java.io.IOException;
import java.math.BigDecimal;
import static org.junit.Assert.assertEquals;

        browserInfo.setTimeZone(-60);
        browserInfo.setIpAddress("216.58.207.35");
        browserInfo.setJavaEnabled(true);
        browserInfo.setJavascriptEnabled(false);
        threeds2Data.setBrowserInfo(browserInfo);

        Address billingAddress = new Address();
        billingAddress.setAddressLine1("8239 Louie Street");
        billingAddress.setAddressLine2("line2");
        billingAddress.setAddressLine3("line3");
        billingAddress.setCity("Coltenburgh");
        billingAddress.setCountry("USA");
        billingAddress.setPostalCode("84603");
        billingAddress.setState("DC");
        threeds2Data.setBillingAddress(billingAddress);

        Address deliveryAddress = new Address();
        deliveryAddress.setAddressLine1("Schallerallee 33");
        deliveryAddress.setCity("Ravensburg");
        deliveryAddress.setCountry("DEU");
        deliveryAddress.setPostalCode("82940");
        threeds2Data.setDeliveryAddress(deliveryAddress);

        CardholderInfo cardholderInfo = new CardholderInfo();
        cardholderInfo.setEmailAddress("card.holder@example.com");
        cardholderInfo.setMobilePhoneNumber("+353209120599");
        cardholderInfo.setHomePhoneNumber("+353209174412");
        cardholderInfo.setWorkPhoneNumber("+353209134251");
        threeds2Data.setCardholderInfo(cardholderInfo);

        assertEquals(resource("payment_with_threeds2_data.json"), RestResource.GSON.toJson(payment));