@Test public void successBatchOperationCall() { test = new BatchOperationCallable( ComprehendOperationEnum.DetectSentiment, TestConstants.LANGUAGE_CODE, mockComprehendClient, TestConstants.FIELD_LOCATOR_LIST, TestConstants.CONTENT_LIST); when(mockComprehendClient.batchDetectSentiment(any(BatchDetectSentimentRequest.class))) .thenReturn(mockBatchDetectSentimentResult); assertEquals(1, test.call().getLocatorList().size()); }
@Override public BatchResponse call() { try { return comprehendOperation.getComprehendOperation() .sendBatchRequest(fieldLocatorList, contentList, languageCode, comprehendClient); } catch (AmazonServiceException e) { return new BatchResponse<>(fieldLocatorList, Collections.emptyList(), getBatchItemErrors(e.getErrorCode(), e.getErrorMessage()), null); } catch (AmazonClientException e) { return new BatchResponse<>(fieldLocatorList, Collections.emptyList(), getBatchItemErrors(Constants.CLIENT_EXCEPTION_ERROR_CODE, e.getMessage()), null); } }
BatchOperationCallable implements Callable<BatchResponse> { @Override public BatchResponse call() { try { return comprehendOperation.getComprehendOperation() .sendBatchRequest(fieldLocatorList, contentList, languageCode, comprehendClient); } catch (AmazonServiceException e) { return new BatchResponse<>(fieldLocatorList, Collections.emptyList(), getBatchItemErrors(e.getErrorCode(), e.getErrorMessage()), null); } catch (AmazonClientException e) { return new BatchResponse<>(fieldLocatorList, Collections.emptyList(), getBatchItemErrors(Constants.CLIENT_EXCEPTION_ERROR_CODE, e.getMessage()), null); } } }
BatchOperationCallable implements Callable<BatchResponse> { @Override public BatchResponse call() { try { return comprehendOperation.getComprehendOperation() .sendBatchRequest(fieldLocatorList, contentList, languageCode, comprehendClient); } catch (AmazonServiceException e) { return new BatchResponse<>(fieldLocatorList, Collections.emptyList(), getBatchItemErrors(e.getErrorCode(), e.getErrorMessage()), null); } catch (AmazonClientException e) { return new BatchResponse<>(fieldLocatorList, Collections.emptyList(), getBatchItemErrors(Constants.CLIENT_EXCEPTION_ERROR_CODE, e.getMessage()), null); } }  }
BatchOperationCallable implements Callable<BatchResponse> { @Override public BatchResponse call() { try { return comprehendOperation.getComprehendOperation() .sendBatchRequest(fieldLocatorList, contentList, languageCode, comprehendClient); } catch (AmazonServiceException e) { return new BatchResponse<>(fieldLocatorList, Collections.emptyList(), getBatchItemErrors(e.getErrorCode(), e.getErrorMessage()), null); } catch (AmazonClientException e) { return new BatchResponse<>(fieldLocatorList, Collections.emptyList(), getBatchItemErrors(Constants.CLIENT_EXCEPTION_ERROR_CODE, e.getMessage()), null); } }  @Override BatchResponse call(); }
BatchOperationCallable implements Callable<BatchResponse> { @Override public BatchResponse call() { try { return comprehendOperation.getComprehendOperation() .sendBatchRequest(fieldLocatorList, contentList, languageCode, comprehendClient); } catch (AmazonServiceException e) { return new BatchResponse<>(fieldLocatorList, Collections.emptyList(), getBatchItemErrors(e.getErrorCode(), e.getErrorMessage()), null); } catch (AmazonClientException e) { return new BatchResponse<>(fieldLocatorList, Collections.emptyList(), getBatchItemErrors(Constants.CLIENT_EXCEPTION_ERROR_CODE, e.getMessage()), null); } }  @Override BatchResponse call();  }