@Test
public void testGetStatusInFossology() throws Exception {

    int uploadId = 42;
    fossologyUploader = spy(fossologyUploader);
    String clearingTeam = "team d";
    final String output = "output result\nfrom the get status script";
    doAnswer(new Answer() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            final OutputStream os = (OutputStream) invocation.getArguments()[1];
            os.write(output.getBytes());
            return 0;
        }
    }).when(sshConnector).runInFossologyViaSsh(anyString(), any(OutputStream.class));
    FossologyStatus parseResult = FossologyStatus.IN_PROGRESS;
    doReturn(parseResult).when(fossologyUploader).parseResultStatus(output);
    FossologyStatus statusInFossology = fossologyUploader.getStatusInFossology(uploadId, clearingTeam);
    assertThat(statusInFossology, is(parseResult));
    verify(fossologyUploader).parseResultStatus(output);
    verify(sshConnector).runInFossologyViaSsh(anyString(), any(OutputStream.class));
    verify(fossologyUploader).getStatusInFossology(uploadId, clearingTeam);
}