@Test void getMailetContextConfigurationShouldReturnEmptyWhenNoContextSection() throws Exception { ConfigurationProvider configurationProvider = mock(ConfigurationProvider.class); when(configurationProvider.getConfiguration("mailetcontainer")) .thenReturn(new BaseHierarchicalConfiguration()); CamelMailetContainerModule testee = new CamelMailetContainerModule(); assertThat(testee.getMailetContextConfiguration(configurationProvider).size()) .isEqualTo(0); }
@VisibleForTesting HierarchicalConfiguration<ImmutableNode> getMailetContextConfiguration(ConfigurationProvider configurationProvider) throws ConfigurationException { HierarchicalConfiguration<ImmutableNode> mailetContainerConfiguration = configurationProvider.getConfiguration("mailetcontainer"); try { return mailetContainerConfiguration.configurationAt("context"); } catch (ConfigurationRuntimeException e) { LOGGER.warn("Could not locate configuration for Mailet context. Assuming empty configuration for this component."); return new BaseHierarchicalConfiguration(); } }
CamelMailetContainerModule extends AbstractModule { @VisibleForTesting HierarchicalConfiguration<ImmutableNode> getMailetContextConfiguration(ConfigurationProvider configurationProvider) throws ConfigurationException { HierarchicalConfiguration<ImmutableNode> mailetContainerConfiguration = configurationProvider.getConfiguration("mailetcontainer"); try { return mailetContainerConfiguration.configurationAt("context"); } catch (ConfigurationRuntimeException e) { LOGGER.warn("Could not locate configuration for Mailet context. Assuming empty configuration for this component."); return new BaseHierarchicalConfiguration(); } } }
CamelMailetContainerModule extends AbstractModule { @VisibleForTesting HierarchicalConfiguration<ImmutableNode> getMailetContextConfiguration(ConfigurationProvider configurationProvider) throws ConfigurationException { HierarchicalConfiguration<ImmutableNode> mailetContainerConfiguration = configurationProvider.getConfiguration("mailetcontainer"); try { return mailetContainerConfiguration.configurationAt("context"); } catch (ConfigurationRuntimeException e) { LOGGER.warn("Could not locate configuration for Mailet context. Assuming empty configuration for this component."); return new BaseHierarchicalConfiguration(); } }  }
CamelMailetContainerModule extends AbstractModule { @VisibleForTesting HierarchicalConfiguration<ImmutableNode> getMailetContextConfiguration(ConfigurationProvider configurationProvider) throws ConfigurationException { HierarchicalConfiguration<ImmutableNode> mailetContainerConfiguration = configurationProvider.getConfiguration("mailetcontainer"); try { return mailetContainerConfiguration.configurationAt("context"); } catch (ConfigurationRuntimeException e) { LOGGER.warn("Could not locate configuration for Mailet context. Assuming empty configuration for this component."); return new BaseHierarchicalConfiguration(); } }  @Singleton @Provides DefaultCamelContext provideCamelContext(); }
CamelMailetContainerModule extends AbstractModule { @VisibleForTesting HierarchicalConfiguration<ImmutableNode> getMailetContextConfiguration(ConfigurationProvider configurationProvider) throws ConfigurationException { HierarchicalConfiguration<ImmutableNode> mailetContainerConfiguration = configurationProvider.getConfiguration("mailetcontainer"); try { return mailetContainerConfiguration.configurationAt("context"); } catch (ConfigurationRuntimeException e) { LOGGER.warn("Could not locate configuration for Mailet context. Assuming empty configuration for this component."); return new BaseHierarchicalConfiguration(); } }  @Singleton @Provides DefaultCamelContext provideCamelContext(); static final TransportProcessorCheck.Impl BCC_Check; }