// Path: src/test/java/com/amazon/dtasdk/serializer/TestJson.java
// public static class Name {
//     private String first, last;
// 
//     public String getFirst() {
//         return first;
//     }
// 
//     public String getLast() {
//         return last;
//     }
// 
//     public void setFirst(String first) {
//         this.first = first;
//     }
// 
//     public void setLast(String last) {
//         this.last = last;
//     }
// 
//     @Override
//     public int hashCode() {
//         final int prime = 31;
//         int result = 1;
//         result = prime * result + ((first == null) ? 0 : first.hashCode());
//         result = prime * result + ((last == null) ? 0 : last.hashCode());
//         return result;
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (this == obj) {
//             return true;
//         }
//         if (obj == null) {
//             return false;
//         }
//         if (getClass() != obj.getClass()) {
//             return false;
//         }
//         Name other = (Name) obj;
//         if (first == null) {
//             if (other.first != null) {
//                 return false;
//             }
//         } else if (!first.equals(other.first)) {
//             return false;
//         }
//         if (last == null) {
//             if (other.last != null) {
//                 return false;
//             }
//         } else if (!last.equals(other.last)) {
//             return false;
//         }
//         return true;
//     }
// }


import com.amazon.dtasdk.serializer.TestJson.Name;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import junit.framework.Assert;
import org.junit.Test;
import java.util.LinkedList;
import java.util.List;
/*
 * Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.amazon.dtasdk.serializer;



public class JacksonSerializerTest {
    private static final String jsonString = "{\"value\":\"theValue\","
            + "\"names\":[{\"first\":\"Joe\",\"last\":\"Sixpack\"}," + "{\"first\":\"Bill\",\"last\":\"Fourpack\"}]}";

    private static final JacksonSerializer serializer = new JacksonSerializer();

    @Test
    public void testDecode() throws Exception {
        TestJson dtgObject = serializer.decode(jsonString, TestJson.class);

        Assert.assertEquals(TestJson.class, dtgObject.getClass());
        TestJson testJson = dtgObject;
        Assert.assertEquals("Joe", testJson.getNames().get(0).getFirst());
        Assert.assertEquals("Sixpack", testJson.getNames().get(0).getLast());
        Assert.assertEquals("Bill", testJson.getNames().get(1).getFirst());
        Assert.assertEquals("Fourpack", testJson.getNames().get(1).getLast());
        Assert.assertEquals("theValue", testJson.getValue());
    }

// Path: src/test/java/com/amazon/dtasdk/serializer/TestJson.java
// public static class Name {
//     private String first, last;
// 
//     public String getFirst() {
//         return first;
//     }
// 
//     public String getLast() {
//         return last;
//     }
// 
//     public void setFirst(String first) {
//         this.first = first;
//     }
// 
//     public void setLast(String last) {
//         this.last = last;
//     }
// 
//     @Override
//     public int hashCode() {
//         final int prime = 31;
//         int result = 1;
//         result = prime * result + ((first == null) ? 0 : first.hashCode());
//         result = prime * result + ((last == null) ? 0 : last.hashCode());
//         return result;
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (this == obj) {
//             return true;
//         }
//         if (obj == null) {
//             return false;
//         }
//         if (getClass() != obj.getClass()) {
//             return false;
//         }
//         Name other = (Name) obj;
//         if (first == null) {
//             if (other.first != null) {
//                 return false;
//             }
//         } else if (!first.equals(other.first)) {
//             return false;
//         }
//         if (last == null) {
//             if (other.last != null) {
//                 return false;
//             }
//         } else if (!last.equals(other.last)) {
//             return false;
//         }
//         return true;
//     }
// }


// Path: src/test/java/com/amazon/dtasdk/serializer/JacksonSerializerTest.java
import com.amazon.dtasdk.serializer.TestJson.Name;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import junit.framework.Assert;
import org.junit.Test;
import java.util.LinkedList;
import java.util.List;

/*
 * Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.amazon.dtasdk.serializer;



public class JacksonSerializerTest {
    private static final String jsonString = "{\"value\":\"theValue\","
            + "\"names\":[{\"first\":\"Joe\",\"last\":\"Sixpack\"}," + "{\"first\":\"Bill\",\"last\":\"Fourpack\"}]}";

    private static final JacksonSerializer serializer = new JacksonSerializer();

    @Test
    public void testDecode() throws Exception {
        TestJson dtgObject = serializer.decode(jsonString, TestJson.class);

        Assert.assertEquals(TestJson.class, dtgObject.getClass());
        TestJson testJson = dtgObject;
        Assert.assertEquals("Joe", testJson.getNames().get(0).getFirst());
        Assert.assertEquals("Sixpack", testJson.getNames().get(0).getLast());
        Assert.assertEquals("Bill", testJson.getNames().get(1).getFirst());
        Assert.assertEquals("Fourpack", testJson.getNames().get(1).getLast());
        Assert.assertEquals("theValue", testJson.getValue());
    }

    @Test