use of com.adaptris.core.MultiPayloadMessageFactory in project interlok by adaptris.
the class MultiPayloadXmlTransformServiceTest method testObtainUrlWithNullMetadataValueInMessage.
@Test
public void testObtainUrlWithNullMetadataValueInMessage() throws Exception {
MultiPayloadXmlTransformService service = new MultiPayloadXmlTransformService();
MultiPayloadAdaptrisMessage msg = (MultiPayloadAdaptrisMessage) new MultiPayloadMessageFactory().newMessage();
try {
service.setUrl(URL);
service.setMetadataKey("key");
LifecycleHelper.init(service);
assertEquals(URL, service.obtainUrlToUse(msg));
} finally {
LifecycleHelper.close(service);
}
}
use of com.adaptris.core.MultiPayloadMessageFactory in project interlok by adaptris.
the class MultiPayloadXmlTransformServiceTest method testObtainUrlWithMetadataValueInMessage.
@Test
public void testObtainUrlWithMetadataValueInMessage() throws Exception {
MultiPayloadAdaptrisMessage msg = (MultiPayloadAdaptrisMessage) new MultiPayloadMessageFactory().newMessage();
msg.addMetadata("key", "val");
MultiPayloadXmlTransformService service = new MultiPayloadXmlTransformService();
try {
service.setUrl(URL);
service.setMetadataKey("key");
LifecycleHelper.init(service);
// allow override is false
assertEquals(URL, service.obtainUrlToUse(msg));
} finally {
LifecycleHelper.close(service);
}
}
use of com.adaptris.core.MultiPayloadMessageFactory in project interlok by adaptris.
the class MultiPayloadXmlTransformServiceTest method testObtainUrlWithEmptyMetadataValue.
@Test
public void testObtainUrlWithEmptyMetadataValue() throws Exception {
MultiPayloadAdaptrisMessage msg = (MultiPayloadAdaptrisMessage) new MultiPayloadMessageFactory().newMessage();
msg.addMetadata("key", "");
MultiPayloadXmlTransformService service = new MultiPayloadXmlTransformService();
try {
service.setUrl(URL);
service.setMetadataKey("key");
service.setAllowOverride(true);
LifecycleHelper.init(service);
assertEquals(URL, service.obtainUrlToUse(msg));
} finally {
LifecycleHelper.close(service);
}
}
use of com.adaptris.core.MultiPayloadMessageFactory in project interlok by adaptris.
the class MultiPayloadXmlTransformServiceTest method testObtainUrlWithUrlOnly.
@Test
public void testObtainUrlWithUrlOnly() throws Exception {
MultiPayloadXmlTransformService service = new MultiPayloadXmlTransformService();
MultiPayloadAdaptrisMessage msg = (MultiPayloadAdaptrisMessage) new MultiPayloadMessageFactory().newMessage();
try {
service.setUrl(URL);
LifecycleHelper.init(service);
assertEquals(URL, service.obtainUrlToUse(msg));
} finally {
LifecycleHelper.close(service);
}
}
use of com.adaptris.core.MultiPayloadMessageFactory in project interlok by adaptris.
the class MultiPayloadXmlTransformServiceTest method testRemoveNamespaceMapping.
@Test
public void testRemoveNamespaceMapping() throws Exception {
// This explicit tests some behavioural changes that might have occurred due to migration SaxonHE
MultiPayloadXmlTransformService service = createBaseExample();
service.setOutputMessageEncoding("ISO-8859-1");
MultiPayloadAdaptrisMessage msg = (MultiPayloadAdaptrisMessage) new MultiPayloadMessageFactory().newMessage(PAYLOAD_ID_SOURCE, XML_WITH_NAMESPACE, "UTF-8");
execute(service, msg);
log.debug(msg.getContent());
}
Aggregations