use of nl.nn.adapterframework.stream.MessageContext in project iaf by ibissource.
the class ParameterTest method testContextKeyWithXPath.
@Test
public void testContextKeyWithXPath() throws ConfigurationException, ParameterException {
Parameter p = new Parameter();
p.setName("dummy");
p.setContextKey("fakeContextKey");
p.setXpathExpression("count(root/a)");
p.configure();
Message input = new Message("fakeMessage", new MessageContext().with("fakeContextKey", "<root><a/><a/></root>"));
PipeLineSession session = new PipeLineSession();
ParameterValueList alreadyResolvedParameters = new ParameterValueList();
assertEquals("2", p.getValue(alreadyResolvedParameters, input, session, false));
}
use of nl.nn.adapterframework.stream.MessageContext in project iaf by ibissource.
the class ParameterTest method testContextKey.
@Test
public void testContextKey() throws ConfigurationException, ParameterException {
Parameter p = new Parameter();
p.setName("dummy");
p.setContextKey("fakeContextKey");
p.configure();
Message input = new Message("fakeMessage", new MessageContext().with("fakeContextKey", "fakeContextValue"));
PipeLineSession session = new PipeLineSession();
ParameterValueList alreadyResolvedParameters = new ParameterValueList();
assertEquals("fakeContextValue", p.getValue(alreadyResolvedParameters, input, session, false));
}
Aggregations