}
}
@Test
public void testMaxRequestEntitySize() throws IOException {
OptionMap existing = DefaultServer.getUndertowOptions();
final TestHttpClient client = new TestHttpClient();
try {
HttpPost post = new HttpPost(DefaultServer.getDefaultServerURL() + "/notamatchingpath");
post.setEntity(new StringEntity(A_MESSAGE));
post.addHeader(Headers.CONNECTION_STRING, "close");
HttpResponse result = client.execute(post);
Assert.assertEquals(StatusCodes.OK, result.getStatusLine().getStatusCode());
HttpClientUtils.readResponse(result);
OptionMap maxSize = OptionMap.create(UndertowOptions.MAX_ENTITY_SIZE, (long) A_MESSAGE.length() - 1);
DefaultServer.setUndertowOptions(maxSize);
post = new HttpPost(DefaultServer.getDefaultServerURL() + "/notamatchingpath");
post.setEntity(new StringEntity(A_MESSAGE));
result = client.execute(post);