@Test
public void createsFailedItemMetadata() {

    // given
    HCFailedItemOps failedItemOps = new HCFailedItemOps();
    ItemSource<ByteBuf> itemSource = mock(ItemSource.class);
    ByteBuf expectedSource = mock(ByteBuf.class);
    when(itemSource.getSource()).thenReturn(expectedSource);
    String expectedIndex = UUID.randomUUID().toString();
    IndexRequest request = createDefaultTestIndexRequest(itemSource, expectedIndex);
    // when
    FailedItemInfo result = failedItemOps.createInfo(request);
    // then
    assertEquals(expectedIndex, result.getTargetName());
}