@Test
  @SuppressWarnings("unchecked")
  public void testCsv() {
    assertThat(
        contentAsString(
            call(
                new MockJavaAction(instanceOf(JavaHandlerComponents.class)) {
                  @BodyParser.Of(CsvBodyParser.class)
                  public Result uploadCsv(Http.Request request) {
                    String value =
                        ((List<List<String>>) request.body().as(List.class)).get(1).get(2);
                    return ok("Got: " + value);
                  }
                },
                fakeRequest().bodyText("1,2\n3,4,foo\n5,6"),
                mat)),
        equalTo("Got: foo"));
  }
@ Test @ SuppressWarnings ( "unchecked" ) public void testCsv ( ) { assertThat ( contentAsString ( call ( new MockJavaAction ( instanceOf ( JavaHandlerComponents . class ) ) { @ BodyParser . Of ( CsvBodyParser . class ) public Result uploadCsv ( Http . Request request ) { String value = ( ( List < List < String > > ) request . body ( ) . as ( List . class ) ) . get ( 1 ) . get ( 2 ) ; return ok ( "Got: " + value ) ; } } , fakeRequest ( ) . bodyText ( "1,2\n3,4,foo\n5,6" ) , mat ) ) , equalTo ( "Got: foo" ) ) ; }
#csv