@Override
    public String getOperationName(Exchange exchange, Endpoint endpoint) {
        Map<String, String> queryParameters = toQueryParameters(endpoint.getEndpointUri());
        return queryParameters.containsKey("operation")
                ? queryParameters.get("operation")
                : super.getOperationName(exchange, endpoint);
    }
@Test
    public void testOperationName() {
        String opName = "INDEX";
        Endpoint endpoint = Mockito.mock(Endpoint.class);

        Mockito.when(endpoint.getEndpointUri()).thenReturn("elasticsearch://local?operation="
                                                           + opName + "&indexName=twitter&indexType=tweet");

        SpanDecorator decorator = new ElasticsearchSpanDecorator();

        assertEquals(opName, decorator.getOperationName(null, endpoint));
    }