diff options
Diffstat (limited to 'container-disc/src/test/java/com/yahoo/container/jdisc/DisableOsgiFrameworkTest.java')
-rw-r--r-- | container-disc/src/test/java/com/yahoo/container/jdisc/DisableOsgiFrameworkTest.java | 60 |
1 files changed, 38 insertions, 22 deletions
diff --git a/container-disc/src/test/java/com/yahoo/container/jdisc/DisableOsgiFrameworkTest.java b/container-disc/src/test/java/com/yahoo/container/jdisc/DisableOsgiFrameworkTest.java index 46acd5ce2b8..f6b2424e0e1 100644 --- a/container-disc/src/test/java/com/yahoo/container/jdisc/DisableOsgiFrameworkTest.java +++ b/container-disc/src/test/java/com/yahoo/container/jdisc/DisableOsgiFrameworkTest.java @@ -1,47 +1,63 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.jdisc; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.osgi.framework.BundleException; +import static org.junit.jupiter.api.Assertions.assertThrows; + /** * @author Ulf Lilleengen */ public class DisableOsgiFrameworkTest { - @Test(expected = RuntimeException.class) - public void require_that_installBundle_throws_exception() throws BundleException { - new DisableOsgiFramework().installBundle("foo"); + @Test + void require_that_installBundle_throws_exception() throws BundleException { + assertThrows(RuntimeException.class, () -> { + new DisableOsgiFramework().installBundle("foo"); + }); } - @Test(expected = RuntimeException.class) - public void require_that_startBundles_throws_exception() throws BundleException { - new DisableOsgiFramework().startBundles(null, true); + @Test + void require_that_startBundles_throws_exception() throws BundleException { + assertThrows(RuntimeException.class, () -> { + new DisableOsgiFramework().startBundles(null, true); + }); } - @Test(expected = RuntimeException.class) - public void require_that_bundleContext_throws_exception() throws BundleException { - new DisableOsgiFramework().bundleContext(); + @Test + void require_that_bundleContext_throws_exception() throws BundleException { + assertThrows(RuntimeException.class, () -> { + new DisableOsgiFramework().bundleContext(); + }); } - @Test(expected = RuntimeException.class) - public void require_that_refreshPackages_throws_exception() { - new DisableOsgiFramework().refreshPackages(); + @Test + void require_that_refreshPackages_throws_exception() { + assertThrows(RuntimeException.class, () -> { + new DisableOsgiFramework().refreshPackages(); + }); } - @Test(expected = RuntimeException.class) - public void require_that_bundles_throws_exception() { - new DisableOsgiFramework().bundles(); + @Test + void require_that_bundles_throws_exception() { + assertThrows(RuntimeException.class, () -> { + new DisableOsgiFramework().bundles(); + }); } - @Test(expected = RuntimeException.class) - public void require_that_start_throws_exception() throws BundleException { - new DisableOsgiFramework().start(); + @Test + void require_that_start_throws_exception() throws BundleException { + assertThrows(RuntimeException.class, () -> { + new DisableOsgiFramework().start(); + }); } - @Test(expected = RuntimeException.class) - public void require_that_stop_throws_exception() throws BundleException { - new DisableOsgiFramework().stop(); + @Test + void require_that_stop_throws_exception() throws BundleException { + assertThrows(RuntimeException.class, () -> { + new DisableOsgiFramework().stop(); + }); } } |