@Test public void testConfigureIntegrationRuntimeException() { doThrow(IntegrationRuntimeException.class).when(properties).getIntegrationBridge(); assertFalse(service.configure()); }
public boolean configure() { LOGGER.info("Retrieving applications.\n"); Map<String, Application> applications = properties.getApplications(); Map<String, ApplicationState> summary = new LinkedHashMap<>(); String appId = StringUtils.EMPTY; for (Map.Entry<String, Application> entry : applications.entrySet()) { try { Application application = entry.getValue(); appId = entry.getKey(); fillInApplicationInfo(appId, application); if (ApplicationState.PROVISIONED.equals(application.getState())) { provisioningApplication(application); } else { disableApplication(application); } summary.put(appId, application.getState()); } catch (IntegrationRuntimeException e) { LOGGER.error(logMessage.getMessage(APP_FAIL, appId, e.getMessage())); summary.put(appId, ApplicationState.FAILED); } catch (Exception e) { LOGGER.error(logMessage.getMessage(APP_FAIL, appId, StringUtils.EMPTY), e); summary.put(appId, ApplicationState.FAILED); } } Collection<ApplicationState> appStatus = summary.values(); boolean failedOrSkippedApps = appStatus.contains(ApplicationState.FAILED) || appStatus.contains(ApplicationState.UNKNOWN) || appStatus.contains(ApplicationState.SKIPPED); printSummary(summary); return !failedOrSkippedApps; }
IntegrationProvisioningService { public boolean configure() { LOGGER.info("Retrieving applications.\n"); Map<String, Application> applications = properties.getApplications(); Map<String, ApplicationState> summary = new LinkedHashMap<>(); String appId = StringUtils.EMPTY; for (Map.Entry<String, Application> entry : applications.entrySet()) { try { Application application = entry.getValue(); appId = entry.getKey(); fillInApplicationInfo(appId, application); if (ApplicationState.PROVISIONED.equals(application.getState())) { provisioningApplication(application); } else { disableApplication(application); } summary.put(appId, application.getState()); } catch (IntegrationRuntimeException e) { LOGGER.error(logMessage.getMessage(APP_FAIL, appId, e.getMessage())); summary.put(appId, ApplicationState.FAILED); } catch (Exception e) { LOGGER.error(logMessage.getMessage(APP_FAIL, appId, StringUtils.EMPTY), e); summary.put(appId, ApplicationState.FAILED); } } Collection<ApplicationState> appStatus = summary.values(); boolean failedOrSkippedApps = appStatus.contains(ApplicationState.FAILED) || appStatus.contains(ApplicationState.UNKNOWN) || appStatus.contains(ApplicationState.SKIPPED); printSummary(summary); return !failedOrSkippedApps; } }
IntegrationProvisioningService { public boolean configure() { LOGGER.info("Retrieving applications.\n"); Map<String, Application> applications = properties.getApplications(); Map<String, ApplicationState> summary = new LinkedHashMap<>(); String appId = StringUtils.EMPTY; for (Map.Entry<String, Application> entry : applications.entrySet()) { try { Application application = entry.getValue(); appId = entry.getKey(); fillInApplicationInfo(appId, application); if (ApplicationState.PROVISIONED.equals(application.getState())) { provisioningApplication(application); } else { disableApplication(application); } summary.put(appId, application.getState()); } catch (IntegrationRuntimeException e) { LOGGER.error(logMessage.getMessage(APP_FAIL, appId, e.getMessage())); summary.put(appId, ApplicationState.FAILED); } catch (Exception e) { LOGGER.error(logMessage.getMessage(APP_FAIL, appId, StringUtils.EMPTY), e); summary.put(appId, ApplicationState.FAILED); } } Collection<ApplicationState> appStatus = summary.values(); boolean failedOrSkippedApps = appStatus.contains(ApplicationState.FAILED) || appStatus.contains(ApplicationState.UNKNOWN) || appStatus.contains(ApplicationState.SKIPPED); printSummary(summary); return !failedOrSkippedApps; }  }
IntegrationProvisioningService { public boolean configure() { LOGGER.info("Retrieving applications.\n"); Map<String, Application> applications = properties.getApplications(); Map<String, ApplicationState> summary = new LinkedHashMap<>(); String appId = StringUtils.EMPTY; for (Map.Entry<String, Application> entry : applications.entrySet()) { try { Application application = entry.getValue(); appId = entry.getKey(); fillInApplicationInfo(appId, application); if (ApplicationState.PROVISIONED.equals(application.getState())) { provisioningApplication(application); } else { disableApplication(application); } summary.put(appId, application.getState()); } catch (IntegrationRuntimeException e) { LOGGER.error(logMessage.getMessage(APP_FAIL, appId, e.getMessage())); summary.put(appId, ApplicationState.FAILED); } catch (Exception e) { LOGGER.error(logMessage.getMessage(APP_FAIL, appId, StringUtils.EMPTY), e); summary.put(appId, ApplicationState.FAILED); } } Collection<ApplicationState> appStatus = summary.values(); boolean failedOrSkippedApps = appStatus.contains(ApplicationState.FAILED) || appStatus.contains(ApplicationState.UNKNOWN) || appStatus.contains(ApplicationState.SKIPPED); printSummary(summary); return !failedOrSkippedApps; }  boolean configure(); }
IntegrationProvisioningService { public boolean configure() { LOGGER.info("Retrieving applications.\n"); Map<String, Application> applications = properties.getApplications(); Map<String, ApplicationState> summary = new LinkedHashMap<>(); String appId = StringUtils.EMPTY; for (Map.Entry<String, Application> entry : applications.entrySet()) { try { Application application = entry.getValue(); appId = entry.getKey(); fillInApplicationInfo(appId, application); if (ApplicationState.PROVISIONED.equals(application.getState())) { provisioningApplication(application); } else { disableApplication(application); } summary.put(appId, application.getState()); } catch (IntegrationRuntimeException e) { LOGGER.error(logMessage.getMessage(APP_FAIL, appId, e.getMessage())); summary.put(appId, ApplicationState.FAILED); } catch (Exception e) { LOGGER.error(logMessage.getMessage(APP_FAIL, appId, StringUtils.EMPTY), e); summary.put(appId, ApplicationState.FAILED); } } Collection<ApplicationState> appStatus = summary.values(); boolean failedOrSkippedApps = appStatus.contains(ApplicationState.FAILED) || appStatus.contains(ApplicationState.UNKNOWN) || appStatus.contains(ApplicationState.SKIPPED); printSummary(summary); return !failedOrSkippedApps; }  boolean configure();  }