MediaType bar = MediaType.valueOf("application/bar");
{
ArrayList<MediaType> accepts = new ArrayList<MediaType>();
accepts.add(foo);
ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
Assert.assertNotNull(method);
Assert.assertEquals(MultipleResource.class.getMethod("get"), method.getMethod());
}
{
ArrayList<MediaType> accepts = new ArrayList<MediaType>();
accepts.add(bar);
ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
Assert.assertNotNull(method);
Assert.assertEquals(MultipleResource.class.getMethod("get"), method.getMethod());
}
{
ArrayList<MediaType> accepts = new ArrayList<MediaType>();
accepts.add(MediaType.valueOf("*/*"));
ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
Assert.assertNotNull(method);
Assert.assertEquals(MultipleResource.class.getMethod("get"), method.getMethod());
}
{
ArrayList<MediaType> accepts = new ArrayList<MediaType>();
accepts.add(MediaType.valueOf("application/*"));
ResourceMethodInvoker method = (ResourceMethodInvoker) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
Assert.assertNotNull(method);
Assert.assertEquals(MultipleResource.class.getMethod("get"), method.getMethod());
}
}