@Test
public void errorMessageContainsFailedItemBulkErrorInfoIfAvailableAndErrorsIsTrue() {

    // given
    String expectedType = UUID.randomUUID().toString();
    String expectedReason = UUID.randomUUID().toString();
    BulkError error = new BulkError();
    error.setType(expectedType);
    error.setReason(expectedReason);
    BulkResultItem successfulItem = new BulkResultItem();
    BulkResultItem failed = new BulkResultItem();
    failed.setBulkError(error);
    List<BulkResultItem> items = new ArrayList<>();
    items.add(successfulItem);
    items.add(failed);
    BufferedBulkResult result = createTestBufferedBulkResult(true, null, items);
    // when
    String actualMessage = result.getErrorMessage(DEFAULT_TEST_MESSAGE);
    // then
    assertTrue(actualMessage.contains(expectedType));
    assertTrue(actualMessage.contains(expectedReason));
}