Search in sources :

Example 6 with ElasticsearchClientException

use of com.github.alexcojocaru.mojo.elasticsearch.v2.client.ElasticsearchClientException in project elasticsearch-maven-plugin by alexcojocaru.

the class BootstrapClusterStepTest method testExecuteInitCommandPut.

@Test
public void testExecuteInitCommandPut() throws ElasticsearchClientException {
    ElasticsearchCommand command = mock(ElasticsearchCommand.class);
    when(command.getRequestMethod()).thenReturn(RequestMethod.PUT);
    when(command.getJson()).thenReturn("json");
    when(command.getRelativeUrl()).thenReturn("index/type/id");
    step.executeInitCommand(client, log, command);
    verify(client).put("/index/type/id", "json");
}
Also used : ElasticsearchCommand(com.github.alexcojocaru.mojo.elasticsearch.v2.client.ElasticsearchCommand) Test(org.junit.Test)

Aggregations

ElasticsearchCommand (com.github.alexcojocaru.mojo.elasticsearch.v2.client.ElasticsearchCommand)5 Test (org.junit.Test)4 ElasticsearchSetupException (com.github.alexcojocaru.mojo.elasticsearch.v2.ElasticsearchSetupException)2 ElasticsearchClientException (com.github.alexcojocaru.mojo.elasticsearch.v2.client.ElasticsearchClientException)2