Skip to content

Commit

Permalink
Fixed incorrect test try-catch statement
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnvg committed Mar 9, 2018
1 parent 2b9f912 commit a93b0fc
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import java.util.concurrent.ExecutionException;

import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.notNullValue;
Expand Down Expand Up @@ -268,13 +269,9 @@ public void testPutWithPipelineFactoryError() throws Exception {
.endArray()
.endObject().bytes();
PutPipelineRequest putPipelineRequest = new PutPipelineRequest("_id", source, XContentType.JSON);
try {
client().admin().cluster().putPipeline(putPipelineRequest).get();
} catch (ExecutionException e) {
ElasticsearchParseException ex = (ElasticsearchParseException) ExceptionsHelper.unwrap(e, ElasticsearchParseException.class);
assertNotNull(ex);
assertThat(ex.getMessage(), equalTo("processor [test] doesn't support one or more provided configuration parameters [unused]"));
}
Exception e = expectThrows(ElasticsearchParseException.class,
() -> client().admin().cluster().putPipeline(putPipelineRequest).actionGet());
assertThat(e.getMessage(), equalTo("processor [test] doesn't support one or more provided configuration parameters [unused]"));

GetPipelineResponse response = client().admin().cluster().prepareGetPipeline("_id").get();
assertFalse(response.isFound());
Expand Down

0 comments on commit a93b0fc

Please sign in to comment.