CachedConfigurationSource implements ConfigurationSource { @Override public void init() { underlyingSource.init(); } CachedConfigurationSource(ConfigurationSource underlyingSource); @Override Properties getConfiguration(Environment environment); @Override void init(); void reload(Environment environment);  }
@Test void initPropagatesMissingEnvExceptions() { doThrow(new MissingEnvironmentException("")).when(delegateSource).init(); assertThatThrownBy(() -> cachedConfigurationSource.init()).isExactlyInstanceOf(MissingEnvironmentException.class); }
@Test void initPropagatesIllegalStateExceptions() { doThrow(new IllegalStateException("")).when(delegateSource).init(); assertThatThrownBy(() -> cachedConfigurationSource.init()).isExactlyInstanceOf(IllegalStateException.class); }