@Test public void providesWadlResponse() throws Exception { org.everrest.core.wadl.research.Application wadlDoc = new org.everrest.core.wadl.research.Application(); when(wadlProcessor.process(resourceDescriptor, URI.create("/a"))).thenReturn(wadlDoc); Object object = new Object(); Response response = (Response)optionsRequestMethodInvoker.invokeMethod(object, resourceMethod, applicationContext); assertEquals(200, response.getStatus()); assertEquals(new MediaType("application", "vnd.sun.wadl+xml"), response.getMediaType()); assertSame(wadlDoc, response.getEntity()); }
@Override public Object invokeMethod(Object resource, GenericResourceMethod genericResourceMethod, ApplicationContext context) { Application wadlApplication = wadlProcessor.process(genericResourceMethod.getParentResource(), context.getBaseUri()); return Response.ok(wadlApplication, MediaTypeHelper.WADL_TYPE).build(); }
OptionsRequestMethodInvoker implements MethodInvoker { @Override public Object invokeMethod(Object resource, GenericResourceMethod genericResourceMethod, ApplicationContext context) { Application wadlApplication = wadlProcessor.process(genericResourceMethod.getParentResource(), context.getBaseUri()); return Response.ok(wadlApplication, MediaTypeHelper.WADL_TYPE).build(); } }
OptionsRequestMethodInvoker implements MethodInvoker { @Override public Object invokeMethod(Object resource, GenericResourceMethod genericResourceMethod, ApplicationContext context) { Application wadlApplication = wadlProcessor.process(genericResourceMethod.getParentResource(), context.getBaseUri()); return Response.ok(wadlApplication, MediaTypeHelper.WADL_TYPE).build(); } OptionsRequestMethodInvoker(WadlProcessor wadlProcessor); }
OptionsRequestMethodInvoker implements MethodInvoker { @Override public Object invokeMethod(Object resource, GenericResourceMethod genericResourceMethod, ApplicationContext context) { Application wadlApplication = wadlProcessor.process(genericResourceMethod.getParentResource(), context.getBaseUri()); return Response.ok(wadlApplication, MediaTypeHelper.WADL_TYPE).build(); } OptionsRequestMethodInvoker(WadlProcessor wadlProcessor); @Override Object invokeMethod(Object resource, GenericResourceMethod genericResourceMethod, ApplicationContext context); }
OptionsRequestMethodInvoker implements MethodInvoker { @Override public Object invokeMethod(Object resource, GenericResourceMethod genericResourceMethod, ApplicationContext context) { Application wadlApplication = wadlProcessor.process(genericResourceMethod.getParentResource(), context.getBaseUri()); return Response.ok(wadlApplication, MediaTypeHelper.WADL_TYPE).build(); } OptionsRequestMethodInvoker(WadlProcessor wadlProcessor); @Override Object invokeMethod(Object resource, GenericResourceMethod genericResourceMethod, ApplicationContext context);  }