Had to make a slight change to the DSL to support produces and consume
correctly, please specify them in a single call NOT by chaining the
mothods. So as follows
@Test
public void supportsProduces() throws Exception {
TestApplication application = new TestApplication();
application.add(get("/bar").produces("text/html", "text/
xml").resource(method(on(Bar.class).hello())));
assertThat(application.responseAsString(RequestBuilder.get("/
bar").accepting("text/html")), is("Hello"));
assertThat(application.responseAsString(RequestBuilder.get("/
bar").accepting("text/xml")), is("Hello"));
assertThat(application.handle(RequestBuilder.get("/
bar").accepting("text/plain")).status(), is(Status.NOT_ACCEPTABLE));