use of org.apache.cxf.jaxrs.fortest.jaxb.jaxbelement.ParamJAXBElement in project cxf by apache.
the class JAXBElementProviderTest method testReadParamJAXBElement.
@Test
public void testReadParamJAXBElement() throws Exception {
String xml = "<param xmlns=\"http://jaxbelement/10\">" + "<filter name=\"foo\"/><comment>a</comment></param>";
JAXBElementProvider<ParamJAXBElement> provider = new JAXBElementProvider<ParamJAXBElement>();
ParamJAXBElement jaxbElement = provider.readFrom(ParamJAXBElement.class, ParamJAXBElement.class, new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)));
ParamType param = jaxbElement.getValue();
assertEquals("a", param.getComment());
}
Aggregations