@Test
public void testIllegalStateIsCaught() throws IOException {

    SW360UpdaterImpl updaterImpl = mock(SW360UpdaterImpl.class);
    when(updaterImpl.artifactToReleaseInSW360(any(), any()))
            .thenReturn(SW360TestUtils.mkSW360Release("test"));
    String propertiesFilePath = Objects.requireNonNull(this.getClass().getClassLoader().getResource("compliancetool-updater.properties")).getPath();
    final Map<String, String> properties = ComplianceFeatureUtils.mapPropertiesFile(new File(propertiesFilePath));
    initConfiguration(properties);
    SW360ReleaseClientAdapter releaseClientAdapter = mock(SW360ReleaseClientAdapter.class);
    SW360Connection connection = mock(SW360Connection.class);
    when(connection.getReleaseAdapter())
            .thenReturn(releaseClientAdapter);
    final ClearingReportGenerator clearingReportGenerator = mock(ClearingReportGenerator.class);
    when(clearingReportGenerator.createClearingDocument(any(), any()))
            .thenThrow(new SW360ClientException("Clearing doc generation error"));
    SW360Updater updater = new SW360Updater(updaterImpl, configurationMock, clearingReportGenerator);
    updater.execute();
    verify(releaseClientAdapter, never()).uploadAttachments(any());
    // TODO after #593 is fixed, put the test method in SW360UpdaterTestWithFailure in SW360UpdaterTest
}