MappingStreamReader implements MappingsSource<InputStream> { public MappingFileData read(InputStream xmlStream) { MappingFileData result = null; try { Document document = documentBuilder.parse(xmlStream); result = parser.read(document); } catch (Throwable e) { log.error("Error while loading dozer mapping InputStream: [" + xmlStream + "]", e); MappingUtils.throwMappingException(e); } return result; } MappingStreamReader(XMLParserFactory parserFactory, XMLParser xmlParser); MappingFileData read(InputStream xmlStream);  }
@Test public void loadFromStreamTest() throws IOException { InputStream xmlStream = getClass().getClassLoader().getResourceAsStream("mappings/testDozerBeanMapping.xml"); MappingFileData data = streamReader.read(xmlStream); xmlStream.close(); assertThat(data, notNullValue()); }