// 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/exceptions/CardinityException.java
// public abstract class CardinityException extends RuntimeException {
// 
//     private static final long serialVersionUID = -4551051157520060255L;
// 
//     public CardinityException(String message) {
//         super(message, null);
//     }
// 
// }
// 
// 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.exceptions.CardinityException;
import com.cardinity.rest.RestResource;
import org.junit.Test;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.UUID;
import static org.junit.Assert.*;
package com.cardinity.model;




public class DeserializationTest extends CardinityBaseTest {

    @Test
    public void testDeserializeApprovedPayment() throws IOException, ParseException {
        String json = resource("approved_payment.json");
// 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/exceptions/CardinityException.java
// public abstract class CardinityException extends RuntimeException {
// 
//     private static final long serialVersionUID = -4551051157520060255L;
// 
//     public CardinityException(String message) {
//         super(message, null);
//     }
// 
// }
// 
// 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/DeserializationTest.java
import com.cardinity.CardinityBaseTest;
import com.cardinity.exceptions.CardinityException;
import com.cardinity.rest.RestResource;
import org.junit.Test;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.UUID;
import static org.junit.Assert.*;

package com.cardinity.model;




public class DeserializationTest extends CardinityBaseTest {

    @Test
    public void testDeserializeApprovedPayment() throws IOException, ParseException {
        String json = resource("approved_payment.json");
        Payment payment = RestResource.GSON.fromJson(json, Payment.class);