@Test(expected = InitializationConfigException.class) public void failLoad() { doReturn("error-configuration.json").when(environment) .getProperty(CONFIG_ENV_PROPERTY, DEFAULT_FILE_NAME); service.init(); }
@Override @PostConstruct public void init() { this.fileName = environment.getProperty("config.filename", DEFAULT_FILE_NAME); this.mapper.configure(SerializationFeature.INDENT_OUTPUT, true); this.mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); InputStream input = null; try { input = getInputStream(); this.repository = mapper.readValue(input, IntegrationRepository.class); LOGGER.info("File {} loaded successfully", fileName); } catch (IOException e) { String message = logMessage.getMessage(CONFIGURATION_FILE_EXCEPTION, fileName); String solution = logMessage.getMessage(CONFIGURATION_FILE_EXCEPTION_SOLUTION, fileName); throw new InitializationConfigException(message, e, solution); } finally { closeStream(input); } }
LocalIntegrationService implements IntegrationService { @Override @PostConstruct public void init() { this.fileName = environment.getProperty("config.filename", DEFAULT_FILE_NAME); this.mapper.configure(SerializationFeature.INDENT_OUTPUT, true); this.mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); InputStream input = null; try { input = getInputStream(); this.repository = mapper.readValue(input, IntegrationRepository.class); LOGGER.info("File {} loaded successfully", fileName); } catch (IOException e) { String message = logMessage.getMessage(CONFIGURATION_FILE_EXCEPTION, fileName); String solution = logMessage.getMessage(CONFIGURATION_FILE_EXCEPTION_SOLUTION, fileName); throw new InitializationConfigException(message, e, solution); } finally { closeStream(input); } } }
LocalIntegrationService implements IntegrationService { @Override @PostConstruct public void init() { this.fileName = environment.getProperty("config.filename", DEFAULT_FILE_NAME); this.mapper.configure(SerializationFeature.INDENT_OUTPUT, true); this.mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); InputStream input = null; try { input = getInputStream(); this.repository = mapper.readValue(input, IntegrationRepository.class); LOGGER.info("File {} loaded successfully", fileName); } catch (IOException e) { String message = logMessage.getMessage(CONFIGURATION_FILE_EXCEPTION, fileName); String solution = logMessage.getMessage(CONFIGURATION_FILE_EXCEPTION_SOLUTION, fileName); throw new InitializationConfigException(message, e, solution); } finally { closeStream(input); } }  }
LocalIntegrationService implements IntegrationService { @Override @PostConstruct public void init() { this.fileName = environment.getProperty("config.filename", DEFAULT_FILE_NAME); this.mapper.configure(SerializationFeature.INDENT_OUTPUT, true); this.mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); InputStream input = null; try { input = getInputStream(); this.repository = mapper.readValue(input, IntegrationRepository.class); LOGGER.info("File {} loaded successfully", fileName); } catch (IOException e) { String message = logMessage.getMessage(CONFIGURATION_FILE_EXCEPTION, fileName); String solution = logMessage.getMessage(CONFIGURATION_FILE_EXCEPTION_SOLUTION, fileName); throw new InitializationConfigException(message, e, solution); } finally { closeStream(input); } }  @Override @PostConstruct void init(); @Override IntegrationSettings getIntegrationById(String integrationId, String userId); @Override IntegrationSettings getIntegrationByType(String integrationType, String userId); @Override IntegrationSettings save(IntegrationSettings settings, String usedId); @Override IntegrationInstance getInstanceById(String configurationId, String instanceId,
      String userId); @Override IntegrationInstance save(IntegrationInstance instance, String userId); }
LocalIntegrationService implements IntegrationService { @Override @PostConstruct public void init() { this.fileName = environment.getProperty("config.filename", DEFAULT_FILE_NAME); this.mapper.configure(SerializationFeature.INDENT_OUTPUT, true); this.mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); InputStream input = null; try { input = getInputStream(); this.repository = mapper.readValue(input, IntegrationRepository.class); LOGGER.info("File {} loaded successfully", fileName); } catch (IOException e) { String message = logMessage.getMessage(CONFIGURATION_FILE_EXCEPTION, fileName); String solution = logMessage.getMessage(CONFIGURATION_FILE_EXCEPTION_SOLUTION, fileName); throw new InitializationConfigException(message, e, solution); } finally { closeStream(input); } }  @Override @PostConstruct void init(); @Override IntegrationSettings getIntegrationById(String integrationId, String userId); @Override IntegrationSettings getIntegrationByType(String integrationType, String userId); @Override IntegrationSettings save(IntegrationSettings settings, String usedId); @Override IntegrationInstance getInstanceById(String configurationId, String instanceId,
      String userId); @Override IntegrationInstance save(IntegrationInstance instance, String userId);  }