XpathMappingDataDictionary extends AbstractXmlDataDictionary implements InitializingBean { @Override public void afterPropertiesSet() throws Exception { if (getPathMappingStrategy() != null && !getPathMappingStrategy().equals(DataDictionary.PathMappingStrategy.EXACT)) { log.warn(String.format("%s ignores path mapping strategy other than %s", getClass().getSimpleName(), DataDictionary.PathMappingStrategy.EXACT)); } super.afterPropertiesSet(); }  @Override T translate(Node node, T value, TestContext context); @Override void afterPropertiesSet(); NamespaceContextBuilder getNamespaceContextBuilder(); void setNamespaceContextBuilder(NamespaceContextBuilder namespaceContextBuilder);  }
@Test public void testTranslateFromMappingFile() throws Exception { Message message = new DefaultMessage(payload); XpathMappingDataDictionary dictionary = new XpathMappingDataDictionary(); dictionary.setMappingFile(new ClassPathResource("xpathmapping.properties", DataDictionary.class)); dictionary.afterPropertiesSet(); dictionary.processMessage(message, context); Assert.assertEquals(message.getPayload(String.class).trim(), "<?xml version=\"1.0\" encoding=\"UTF-8\"?><TestMessage>" + System.getProperty("line.separator") + " <Text>Hello!</Text>" + System.getProperty("line.separator") + " <OtherText name=\"bar\">GoodBye!</OtherText>" + System.getProperty("line.separator") + "</TestMessage>"); }