use of org.graylog2.storage.SearchVersion in project graylog2-server by Graylog2.
the class NodeAdapterES6Test method retrievingVersionSucceedsIfElasticsearchVersionIsValid.
@Test
public void retrievingVersionSucceedsIfElasticsearchVersionIsValid() throws Exception {
final JestResult jestResult = mock(JestResult.class);
when(jestResult.isSucceeded()).thenReturn(true);
when(jestResult.getJsonObject()).thenReturn(buildVersionJsonObject("5.4.0"));
when(jestClient.execute(any(Ping.class))).thenReturn(jestResult);
final Optional<SearchVersion> elasticsearchVersion = nodeAdapter.version();
assertThat(elasticsearchVersion).contains(SearchVersion.elasticsearch("5.4.0"));
}
Aggregations