@Test
public void errorMessageContainsRootBulkErrorInfoIfAvailable() {

    // given
    String expectedType = UUID.randomUUID().toString();
    String expectedReason = UUID.randomUUID().toString();
    BulkError error = new BulkError();
    error.setType(expectedType);
    error.setReason(expectedReason);
    BufferedBulkResult result = createTestBufferedBulkResult(false, error);
    // when
    String actualMessage = result.getErrorMessage(DEFAULT_TEST_MESSAGE);
    // then
    assertTrue(actualMessage.contains(expectedType));
    assertTrue(actualMessage.contains(expectedReason));
}