diff options
Diffstat (limited to 'container-core/src/test/java/com/yahoo/container/core/config')
2 files changed, 19 insertions, 23 deletions
diff --git a/container-core/src/test/java/com/yahoo/container/core/config/ApplicationBundleLoaderTest.java b/container-core/src/test/java/com/yahoo/container/core/config/ApplicationBundleLoaderTest.java index ee71e8a8f4c..b56e5d99123 100644 --- a/container-core/src/test/java/com/yahoo/container/core/config/ApplicationBundleLoaderTest.java +++ b/container-core/src/test/java/com/yahoo/container/core/config/ApplicationBundleLoaderTest.java @@ -2,6 +2,9 @@ package com.yahoo.container.core.config; import com.yahoo.config.FileReference; +import com.yahoo.filedistribution.fileacquirer.FileAcquirer; +import com.yahoo.filedistribution.fileacquirer.MockFileAcquirer; +import com.yahoo.osgi.Osgi; import org.junit.Before; import org.junit.Test; import org.osgi.framework.Bundle; @@ -29,9 +32,9 @@ public class ApplicationBundleLoaderTest { @Before public void setup() { osgi = new TestOsgi(testBundles()); - var bundleInstaller = new TestBundleInstaller(); - bundleLoader = new ApplicationBundleLoader(osgi); - bundleLoader.useCustomBundleInstaller(bundleInstaller); + var bundleInstaller = new TestBundleInstaller(MockFileAcquirer.returnFile(null)); + + bundleLoader = new ApplicationBundleLoader(osgi, bundleInstaller); } @Test @@ -103,4 +106,17 @@ public class ApplicationBundleLoaderTest { BUNDLE_2_REF.value(), BUNDLE_2); } + static class TestBundleInstaller extends FileAcquirerBundleInstaller { + + TestBundleInstaller(FileAcquirer fileAcquirer) { + super(fileAcquirer); + } + + @Override + public List<Bundle> installBundles(FileReference reference, Osgi osgi) { + return osgi.install(reference.value()); + } + + } + } diff --git a/container-core/src/test/java/com/yahoo/container/core/config/TestBundleInstaller.java b/container-core/src/test/java/com/yahoo/container/core/config/TestBundleInstaller.java deleted file mode 100644 index 43a5268eabf..00000000000 --- a/container-core/src/test/java/com/yahoo/container/core/config/TestBundleInstaller.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.container.core.config; - -import com.yahoo.config.FileReference; -import com.yahoo.osgi.Osgi; -import org.osgi.framework.Bundle; - -import java.util.List; - -/** - * @author gjoranv - */ -class TestBundleInstaller implements BundleInstaller { - - @Override - public List<Bundle> installBundles(FileReference reference, Osgi osgi) { - return osgi.install(reference.value()); - } - -} |