use of org.apache.cxf.jaxrs.Customer.Query in project cxf by apache.
the class JAXRSUtilsTest method testQueryParameter.
@Test
public void testQueryParameter() throws Exception {
Message messageImpl = createMessage();
ProviderFactory.getInstance(messageImpl).registerUserProvider(new GenericObjectParameterHandler());
Class<?>[] argType = { Query.class };
Method m = Customer.class.getMethod("testGenericObjectParam", argType);
messageImpl.put(Message.QUERY_STRING, "p1=thequery");
List<Object> params = JAXRSUtils.processParameters(new OperationResourceInfo(m, new ClassResourceInfo(Customer.class)), null, messageImpl);
assertEquals(1, params.size());
@SuppressWarnings("unchecked") Query<String> query = (Query<String>) params.get(0);
assertEquals("thequery", query.getEntity());
}
Aggregations