@Test public void testGetConfigurationFromECM() throws IOException { final InputStream expectedInputStream = mock(InputStream.class); final Storage storage = setupMockStorage(expectedInputStream); final InputStream configuration = new StoredOrDefaultConfigurationProvider(storage).getConfigurationStream(); assertSame(expectedInputStream, configuration); }
@Override public InputStream getConfigurationStream() { final InputStream configuration = storage.load(); if (configuration != null) { return configuration; } return getClass().getResourceAsStream("cloud-jenkins-defaults-assembly.zip"); }
StoredOrDefaultConfigurationProvider implements ConfigurationProvider { @Override public InputStream getConfigurationStream() { final InputStream configuration = storage.load(); if (configuration != null) { return configuration; } return getClass().getResourceAsStream("cloud-jenkins-defaults-assembly.zip"); } }
StoredOrDefaultConfigurationProvider implements ConfigurationProvider { @Override public InputStream getConfigurationStream() { final InputStream configuration = storage.load(); if (configuration != null) { return configuration; } return getClass().getResourceAsStream("cloud-jenkins-defaults-assembly.zip"); } StoredOrDefaultConfigurationProvider(final Storage storage); }
StoredOrDefaultConfigurationProvider implements ConfigurationProvider { @Override public InputStream getConfigurationStream() { final InputStream configuration = storage.load(); if (configuration != null) { return configuration; } return getClass().getResourceAsStream("cloud-jenkins-defaults-assembly.zip"); } StoredOrDefaultConfigurationProvider(final Storage storage); @Override InputStream getConfigurationStream(); @Override Storage getStorage(); }
StoredOrDefaultConfigurationProvider implements ConfigurationProvider { @Override public InputStream getConfigurationStream() { final InputStream configuration = storage.load(); if (configuration != null) { return configuration; } return getClass().getResourceAsStream("cloud-jenkins-defaults-assembly.zip"); } StoredOrDefaultConfigurationProvider(final Storage storage); @Override InputStream getConfigurationStream(); @Override Storage getStorage();  }