assertNotNull(message.getBody().get("ObjectMap"));
assertTrue(message.getBody().get("ObjectMap") instanceof Map);
}
private String transform(String stringMessage, String fromType, String from, String to, String toType) throws ActionProcessingException, ConfigurationException, URISyntaxException, ActionLifecycleException {
ConfigTree properties = createConfig01(from, fromType, to, toType);
SmooksTransformer transformer = new SmooksTransformer(properties);
Message message;
transformer.initialise();
// Perform the transformation by setting the payload on the task object...
message = MessageFactory.getInstance().getMessage();
message.getBody().add(stringMessage);
message = transformer.process(message);
String resultThroughTaskObj = (String) message.getBody().get();
assertEquals(resultThroughTaskObj, message.getBody().get());
// Perform the transformation by setting the payload on the body as bytes...
message = createNewMessage(fromType, from, to, toType);
message.getBody().add(stringMessage.getBytes());
message = transformer.process(message);
assertEquals(resultThroughTaskObj, message.getBody().get());
// Perform the transformation by setting/getting the payload on the default body location...
message = MessageFactory.getInstance().getMessage();
message.getBody().add(stringMessage);
message = transformer.process(message);
assertEquals(resultThroughTaskObj, message.getBody().get());
// Perform the transformation by setting the payload input and output body locations...
properties.setAttribute(MessagePayloadProxy.GET_PAYLOAD_LOCATION, "input-loc1");
properties.setAttribute(MessagePayloadProxy.SET_PAYLOAD_LOCATION, "output-loc1");
transformer = new SmooksTransformer(properties);
transformer.initialise();
message = MessageFactory.getInstance().getMessage();
message.getBody().add("input-loc1", stringMessage);
message = transformer.process(message);