@Test
public void testUploadToFossologyWithNonIntReturn() throws Exception {

    AttachmentContent attachment = mock(AttachmentContent.class);
    when(attachment.getId()).thenReturn("id");
    when(attachment.getFilename()).thenReturn("fileName");
    String clearingTeam = "cl";
    final InputStream inputStream = mock(InputStream.class);
    doAnswer(new Answer() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            OutputStream outputStream = (OutputStream) invocation.getArguments()[2];
            outputStream.write("uploadId=60000000000000000".getBytes());
            return 0;
        }
    }).when(sshConnector).runInFossologyViaSsh(anyString(), eq(inputStream), any(OutputStream.class));
    final long uploadId = fossologyUploader.uploadToFossology(inputStream, attachment, clearingTeam);
    verify(sshConnector).runInFossologyViaSsh(anyString(), eq(inputStream), any(OutputStream.class));
    assertThat(uploadId, is((long) -1));
}