// Path: src/main/com/sailthru/client/SailthruUtil.java
// public class SailthruUtil {
// 
//     public static final String SAILTHRU_API_DATE_FORMAT = "EEE, d MMM yyyy HH:mm:ss Z";
// 
//     /**
//      * generates MD5 Hash
//      * @param data parameter data
//      * @return MD5 hashed string 
//      */
//     public static String md5(String data) {
//         try {
//             return DigestUtils.md5Hex(data.toString().getBytes("UTF-8"));
//         }
//         catch (UnsupportedEncodingException e) {
//             return DigestUtils.md5Hex(data.toString());
//         }
//     }
// 
//     /**
//      * Converts String ArrayList to CSV string
//      * @param list List of String to create a CSV string
//      * @return CSV string
//      */
//     public static String arrayListToCSV(List<String> list) {
//         StringBuilder csv = new StringBuilder();
//         for (String str : list) {
//             csv.append(str);
//             csv.append(",");
//         }
//         int lastIndex = csv.length() - 1;
//         char last = csv.charAt(lastIndex);
//         if (last == ',') {
//             return csv.substring(0, lastIndex);
//         }
//         return csv.toString();
//     }
// 
//     public static Gson createGson() {
//         return new GsonBuilder().setDateFormat(SAILTHRU_API_DATE_FORMAT)
//                 .registerTypeHierarchyAdapter(Map.class, new NullSerializingMapTypeAdapter())
//                 .create();
//     }
// 
//     /**
//      * Add a new image entry to the images map.
//      *
//      * @param images map containing the references of images. Can be null, in that case the returned map will be a new instance with the entry
//      * @param key key for the map, either "full" or "thumb"
//      * @param url url for the image to use
//      * @return a new map instance of the images parameter was null otherwise the updated map.
//      */
//     public static Map<String, Map<String, String>> putImage(Map<String, Map<String, String>> images, String key, String url) {
//         if (images == null) {
//             images = new HashMap<String, Map<String, String>>();
//         }
//         Map<String, String> urlMap = new HashMap<String, String>();
//         urlMap.put("url", url);
//         images.put(key, urlMap);
//         return images;
//     }
// 
// }


import com.google.gson.Gson;
import com.sailthru.client.SailthruUtil;
import junit.framework.TestCase;
import java.util.*;
import java.util.List;
import java.text.*;
        String title = "Test Title";
        content.setTitle(title);
        String expected = "{\"title\":\"Test Title\"}";
        String result = gson.toJson(content);
        assertEquals(expected,result);
    }

    public void testSetKeys() {
        Content content = new Content();
        Map<String, String> keys = new HashMap<String, String>();
        keys.put("sku", "123abc");
        content.setKeys(keys);

        String expected = "{\"keys\":{\"sku\":\"123abc\"}}";
        String result = gson.toJson(content);
        assertEquals(expected, result);
    }

    public void testSetUrl(){
        Content content = new Content();
        String url = "http://sailthru.com";
        content.setUrl(url);
        String expected = "{\"url\":\"http://sailthru.com\"}";
        String result = gson.toJson(content);
        assertEquals(expected,result);
    }

    public void testSetDateFormat(){
        Content content = new Content();
        Date date = new Date(1380831494000L);
// Path: src/main/com/sailthru/client/SailthruUtil.java
// public class SailthruUtil {
// 
//     public static final String SAILTHRU_API_DATE_FORMAT = "EEE, d MMM yyyy HH:mm:ss Z";
// 
//     /**
//      * generates MD5 Hash
//      * @param data parameter data
//      * @return MD5 hashed string 
//      */
//     public static String md5(String data) {
//         try {
//             return DigestUtils.md5Hex(data.toString().getBytes("UTF-8"));
//         }
//         catch (UnsupportedEncodingException e) {
//             return DigestUtils.md5Hex(data.toString());
//         }
//     }
// 
//     /**
//      * Converts String ArrayList to CSV string
//      * @param list List of String to create a CSV string
//      * @return CSV string
//      */
//     public static String arrayListToCSV(List<String> list) {
//         StringBuilder csv = new StringBuilder();
//         for (String str : list) {
//             csv.append(str);
//             csv.append(",");
//         }
//         int lastIndex = csv.length() - 1;
//         char last = csv.charAt(lastIndex);
//         if (last == ',') {
//             return csv.substring(0, lastIndex);
//         }
//         return csv.toString();
//     }
// 
//     public static Gson createGson() {
//         return new GsonBuilder().setDateFormat(SAILTHRU_API_DATE_FORMAT)
//                 .registerTypeHierarchyAdapter(Map.class, new NullSerializingMapTypeAdapter())
//                 .create();
//     }
// 
//     /**
//      * Add a new image entry to the images map.
//      *
//      * @param images map containing the references of images. Can be null, in that case the returned map will be a new instance with the entry
//      * @param key key for the map, either "full" or "thumb"
//      * @param url url for the image to use
//      * @return a new map instance of the images parameter was null otherwise the updated map.
//      */
//     public static Map<String, Map<String, String>> putImage(Map<String, Map<String, String>> images, String key, String url) {
//         if (images == null) {
//             images = new HashMap<String, Map<String, String>>();
//         }
//         Map<String, String> urlMap = new HashMap<String, String>();
//         urlMap.put("url", url);
//         images.put(key, urlMap);
//         return images;
//     }
// 
// }


// Path: src/test/com/sailthru/client/params/ContentTest.java
import com.google.gson.Gson;
import com.sailthru.client.SailthruUtil;
import junit.framework.TestCase;
import java.util.*;
import java.util.List;
import java.text.*;

        String title = "Test Title";
        content.setTitle(title);
        String expected = "{\"title\":\"Test Title\"}";
        String result = gson.toJson(content);
        assertEquals(expected,result);
    }

    public void testSetKeys() {
        Content content = new Content();
        Map<String, String> keys = new HashMap<String, String>();
        keys.put("sku", "123abc");
        content.setKeys(keys);

        String expected = "{\"keys\":{\"sku\":\"123abc\"}}";
        String result = gson.toJson(content);
        assertEquals(expected, result);
    }

    public void testSetUrl(){
        Content content = new Content();
        String url = "http://sailthru.com";
        content.setUrl(url);
        String expected = "{\"url\":\"http://sailthru.com\"}";
        String result = gson.toJson(content);
        assertEquals(expected,result);
    }

    public void testSetDateFormat(){
        Content content = new Content();
        Date date = new Date(1380831494000L);
        format.setTimeZone(TimeZone.getTimeZone("Etc/UTC"));