use of org.apache.cxf.jaxrs.JAXRSServiceImpl in project cxf by apache.
the class WadlGeneratorTest method mockMessage.
private Message mockMessage(String baseAddress, String pathInfo, String query, List<ClassResourceInfo> cris) throws Exception {
Message m = new MessageImpl();
Exchange e = new ExchangeImpl();
e.put(Service.class, new JAXRSServiceImpl(cris));
m.setExchange(e);
control.reset();
ServletDestination d = control.createMock(ServletDestination.class);
EndpointInfo epr = new EndpointInfo();
epr.setAddress(baseAddress);
d.getEndpointInfo();
EasyMock.expectLastCall().andReturn(epr).anyTimes();
Endpoint endpoint = new EndpointImpl(null, null, epr);
e.put(Endpoint.class, endpoint);
endpoint.put(ServerProviderFactory.class.getName(), ServerProviderFactory.getInstance());
e.setDestination(d);
BindingInfo bi = control.createMock(BindingInfo.class);
epr.setBinding(bi);
bi.getProperties();
EasyMock.expectLastCall().andReturn(Collections.emptyMap()).anyTimes();
m.put(Message.REQUEST_URI, pathInfo);
m.put(Message.QUERY_STRING, query);
m.put(Message.HTTP_REQUEST_METHOD, "GET");
control.replay();
return m;
}
use of org.apache.cxf.jaxrs.JAXRSServiceImpl in project cxf by apache.
the class WadlGeneratorJsonTest method mockMessage.
private Message mockMessage(String baseAddress, String pathInfo, String query, ClassResourceInfo cri) throws Exception {
Message m = new MessageImpl();
Exchange e = new ExchangeImpl();
e.put(Service.class, new JAXRSServiceImpl(Collections.singletonList(cri)));
m.setExchange(e);
control.reset();
ServletDestination d = control.createMock(ServletDestination.class);
EndpointInfo epr = new EndpointInfo();
epr.setAddress(baseAddress);
d.getEndpointInfo();
EasyMock.expectLastCall().andReturn(epr).anyTimes();
Endpoint endpoint = new EndpointImpl(null, null, epr);
e.put(Endpoint.class, endpoint);
e.setDestination(d);
BindingInfo bi = control.createMock(BindingInfo.class);
epr.setBinding(bi);
bi.getProperties();
EasyMock.expectLastCall().andReturn(Collections.emptyMap()).anyTimes();
m.put(Message.REQUEST_URI, pathInfo);
m.put(Message.QUERY_STRING, query);
m.put(Message.HTTP_REQUEST_METHOD, "GET");
control.replay();
return m;
}
Aggregations