@Test
public void testCommandToPublisher() throws Exception {

    // Given
    HystrixCommand<InputStream> command = new InputStreamTestCommand();
    final Publisher<CommandHelperTestData> publisher =
            CommandHelper.toPublisher(CommandHelperTestData.class, mapper, command);
    final List<CommandHelperTestData> receivedData = new ArrayList<>();
    // When
    Flux.from(publisher).subscribe(receivedData::add);
    // Then
    assertEquals(3, receivedData.size());
    assertEquals("1", receivedData.get(0).getValue());
    assertEquals("2", receivedData.get(1).getValue());
    assertEquals("3", receivedData.get(2).getValue());
}