@Test
public void testRunInFossologyViaSsh3() throws Exception {

    OutputStream stdout = mock(OutputStream.class);
    doAnswer(new Answer<Integer>() {
        @Override
        public Integer answer(InvocationOnMock invocation) throws Throwable {
            final Object[] arguments = invocation.getArguments();
            final InputStream inputStream = (InputStream) arguments[1];
            assertThat(inputStream.read(), is(-1));
            return 1;
        }
    }).when(fossologySshConnector).runInFossologyViaSsh(anyString(), any(InputStream.class), any(OutputStream.class));
    final int exitCode = fossologySshConnector.runInFossologyViaSsh("cmd", stdout);
    assertThat(exitCode, greaterThanOrEqualTo(0));
    verify(fossologySshConnector).runInFossologyViaSsh(eq("cmd"), any(InputStream.class), eq(stdout));
}