@@ -0,0 +1,2293 @@
+package com.mcac0006.services.siftscience;%0A%0Aimport com.jayway.jsonpath.JsonPath;%0Aimport com.mcac0006.siftscience.SiftScienceHelper;%0Aimport com.mcac0006.siftscience.event.domain.CreateContent;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;%0Aimport java.util.Arrays;%0Aimport java.util.LinkedHashMap;%0Aimport java.util.List;%0A%0Aimport static com.mcac0006.services.siftscience.AssertJsonKeys.assertEquals;%0A%0Apublic class CreateContentBodyTest %7B%0A%0A%09@Test%0A%09@SuppressWarnings(%22unchecked%22)%0A%09public void createContentTest() throws IOException %7B%0A%09%09%09final CreateContent create_order = new CreateContent();%0A            String expectedApiKey = %22INSERT_API_KEY_HERE%22;%0A            create_order.setApiKey(expectedApiKey);%0A            String expectedUserId = %22john_doe%22;%0A            String expectedSessionId = %22abcabcabc%22;%0A            String expectedContactEmail = %22test@siftscience.com%22;%0A            String expectedContactPhone = %221-800-123-1234%22;%0A            String expectedSubject = %22Subject%22;%0A            String expectedContent = %22Lorem ipsum dolor sit amet%22;%0A            create_order.setUserId(expectedUserId).setSessionId(expectedSessionId).setContactEmail(expectedContactEmail).setContactPhone(expectedContactPhone).setSubject(expectedSubject).setContent(expectedContent);%0A%0A%09%09%09final String json = SiftScienceHelper.serialize(create_order); // the json object we will be asserting%0A%0A%09%09%09final Object read = JsonPath.read(json, %22$%22);%0A%09%09%09final LinkedHashMap%3CString, Object%3E $ =(LinkedHashMap%3CString, Object%3E)read;%0A%0A%09%09%09// assert first level%0A%09%09%09final List%3CString%3E $expectedKeys = Arrays.asList(%22$type%22, %22$api_key%22, %22$user_id%22, %22$session_id%22, %22$contact_email%22, %22$contact_phone%22, %22$subject%22, %22$content%22);%0A%09%09%09assertEquals($.keySet(), $expectedKeys);%0A%0A%09%09%09// then assert the values%0A%09%09%09Assert.assertEquals(expectedApiKey, $.get(%22$api_key%22));%0A%09%09%09Assert.assertEquals(%22$create_content%22, $.get(%22$type%22));%0A%09%09%09Assert.assertEquals(expectedUserId, $.get(%22$user_id%22));%0A%0A%09%09%09Assert.assertEquals(expectedSessionId, $.get(%22$session_id%22));%0A%09%09%09Assert.assertEquals(expectedContactEmail, $.get(%22$contact_email%22));%0A%09%09%09Assert.assertEquals(expectedContactPhone, $.get(%22$contact_phone%22));%0A%09%09%09Assert.assertEquals(expectedSubject, $.get(%22$subject%22));%0A%09%09%09Assert.assertEquals(expectedContent, $.get(%22$content%22));%0A%09%7D%0A%7D%0A

Test on new CreateContent event