public void updateState(List<TridentTuple> tuples) {
        try {
            String bulkRequest = buildRequest(tuples);

            final Request request = new Request("post", "_bulk");
            request.setEntity(new StringEntity(bulkRequest));
            Response response = client.performRequest(request);
            BulkIndexResponse bulkResponse = objectMapper.readValue(response.getEntity().getContent(), BulkIndexResponse.class);
            if (bulkResponse.hasErrors()) {
                LOG.warn("failed processing bulk index requests: " + bulkResponse.getFirstError() + ": " + bulkResponse.getFirstResult());
                throw new FailedException();
            }
        } catch (IOException e) {
            LOG.warn("failed processing bulk index requests: " + e.toString());
            throw new FailedException(e);
        }
    }
@Test
    public void updateState() throws Exception {
        List<TridentTuple> tuples = tuples(index, type, documentId, source);
        state.updateState(tuples);
    }