use of org.apache.cxf.jaxrs.SimpleFactory in project cxf by apache.
the class JAXRSUtilsTest method testConversion.
@Test
public void testConversion() throws Exception {
ClassResourceInfo cri = new ClassResourceInfo(Customer.class, true);
OperationResourceInfo ori = new OperationResourceInfo(Customer.class.getMethod("testConversion", new Class[] { PathSegmentImpl.class, SimpleFactory.class }), cri);
ori.setHttpMethod("GET");
ori.setURITemplate(new URITemplate("{id1}/{id2}"));
MultivaluedMap<String, String> values = new MetadataMap<String, String>();
values.putSingle("id1", "1");
values.putSingle("id2", "2");
Message m = createMessage();
List<Object> params = JAXRSUtils.processParameters(ori, values, m);
PathSegment ps = (PathSegment) params.get(0);
assertEquals("1", ps.getPath());
SimpleFactory sf = (SimpleFactory) params.get(1);
assertEquals(2, sf.getId());
}
Aggregations