package io.outreach;

import static org.junit.Assert.*;

import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.junit.Before;
import org.junit.Test;

public class OutreachProspectTest {
    // NOTE: This needs to be changed between tests, since it expires after it's initially traded for a bearer token.
    private final String AUTHORIZATION_CODE = "1111111111111111111111111111111111111111111111111111111111111111";

    private Outreach outreach;

    @Before
    public void init() {
        /** @todo Populate these values with your OAuth application credentials. */
        Outreach.ApplicationCredentials app_creds = new Outreach.ApplicationCredentials(
              "1111111111111111111111111111111111111111111111111111111111111111", // App identifier
              "1111111111111111111111111111111111111111111111111111111111111111", // App secret key
              "https://www.example.com");                                         // App return-to URI
        outreach = new Outreach(app_creds, this.AUTHORIZATION_CODE);
    }

    @Test
    public void createProspectAllFields() {
    	JSONParser parser = new JSONParser();

        try {
            String prospect = parser.parse(
              "{\"data\": {"
            + "  \"attributes\": {"
            + "    \"address\": {"
            + "      \"city\": \"test-address-city\","
            + "      \"state\": \"test-address-state\","
            + "      \"country\": \"test-address-country\","
            + "      \"street\": [\"test-address-street-0\",\"test-address-street-1\"],"
            + "      \"zip\": 12345,"
            + "    },"
            + "    \"company\": {"
            + "      \"name\": \"test-company-name\","
            + "      \"type\": \"test-company-type\","
            + "      \"size\": \"test-company-size\","
            + "      \"locality\" :\"test-company-locality\""
            + "    },"
            + "    \"contact\": {"
            + "      \"timezone\": \"Pacific/Honolulu\","
            + "      \"email\" : {"
            + "        \"personal\": \"test-contact-email-personal@test.com\","
            + "        \"work\": \"test-contact-email-work@test.com\""
            + "      },"
            + "      \"phone\": {"
            + "        \"personal\": \"206-123-4567\","
            + "        \"work\": \"206-987-6543\""
            + "      }"
            + "    },"
            + "    \"personal\": {"
            + "      \"name\": {"
            + "        \"first\": \"Tester\","
            + "        \"last\": \"McTest\""
            + "      },"
            + "      \"gender\": \"male\","
            + "      \"occupation\": \"test-personal-occupation\","
            + "      \"title\": \"test-personal-title\""
            + "    },"
            + "    \"social\": {"
            + "      \"facebook\": \"http://www.facebook.com/test\","
            + "      \"linkedin\": \"http://www.linkedin.com/test\","
            + "      \"plus\": \"http://plus.google.com/test\","
            + "      \"quora\": \"http://www.quora.com/test\","
            + "      \"twitter\": \"http://www.twitter.com/test\""
            + "    }"
            + "  }"
            + "}}").toString();

            System.out.println(outreach.addProspect(prospect));
        } catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
    
	@Test
    public void assertion() {
        assertNotNull(null);
    }
}

@@ -3255,24 +3255,186 @@
 oString();%0A%0A
+            // Example response: %7B%22data%22:%7B%22attributes%22:%7B%22created%22:%222015-09-18T22:28:10.959Z%22,%22updated%22:%222015-09-18T22:28:10.959Z%22%7D,%22id%22:48438,%22type%22:%22prospect%22%7D%7D%0A
             

Add example output to add prospect test.