Skip to content

Commit

Permalink
spotlessApply fix
Browse files Browse the repository at this point in the history
Signed-off-by: Ayush Kataria <ayushkataria97@gmail.com>
  • Loading branch information
ayushKataria committed Oct 21, 2022
1 parent 9fcb009 commit 577894b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,17 @@ public void testHandleBadRequestWithHtmlSpecialCharsInUri() {
}

public void testHandleBadInputWithCreateIndex() {
final FakeRestRequest fakeRestRequest = new FakeRestRequest.Builder(NamedXContentRegistry.EMPTY)
.withPath("/foo")
final FakeRestRequest fakeRestRequest = new FakeRestRequest.Builder(NamedXContentRegistry.EMPTY).withPath("/foo")
.withMethod(RestRequest.Method.PUT)
.withContent(new BytesArray("ddd"), XContentType.JSON)
.build();
final AssertingChannel channel = new AssertingChannel(fakeRestRequest, true, RestStatus.BAD_REQUEST);
restController.registerHandler(RestRequest.Method.PUT, "/foo", new RestCreateIndexAction());
restController.dispatchRequest(fakeRestRequest, channel, client.threadPool().getThreadContext());
assertEquals(channel.getRestResponse().content().utf8ToString(), "{\"error\":{\"root_cause\":[{\"type\":\"not_x_content_exception\",\"reason\":\"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes\"}],\"type\":\"not_x_content_exception\",\"reason\":\"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes\"},\"status\":400}");
assertEquals(
channel.getRestResponse().content().utf8ToString(),
"{\"error\":{\"root_cause\":[{\"type\":\"not_x_content_exception\",\"reason\":\"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes\"}],\"type\":\"not_x_content_exception\",\"reason\":\"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes\"},\"status\":400}"
);
}

public void testDispatchUnsupportedHttpMethod() {
Expand Down

0 comments on commit 577894b

Please sign in to comment.