diff options
Diffstat (limited to 'container-core/src/test/java/com/yahoo/osgi/provider/model/ComponentModelTest.java')
-rw-r--r-- | container-core/src/test/java/com/yahoo/osgi/provider/model/ComponentModelTest.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/container-core/src/test/java/com/yahoo/osgi/provider/model/ComponentModelTest.java b/container-core/src/test/java/com/yahoo/osgi/provider/model/ComponentModelTest.java index a1e533158b5..c1f4991cfcc 100644 --- a/container-core/src/test/java/com/yahoo/osgi/provider/model/ComponentModelTest.java +++ b/container-core/src/test/java/com/yahoo/osgi/provider/model/ComponentModelTest.java @@ -2,9 +2,10 @@ package com.yahoo.osgi.provider.model; import com.yahoo.container.bundle.BundleInstantiationSpecification; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; /** * @author gjoranv @@ -12,19 +13,21 @@ import static org.junit.Assert.assertEquals; public class ComponentModelTest { @Test - public void create_from_instantiation_spec() { + void create_from_instantiation_spec() { ComponentModel model = new ComponentModel( BundleInstantiationSpecification.fromStrings("id", "class", "bundle")); verifyBundleSpec(model); } - @Test(expected = IllegalArgumentException.class) - public void require_exception_upon_null_instantiation_spec() throws Exception { - ComponentModel model = new ComponentModel(null); + @Test + void require_exception_upon_null_instantiation_spec() throws Exception { + assertThrows(IllegalArgumentException.class, () -> { + ComponentModel model = new ComponentModel(null); + }); } @Test - public void create_from_instantiation_spec_and_config_id() throws Exception { + void create_from_instantiation_spec_and_config_id() throws Exception { ComponentModel model = new ComponentModel( BundleInstantiationSpecification.fromStrings("id", "class", "bundle"), "configId"); verifyBundleSpec(model); @@ -32,7 +35,7 @@ public class ComponentModelTest { } @Test - public void create_from_strings() throws Exception { + void create_from_strings() throws Exception { ComponentModel model = new ComponentModel("id", "class", "bundle", "configId"); verifyBundleSpec(model); assertEquals("configId", model.configId); |