diff --git a/server/src/test/java/org/opensearch/rest/RestControllerTests.java b/server/src/test/java/org/opensearch/rest/RestControllerTests.java index 83906a3891700..03f6b7fca748e 100644 --- a/server/src/test/java/org/opensearch/rest/RestControllerTests.java +++ b/server/src/test/java/org/opensearch/rest/RestControllerTests.java @@ -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() {