@Test public void testEmptyRepositoryProvidesDefaultConfiguration() throws IOException { final Storage storage = setupMockStorage(null); final InputStream configuration = new StoredOrDefaultConfigurationProvider(storage).getConfigurationStream(); final InputStream expectedStream = getClass().getResourceAsStream("cloud-jenkins-defaults-assembly.zip"); assertArrayEquals(IOUtils.toByteArray(expectedStream), IOUtils.toByteArray(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();  }