package com.boundary.sdk;

import java.io.File;

import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.test.junit4.CamelSpringTestSupport;
import org.junit.Test;
import org.slf4j.Logger;
import org.springframework.context.support.AbstractXmlApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

@SuppressWarnings("deprecation")
public class EventToJSONTest extends CamelSpringTestSupport {
	protected AbstractXmlApplicationContext createApplicationContext() {
		return new ClassPathXmlApplicationContext("META-INF/event-to-json.xml");
	}

	@Test
	public void testEventToLog() throws Exception {
		TestEvent event = new TestEvent("hello");
		
		template.sendBody("direct:event-to-json", event);
		
		Thread.sleep(5000);

		File target = new File("target/event-to-json.log");
		assertTrue("Log file exists: ", target.exists());
		String content = context.getTypeConverter().convertTo(String.class,target);
		//assertEquals("TestEvent [name=hello]", content);
	}
}
@@ -789,9 +789,9 @@
 eep(
-5
+1
 000)
@@ -983,10 +983,8 @@
 ;%0A%09%09
-//
 asse
@@ -997,30 +997,28 @@
 ls(%22
-TestEvent %5Bname=
+%7B%5C%22name%5C%22:%5C%22
 hello
-%5D
+%5C%22%7D
 %22, c

Update test