Search in sources :

Example 6 with MethodInvocationInfo

use of org.apache.cxf.jaxrs.model.MethodInvocationInfo in project cxf by apache.

the class UriInfoImplTest method testGetMatchedURIsRoot.

@Test
public void testGetMatchedURIsRoot() throws Exception {
    System.out.println("testGetMatchedURIsRoot");
    Message m = mockMessage("http://localhost:8080/app", "/foo");
    OperationResourceInfoStack oriStack = new OperationResourceInfoStack();
    ClassResourceInfo cri = getCri(RootResource.class, true);
    OperationResourceInfo ori = getOri(cri, "get");
    MethodInvocationInfo miInfo = new MethodInvocationInfo(ori, RootResource.class, new ArrayList<String>());
    oriStack.push(miInfo);
    m.put(OperationResourceInfoStack.class, oriStack);
    UriInfoImpl u = new UriInfoImpl(m);
    List<String> matchedUris = getMatchedURIs(u);
    assertEquals(1, matchedUris.size());
    assertTrue(matchedUris.contains("foo"));
}
Also used : Message(org.apache.cxf.message.Message) ClassResourceInfo(org.apache.cxf.jaxrs.model.ClassResourceInfo) OperationResourceInfoStack(org.apache.cxf.jaxrs.model.OperationResourceInfoStack) OperationResourceInfo(org.apache.cxf.jaxrs.model.OperationResourceInfo) MethodInvocationInfo(org.apache.cxf.jaxrs.model.MethodInvocationInfo) Test(org.junit.Test)

Aggregations

MethodInvocationInfo (org.apache.cxf.jaxrs.model.MethodInvocationInfo)6 OperationResourceInfo (org.apache.cxf.jaxrs.model.OperationResourceInfo)5 OperationResourceInfoStack (org.apache.cxf.jaxrs.model.OperationResourceInfoStack)5 ClassResourceInfo (org.apache.cxf.jaxrs.model.ClassResourceInfo)4 Message (org.apache.cxf.message.Message)4 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)3 LinkedList (java.util.LinkedList)1 URITemplate (org.apache.cxf.jaxrs.model.URITemplate)1