public void maxLength() {
StringBuilder body = new StringBuilder();
for (int i = 0; i < 1100; i++) {
body.append("1234567890");
}
assertThat(status(callWithStringBody(new MockJavaAction() {
//#max-length
// Accept only 10KB of data.
@BodyParser.Of(value = BodyParser.Text.class, maxLength = 10 * 1024)
public Result index() {
return ok("Got body: " + request().body().asText());