diff --git a/kie-ci/pom.xml b/kie-ci/pom.xml index 4e5c85613ba..3aee239da18 100644 --- a/kie-ci/pom.xml +++ b/kie-ci/pom.xml @@ -150,10 +150,10 @@ - junit - junit + org.junit.jupiter + junit-jupiter test - + org.assertj diff --git a/kie-ci/src/test/java/org/kie/api/builder/helper/KieModuleDeploymentHelperLoadResourcesTest.java b/kie-ci/src/test/java/org/kie/api/builder/helper/KieModuleDeploymentHelperLoadResourcesTest.java index 4f4ae25e5b6..e5fee8b3dad 100644 --- a/kie-ci/src/test/java/org/kie/api/builder/helper/KieModuleDeploymentHelperLoadResourcesTest.java +++ b/kie-ci/src/test/java/org/kie/api/builder/helper/KieModuleDeploymentHelperLoadResourcesTest.java @@ -23,7 +23,7 @@ import java.util.List; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.builder.helper.KieModuleDeploymentHelperImpl.KJarResource; import static org.assertj.core.api.Assertions.assertThat; diff --git a/kie-ci/src/test/java/org/kie/api/builder/helper/KieModuleDeploymentHelperTest.java b/kie-ci/src/test/java/org/kie/api/builder/helper/KieModuleDeploymentHelperTest.java index def9532ac34..005054d8442 100644 --- a/kie-ci/src/test/java/org/kie/api/builder/helper/KieModuleDeploymentHelperTest.java +++ b/kie-ci/src/test/java/org/kie/api/builder/helper/KieModuleDeploymentHelperTest.java @@ -30,8 +30,8 @@ import org.drools.core.impl.EnvironmentImpl; import org.drools.core.test.model.Cheese; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.kie.api.builder.KieModule; import org.kie.api.builder.model.KieBaseModel; import org.kie.api.conf.EqualityBehaviorOption; @@ -49,7 +49,7 @@ public class KieModuleDeploymentHelperTest { private ZipInputStream zip; - @After + @AfterEach public void cleanUp() { if (zip != null) { try { diff --git a/kie-ci/src/test/java/org/kie/declarativetypes/JavaBeansEventRoleTest.java b/kie-ci/src/test/java/org/kie/declarativetypes/JavaBeansEventRoleTest.java index a196274469f..35a4c7c4396 100644 --- a/kie-ci/src/test/java/org/kie/declarativetypes/JavaBeansEventRoleTest.java +++ b/kie-ci/src/test/java/org/kie/declarativetypes/JavaBeansEventRoleTest.java @@ -20,7 +20,7 @@ import org.drools.base.rule.TypeMetaInfo; import org.drools.mvel.CommonTestMethodBase; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.KieServices; import org.kie.api.builder.KieBuilder; import org.kie.api.builder.KieFileSystem; diff --git a/kie-ci/src/test/java/org/kie/scanner/DependentScopeNamedBeanTest.java b/kie-ci/src/test/java/org/kie/scanner/DependentScopeNamedBeanTest.java index 8a7b98370fc..9ee8df1bee2 100644 --- a/kie-ci/src/test/java/org/kie/scanner/DependentScopeNamedBeanTest.java +++ b/kie-ci/src/test/java/org/kie/scanner/DependentScopeNamedBeanTest.java @@ -20,7 +20,7 @@ import java.io.InputStream; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.maven.integration.MavenPomModelGenerator; import org.kie.util.maven.support.PomModel; import org.kie.util.maven.support.PomModelGenerator; diff --git a/kie-ci/src/test/java/org/kie/scanner/KieModuleBuilderTest.java b/kie-ci/src/test/java/org/kie/scanner/KieModuleBuilderTest.java index bc7e0ad68c1..aa5c97d5832 100644 --- a/kie-ci/src/test/java/org/kie/scanner/KieModuleBuilderTest.java +++ b/kie-ci/src/test/java/org/kie/scanner/KieModuleBuilderTest.java @@ -26,9 +26,9 @@ import org.drools.compiler.kie.builder.impl.InternalKieModule; import org.drools.core.util.FileManager; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.kie.api.KieServices; import org.kie.api.builder.KieBuilder; import org.kie.api.builder.KieFileSystem; @@ -44,13 +44,13 @@ public class KieModuleBuilderTest extends AbstractKieCiTest { private FileManager fileManager; - @Before + @BeforeEach public void setUp() throws Exception { this.fileManager = new FileManager(); this.fileManager.setUp(); } - @After + @AfterEach public void tearDown() throws Exception { this.fileManager.tearDown(); } diff --git a/kie-ci/src/test/java/org/kie/scanner/KieModuleIncrementalCompilationTest.java b/kie-ci/src/test/java/org/kie/scanner/KieModuleIncrementalCompilationTest.java index 6f4d6e53be9..7b98d52502e 100644 --- a/kie-ci/src/test/java/org/kie/scanner/KieModuleIncrementalCompilationTest.java +++ b/kie-ci/src/test/java/org/kie/scanner/KieModuleIncrementalCompilationTest.java @@ -22,7 +22,7 @@ import java.util.HashMap; import org.drools.drl.parser.MessageImpl; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.KieServices; import org.kie.api.builder.KieBuilder; import org.kie.api.builder.KieFileSystem; diff --git a/kie-ci/src/test/java/org/kie/scanner/KieModuleMavenTest.java b/kie-ci/src/test/java/org/kie/scanner/KieModuleMavenTest.java index 2d66e152fb9..b3fb5961521 100644 --- a/kie-ci/src/test/java/org/kie/scanner/KieModuleMavenTest.java +++ b/kie-ci/src/test/java/org/kie/scanner/KieModuleMavenTest.java @@ -34,7 +34,7 @@ import org.drools.compiler.kie.builder.impl.KieRepositoryImpl; import org.drools.compiler.kie.builder.impl.KieServicesImpl; import org.drools.mvel.asm.DefaultBeanClassBuilder; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.KieBase; import org.kie.api.KieServices; import org.kie.api.builder.KieBuilder; diff --git a/kie-ci/src/test/java/org/kie/scanner/KieModuleMetaDataImplTest.java b/kie-ci/src/test/java/org/kie/scanner/KieModuleMetaDataImplTest.java index 830e851cb25..35c244e560e 100644 --- a/kie-ci/src/test/java/org/kie/scanner/KieModuleMetaDataImplTest.java +++ b/kie-ci/src/test/java/org/kie/scanner/KieModuleMetaDataImplTest.java @@ -18,7 +18,7 @@ */ package org.kie.scanner; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/kie-ci/src/test/java/org/kie/scanner/KieModuleMetaDataTest.java b/kie-ci/src/test/java/org/kie/scanner/KieModuleMetaDataTest.java index 8188a23e8ae..7f031a7231f 100644 --- a/kie-ci/src/test/java/org/kie/scanner/KieModuleMetaDataTest.java +++ b/kie-ci/src/test/java/org/kie/scanner/KieModuleMetaDataTest.java @@ -19,8 +19,8 @@ package org.kie.scanner; import org.drools.compiler.kie.builder.impl.InternalKieModule; +import org.junit.jupiter.api.Test; import org.drools.base.rule.TypeMetaInfo; -import org.junit.Test; import org.kie.api.KieServices; import org.kie.api.builder.KieBuilder; import org.kie.api.builder.KieFileSystem; diff --git a/kie-ci/src/test/java/org/kie/scanner/KieRepositoryScannerNexusTest.java b/kie-ci/src/test/java/org/kie/scanner/KieRepositoryScannerNexusTest.java index 6855bb248b8..a180ab7ca3b 100644 --- a/kie-ci/src/test/java/org/kie/scanner/KieRepositoryScannerNexusTest.java +++ b/kie-ci/src/test/java/org/kie/scanner/KieRepositoryScannerNexusTest.java @@ -23,10 +23,10 @@ import org.drools.compiler.kie.builder.impl.InternalKieModule; import org.drools.core.util.FileManager; -import org.junit.After; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.kie.api.KieServices; import org.kie.api.builder.KieModule; import org.kie.api.builder.ReleaseId; @@ -48,13 +48,13 @@ * 3. Note that this test uses 'http://localhost:8081' as nexus target, with the default nexus user name 'admin' and password 'admin123' * */ -@Ignore("ignored because it needs a running nexus server") +@Disabled("ignored because it needs a running nexus server") public class KieRepositoryScannerNexusTest extends AbstractKieCiTest { private static final Logger LOG = LoggerFactory.getLogger(KieRepositoryScannerNexusTest.class); private FileManager fileManager; - @Before + @BeforeEach public void setUp() throws Exception { System.setProperty("kie.maven.settings.custom", new File("target/test-classes/org/kie/scanner/settings_nexus.xml").getAbsolutePath()); this.fileManager = new FileManager(); @@ -62,7 +62,7 @@ public void setUp() throws Exception { ReleaseId releaseId = KieServices.Factory.get().newReleaseId("org.kie", "scanner-test", "1.0-SNAPSHOT"); } - @After + @AfterEach public void tearDown() throws Exception { this.fileManager.tearDown(); } diff --git a/kie-ci/src/test/java/org/kie/scanner/KieRepositoryScannerTest.java b/kie-ci/src/test/java/org/kie/scanner/KieRepositoryScannerTest.java index b06a6228339..240caa36d60 100644 --- a/kie-ci/src/test/java/org/kie/scanner/KieRepositoryScannerTest.java +++ b/kie-ci/src/test/java/org/kie/scanner/KieRepositoryScannerTest.java @@ -31,10 +31,10 @@ import org.drools.compiler.kie.builder.impl.event.KieScannerStatusChangeEventImpl; import org.drools.compiler.kie.builder.impl.event.KieScannerUpdateResultsEventImpl; import org.drools.core.util.FileManager; -import org.junit.After; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.kie.api.KieServices; import org.kie.api.builder.KieBuilder; import org.kie.api.builder.KieFileSystem; @@ -63,14 +63,14 @@ public class KieRepositoryScannerTest extends AbstractKieCiTest { private FileManager fileManager; - @Before + @BeforeEach public void setUp() throws Exception { this.fileManager = new FileManager(); this.fileManager.setUp(); ReleaseId releaseId = KieServices.Factory.get().newReleaseId("org.kie", "scanner-test", "1.0-SNAPSHOT"); } - @After + @AfterEach public void tearDown() throws Exception { this.fileManager.tearDown(); } @@ -115,7 +115,8 @@ public void testKScanner() throws Exception { ks.getRepository().removeKieModule(releaseId); } - @Test @Ignore("used only for check performances") + @Test + @Disabled("used only for check performances") public void testKScannerWithDependencies() throws Exception { KieServices ks = KieServices.Factory.get(); ReleaseId releaseIdNoDep = ks.newReleaseId( "org.kie", "test-no-dep", "1.0-SNAPSHOT" ); @@ -136,7 +137,8 @@ public void testKScannerWithDependencies() throws Exception { System.out.println("done in " + (System.nanoTime() - start)); } - @Test @Ignore("avoid use external dependency") + @Test + @Disabled("avoid use external dependency") public void testKScannerWithTransitiveInclusion() throws Exception { String pom = "\n" + "\n" + "assertj-core test - - junit - junit - test - org.junit.jupiter junit-jupiter-engine diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-10-default/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-10-default/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java index c9a0de4cf98..4042783e456 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-10-default/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-10-default/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java @@ -20,16 +20,13 @@ import java.net.URL; -import org.assertj.core.api.Assertions; import org.drools.compiler.kie.builder.impl.KieContainerImpl; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.builder.KieModule; import org.kie.api.runtime.KieContainer; import org.kie.api.runtime.KieSession; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; public class ExecModelParameterTestIT { @@ -43,7 +40,7 @@ public class ExecModelParameterTestIT { public void testWithoutDroolsModelCompilerOnClassPathDoNotRunExecModel() throws Exception { KieModule kieModule = fireRule(); assertThat(kieModule).isNotNull(); - assertFalse(kieModule.getClass().getCanonicalName().equals(CANONICAL_KIE_MODULE)); + assertThat(kieModule.getClass().getCanonicalName()).isNotEqualTo(CANONICAL_KIE_MODULE); } private KieModule fireRule() throws Exception { diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-10-yes-generate/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-10-yes-generate/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java index 1436b809703..21bf6041e3b 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-10-yes-generate/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-10-yes-generate/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java @@ -20,16 +20,13 @@ import java.net.URL; -import org.assertj.core.api.Assertions; import org.drools.compiler.kie.builder.impl.KieContainerImpl; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.builder.KieModule; import org.kie.api.runtime.KieContainer; import org.kie.api.runtime.KieSession; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; public class ExecModelParameterTestIT { @@ -43,7 +40,7 @@ public class ExecModelParameterTestIT { public void testWithoutDroolsModelCompilerOnClassPathDoNotRunExecModel() throws Exception { KieModule kieModule = fireRule(); assertThat(kieModule).isNotNull(); - assertFalse(kieModule.getClass().getCanonicalName().equals(CANONICAL_KIE_MODULE)); + assertThat(kieModule.getClass().getCanonicalName()).isNotEqualTo(CANONICAL_KIE_MODULE); } private KieModule fireRule() throws Exception { diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-11-default/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-11-default/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java index 6a05bd465d2..83c22a90917 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-11-default/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-11-default/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java @@ -21,11 +21,10 @@ import java.net.URL; import org.drools.modelcompiler.CanonicalKieModule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.builder.KieModule; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertTrue; public class ExecModelParameterTestIT { @@ -38,7 +37,7 @@ public class ExecModelParameterTestIT { public void testWithoutDroolsModelCompilerOnClassPathDoNotRunExecModel() throws Exception { KieModule kieModule = fireRule(); assertThat(kieModule).isNotNull(); - assertTrue(kieModule instanceof CanonicalKieModule); + assertThat(kieModule).isInstanceOf(CanonicalKieModule.class); } private KieModule fireRule() throws Exception { diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-11-yes-generate/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-11-yes-generate/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java index 8afd4f2090f..88fbad464b2 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-11-yes-generate/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-11-yes-generate/src/test/java-filtered/org/kie/maven/plugin/ittests/ExecModelParameterTestIT.java @@ -20,17 +20,14 @@ import java.net.URL; -import org.assertj.core.api.Assertions; import org.drools.compiler.kie.builder.impl.KieContainerImpl; import org.drools.modelcompiler.CanonicalKieModule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.builder.KieModule; import org.kie.api.runtime.KieContainer; import org.kie.api.runtime.KieSession; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; public class ExecModelParameterTestIT { @@ -43,7 +40,7 @@ public class ExecModelParameterTestIT { public void testWithoutDroolsModelCompilerOnClassPathDoNotRunExecModel() throws Exception { KieModule kieModule = fireRule(); assertThat(kieModule).isNotNull(); - assertTrue(kieModule instanceof CanonicalKieModule); + assertThat(kieModule).isInstanceOf(CanonicalKieModule.class); } private KieModule fireRule() throws Exception { diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-12/src/test/java-filtered/org/kie/maven/plugin/ittests/BuildPMMLTrustyTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-12/src/test/java-filtered/org/kie/maven/plugin/ittests/BuildPMMLTrustyTestIT.java index 287b2d65342..742fc12a2f3 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-12/src/test/java-filtered/org/kie/maven/plugin/ittests/BuildPMMLTrustyTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-12/src/test/java-filtered/org/kie/maven/plugin/ittests/BuildPMMLTrustyTestIT.java @@ -28,8 +28,9 @@ import java.util.jar.JarEntry; import java.util.jar.JarFile; -import org.assertj.core.api.Assertions; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; public class BuildPMMLTrustyTestIT { @@ -54,9 +55,9 @@ public void testContentKjarWithPMML() throws Exception { jarContent.add(entryName); } - Assertions.assertThat(jarContent).isNotEmpty(); - Assertions.assertThat(jarContent).contains(PMML_FILE_NAME); - Assertions.assertThat(jarContent).contains(INDEX_FILE_NAME); - EXAMPLE_PMML_CLASSES.forEach(examplePMMLClass -> Assertions.assertThat(jarContent).contains(examplePMMLClass)); + assertThat(jarContent).isNotEmpty(); + assertThat(jarContent).contains(PMML_FILE_NAME); + assertThat(jarContent).contains(INDEX_FILE_NAME); + EXAMPLE_PMML_CLASSES.forEach(examplePMMLClass -> assertThat(jarContent).contains(examplePMMLClass)); } } \ No newline at end of file diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-13/src/test/java-filtered/org/kie/maven/plugin/ittests/AlphaNetworkCompilerTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-13/src/test/java-filtered/org/kie/maven/plugin/ittests/AlphaNetworkCompilerTestIT.java index 08613bff8ff..5ec89001201 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-13/src/test/java-filtered/org/kie/maven/plugin/ittests/AlphaNetworkCompilerTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-13/src/test/java-filtered/org/kie/maven/plugin/ittests/AlphaNetworkCompilerTestIT.java @@ -22,20 +22,18 @@ import java.net.URL; import java.util.List; -import org.assertj.core.api.Assertions; import org.drools.ancompiler.CompiledNetwork; import org.drools.ancompiler.ObjectTypeNodeCompiler; import org.drools.kiesession.rulebase.InternalKnowledgeBase; import org.drools.core.reteoo.ObjectSinkPropagator; import org.drools.core.reteoo.ObjectTypeNode; import org.drools.core.reteoo.Rete; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.KieBase; import org.kie.api.runtime.KieContainer; import org.kie.api.runtime.KieSession; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.assertj.core.api.Assertions.assertThat; public class AlphaNetworkCompilerTestIT { @@ -48,12 +46,12 @@ public void testAlphaNetworkCompiler() throws Exception { final URL targetLocation = AlphaNetworkCompilerTestIT.class.getProtectionDomain().getCodeSource().getLocation(); final KieContainer kieContainer = ITTestsUtils.getKieContainer(targetLocation, GAV_ARTIFACT_ID, GAV_VERSION); final KieBase kieBase = kieContainer.getKieBase(KBASE_NAME); - Assertions.assertThat(kieBase).isNotNull(); + assertThat(kieBase).isNotNull(); KieSession kSession = null; try { kSession = kieBase.newKieSession(); - Assertions.assertThat(kSession).isNotNull(); + assertThat(kSession).isNotNull(); ClassLoader classLoader = kieContainer.getClassLoader(); Class aClass = Class.forName("org.compiledalphanetwork.Person", true, classLoader); @@ -64,7 +62,7 @@ public void testAlphaNetworkCompiler() throws Exception { int rulesFired = kSession.fireAllRules(); kSession.dispose(); - assertEquals(1, rulesFired); + assertThat(rulesFired).isEqualTo(1); assertReteIsAlphaNetworkCompiled(kSession); @@ -79,7 +77,7 @@ protected void assertReteIsAlphaNetworkCompiled(KieSession ksession) { for(ObjectTypeNode otn : objectTypeNodes) { ObjectSinkPropagator objectSinkPropagator = otn.getObjectSinkPropagator(); System.out.println(objectSinkPropagator.getClass().getCanonicalName()); - assertTrue(objectSinkPropagator instanceof CompiledNetwork); + assertThat(objectSinkPropagator).isInstanceOf(CompiledNetwork.class); } } } \ No newline at end of file diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-14-ruleunits/src/test/java/org/drools/ruleunit/example/LoanTest.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-14-ruleunits/src/test/java/org/drools/ruleunit/example/LoanTest.java index c973178b15b..3c6b0bc6aae 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-14-ruleunits/src/test/java/org/drools/ruleunit/example/LoanTest.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-14-ruleunits/src/test/java/org/drools/ruleunit/example/LoanTest.java @@ -23,10 +23,10 @@ import org.drools.ruleunits.api.RuleUnitInstance; import org.drools.ruleunits.api.RuleUnitProvider; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static java.util.stream.Collectors.toList; -import static org.junit.Assert.assertEquals; +import static org.assertj.core.api.Assertions.assertThat; public class LoanTest { @@ -43,8 +43,8 @@ public void test() { List results = instance.executeQuery("FindApproved").toList("$l"); - assertEquals(1, results.size()); - assertEquals("ABC10001", results.get(0).getId()); - assertEquals("John", results.get(0).getApplicant().getName()); + assertThat(results).hasSize(1); + assertThat(results.get(0).getId()).isEqualTo("ABC10001"); + assertThat(results.get(0).getApplicant().getName()).isEqualTo("John"); } } diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-15-yaml/src/test/java-filtered/org/kie/maven/plugin/ittests/YamlTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-15-yaml/src/test/java-filtered/org/kie/maven/plugin/ittests/YamlTestIT.java index ded38386ade..d95c193fb0e 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-15-yaml/src/test/java-filtered/org/kie/maven/plugin/ittests/YamlTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-15-yaml/src/test/java-filtered/org/kie/maven/plugin/ittests/YamlTestIT.java @@ -27,15 +27,11 @@ import org.kie.api.KieBase; import org.kie.api.runtime.KieContainer; - -import org.assertj.core.api.Assertions; -import org.junit.Test; import org.kie.api.runtime.KieSession; - +import org.junit.jupiter.api.Test; import org.yaml.Measurement; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.assertj.core.api.Assertions.assertThat; public class YamlTestIT { @@ -50,12 +46,12 @@ public void testYamlRules() throws Exception { final URL targetLocation = YamlTestIT.class.getProtectionDomain().getCodeSource().getLocation(); final KieContainer kieContainer = ITTestsUtils.getKieContainer(targetLocation, GAV_ARTIFACT_ID, GAV_VERSION); final KieBase kieBase = kieContainer.getKieBase(KBASE_NAME); - Assertions.assertThat(kieBase).isNotNull(); + assertThat(kieBase).isNotNull(); KieSession kSession = null; try { kSession = kieBase.newKieSession(); - Assertions.assertThat(kSession).isNotNull(); + assertThat(kSession).isNotNull(); Set check = new HashSet(); kSession.setGlobal("controlSet", check); @@ -72,11 +68,10 @@ public void testYamlRules() throws Exception { kSession.insert(mBlue); kSession.fireAllRules(); - assertEquals("Size of object in Working Memory is 3", 3, kSession.getObjects().size()); - assertTrue("contains red", check.contains("red")); - assertTrue("contains green", check.contains("green")); - assertTrue("contains blue", check.contains("blue")); - + assertThat(kSession.getObjects()).as("Size of object in Working Memory is 3").hasSize(3); + assertThat(check).as("contains red").contains("red"); + assertThat(check).as("contains green").contains("green"); + assertThat(check).as("contains blue").contains("blue"); } finally { kSession.dispose(); } diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-3/src/test/java/org/kie/maven/plugin/ittests/AdditionalPropertiesIntegrationTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-3/src/test/java/org/kie/maven/plugin/ittests/AdditionalPropertiesIntegrationTestIT.java index 8456c262680..1c24a20ddb0 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-3/src/test/java/org/kie/maven/plugin/ittests/AdditionalPropertiesIntegrationTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-3/src/test/java/org/kie/maven/plugin/ittests/AdditionalPropertiesIntegrationTestIT.java @@ -23,9 +23,9 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertTrue; +import static org.assertj.core.api.Assertions.assertThat; public class AdditionalPropertiesIntegrationTestIT { @@ -38,7 +38,7 @@ public void testAdditionalPropertiesCorrectlySet() throws Exception { final File basedir = new File(targetLocation.getFile().replace("/target/test-classes/", "")); final File buildLog = new File(basedir, "build.log"); final String expected = "Additional system properties: {drools.dialect.java.compiler.lnglevel=1.8, my.property=some-value}"; - assertTrue(Files.lines(buildLog.toPath(), StandardCharsets.UTF_8) - .anyMatch(line -> line.contains(expected))); + assertThat(Files.lines(buildLog.toPath(), StandardCharsets.UTF_8) + .anyMatch(line -> line.contains(expected))).isTrue(); } } diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-7-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/KJarWithDMNIntegrationTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-7-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/KJarWithDMNIntegrationTestIT.java index e4b4c55e3a6..7226cea4d3f 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-7-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/KJarWithDMNIntegrationTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-7-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/KJarWithDMNIntegrationTestIT.java @@ -27,8 +27,7 @@ import java.util.Map; import java.util.Set; -import org.assertj.core.api.Assertions; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.KieBase; import org.kie.api.KieServices; import org.kie.api.runtime.KieContainer; diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-7-no-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/KJarWithDMNIntegrationTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-7-no-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/KJarWithDMNIntegrationTestIT.java index cd4e188ded9..e3f4da553dd 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-7-no-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/KJarWithDMNIntegrationTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-7-no-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/KJarWithDMNIntegrationTestIT.java @@ -27,8 +27,7 @@ import java.util.Map; import java.util.Set; -import org.assertj.core.api.Assertions; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.KieBase; import org.kie.api.KieServices; import org.kie.api.runtime.KieContainer; @@ -38,8 +37,8 @@ import org.kie.dmn.api.core.DMNResult; import org.kie.dmn.api.core.DMNRuntime; import org.kie.dmn.core.api.DMNFactory; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; public class KJarWithDMNIntegrationTestIT { diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-8-exec-model/kie-maven-plugin-test-kjar-8-modA-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/MultiModuleTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-8-exec-model/kie-maven-plugin-test-kjar-8-modA-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/MultiModuleTestIT.java index 1e6526ad737..3c832527c7f 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-8-exec-model/kie-maven-plugin-test-kjar-8-modA-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/MultiModuleTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-8-exec-model/kie-maven-plugin-test-kjar-8-modA-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/MultiModuleTestIT.java @@ -26,11 +26,8 @@ import java.util.List; import java.util.Set; - - -import org.assertj.core.api.Assertions; import org.drools.compiler.kie.builder.impl.KieContainerImpl; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.KieServices; import org.kie.api.definition.KiePackage; import org.kie.api.definition.type.FactType; @@ -38,7 +35,7 @@ import static java.util.Arrays.asList; import static java.util.stream.Collectors.toList; -import static org.assertj.core.api.Assertions.*; +import static org.assertj.core.api.Assertions.assertThat; public class MultiModuleTestIT { diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-8-no-exec-model/kie-maven-plugin-test-kjar-8-modA-no-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/MultiModuleTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-8-no-exec-model/kie-maven-plugin-test-kjar-8-modA-no-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/MultiModuleTestIT.java index 8c59f02e6d5..496e302d52c 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-8-no-exec-model/kie-maven-plugin-test-kjar-8-modA-no-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/MultiModuleTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-8-no-exec-model/kie-maven-plugin-test-kjar-8-modA-no-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/MultiModuleTestIT.java @@ -26,9 +26,8 @@ import java.util.List; import java.util.Set; -import org.assertj.core.api.Assertions; import org.drools.compiler.kie.builder.impl.KieContainerImpl; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.KieServices; import org.kie.api.definition.KiePackage; import org.kie.api.definition.type.FactType; @@ -36,7 +35,7 @@ import static java.util.Arrays.asList; import static java.util.stream.Collectors.toList; -import static org.assertj.core.api.Assertions.*; +import static org.assertj.core.api.Assertions.assertThat; public class MultiModuleTestIT { diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-9-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/DeclaredTypesTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-9-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/DeclaredTypesTestIT.java index cfdda1d8a45..acd96b7eaeb 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-9-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/DeclaredTypesTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-9-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/DeclaredTypesTestIT.java @@ -25,15 +25,13 @@ import java.util.HashSet; import java.util.Set; +import org.junit.jupiter.api.Test; import org.kie.api.KieBase; import org.kie.api.runtime.KieContainer; import org.kie.api.runtime.KieSession; - -import org.assertj.core.api.Assertions; -import org.junit.Test; import org.kie.api.runtime.KieSession; -import static org.junit.Assert.assertEquals; +import static org.assertj.core.api.Assertions.assertThat; public class DeclaredTypesTestIT { @@ -48,12 +46,12 @@ public void testDeclaredTypeWithJavaField() throws Exception { final URL targetLocation = DeclaredTypesTestIT.class.getProtectionDomain().getCodeSource().getLocation(); final KieContainer kieContainer = ITTestsUtils.getKieContainer(targetLocation, GAV_ARTIFACT_ID, GAV_VERSION); final KieBase kieBase = kieContainer.getKieBase(KBASE_NAME); - Assertions.assertThat(kieBase).isNotNull(); + assertThat(kieBase).isNotNull(); KieSession kSession = null; try { kSession = kieBase.newKieSession(); - Assertions.assertThat(kSession).isNotNull(); + assertThat(kSession).isNotNull(); ClassLoader classLoader = kieContainer.getClassLoader(); Class aClass = Class.forName("org.declaredtype.FactA", true, classLoader); @@ -64,7 +62,7 @@ public void testDeclaredTypeWithJavaField() throws Exception { int rulesFired = kSession.fireAllRules(); kSession.dispose(); - assertEquals(1, rulesFired); + assertThat(rulesFired).isEqualTo(1); } finally { kSession.dispose(); } diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-9-no-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/DeclaredTypesTestIT.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-9-no-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/DeclaredTypesTestIT.java index 15d5533cbac..6bdeb02f47e 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-9-no-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/DeclaredTypesTestIT.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-9-no-exec-model/src/test/java-filtered/org/kie/maven/plugin/ittests/DeclaredTypesTestIT.java @@ -27,11 +27,11 @@ import org.kie.api.runtime.KieContainer; import org.kie.api.runtime.KieSession; -import org.assertj.core.api.Assertions; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.kie.api.runtime.KieSession; -import static org.junit.Assert.assertEquals; +import static org.assertj.core.api.Assertions.assertThat; + public class DeclaredTypesTestIT { @@ -45,12 +45,12 @@ public void testDeclaredTypeWithJavaField() throws Exception { final URL targetLocation = DeclaredTypesTestIT.class.getProtectionDomain().getCodeSource().getLocation(); final KieContainer kieContainer = ITTestsUtils.getKieContainer(targetLocation, GAV_ARTIFACT_ID, GAV_VERSION); final KieBase kieBase = kieContainer.getKieBase(KBASE_NAME); - Assertions.assertThat(kieBase).isNotNull(); + assertThat(kieBase).isNotNull(); KieSession kSession = null; try { kSession = kieBase.newKieSession(); - Assertions.assertThat(kSession).isNotNull(); + assertThat(kSession).isNotNull(); ClassLoader classLoader = kieContainer.getClassLoader(); Class aClass = Class.forName("org.declaredtype.FactA", true, classLoader); @@ -61,7 +61,7 @@ public void testDeclaredTypeWithJavaField() throws Exception { int rulesFired = kSession.fireAllRules(); kSession.dispose(); - assertEquals(1, rulesFired); + assertThat(rulesFired).isEqualTo(1); } finally { kSession.dispose(); } diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-common/pom.xml b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-common/pom.xml index 66518508a89..a90120b9199 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-common/pom.xml +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-common/pom.xml @@ -42,10 +42,11 @@ @org.kie.version@ - junit - junit - ${junit.version} - + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} + test + org.assertj assertj-core diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-common/src/main/java/org/kie/maven/plugin/ittests/ITTestsUtils.java b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-common/src/main/java/org/kie/maven/plugin/ittests/ITTestsUtils.java index 98b427469ba..9afae835fbb 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-common/src/main/java/org/kie/maven/plugin/ittests/ITTestsUtils.java +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-common/src/main/java/org/kie/maven/plugin/ittests/ITTestsUtils.java @@ -24,7 +24,6 @@ import java.util.HashSet; import java.util.Set; -import org.assertj.core.api.Assertions; import org.drools.compiler.kie.builder.impl.KieContainerImpl; import org.kie.api.KieBase; import org.kie.api.KieServices; @@ -32,7 +31,8 @@ import org.kie.api.runtime.KieContainer; import org.kie.api.runtime.KieSession; -import static org.junit.Assert.assertEquals; +import static org.assertj.core.api.Assertions.assertThat; + public class ITTestsUtils { @@ -43,7 +43,7 @@ private ITTestsUtils() { public static File getKjarFile(final URL targetLocation, final String gavArtifactId, final String gavVersion) throws Exception { final File basedir = new File(targetLocation.getFile().replace("/test-classes/", "")); final File toReturn = new File(basedir, gavArtifactId + "-" + gavVersion + ".jar"); - Assertions.assertThat(toReturn).exists(); + assertThat(toReturn).exists(); return toReturn; } @@ -55,28 +55,28 @@ public static KieContainer getKieContainer(final URL targetLocation, final Strin final KieServices kieServices = KieServices.get(); final KieContainer toReturn = kieServices.getKieClasspathContainer(projectClassLoader); - Assertions.assertThat(toReturn).isNotNull(); + assertThat(toReturn).isNotNull(); return toReturn; } public static KieBase getKieBase(final URL targetLocation, final String gavArtifactId, final String gavVersion, final String kieBaseName) throws Exception { final KieContainer kieContainer = getKieContainer(targetLocation, gavArtifactId, gavVersion); KieBase toReturn = kieContainer.getKieBase(kieBaseName); - Assertions.assertThat(toReturn).isNotNull(); + assertThat(toReturn).isNotNull(); return toReturn; } public static KieSession getKieSession(final URL targetLocation, final String gavArtifactId, final String gavVersion, final String kieBaseName) throws Exception { final KieBase kieBase = getKieBase(targetLocation, gavArtifactId, gavVersion, kieBaseName); KieSession toReturn = kieBase.newKieSession(); - Assertions.assertThat(toReturn).isNotNull(); + assertThat(toReturn).isNotNull(); return toReturn; } public static KieModule fireRule(final URL targetLocation, final String gavArtifactId, final String gavVersion, final String kieBaseName, final String ruleName) throws Exception { final KieContainer kieContainer = getKieContainer(targetLocation, gavArtifactId, gavVersion); final KieBase kieBase = kieContainer.getKieBase(kieBaseName); - Assertions.assertThat(kieBase).isNotNull(); + assertThat(kieBase).isNotNull(); KieSession kSession = null; try { @@ -87,14 +87,14 @@ public static KieModule fireRule(final URL targetLocation, final String gavArtif int rulesFired = kSession.fireAllRules(); kSession.dispose(); - assertEquals(1, rulesFired); + assertThat(rulesFired).isEqualTo(1); } finally { if (kSession != null) { kSession.dispose(); } } KieModule toReturn = ((KieContainerImpl) kieContainer).getKieModuleForKBase(kieBaseName); - Assertions.assertThat(toReturn).isNotNull(); + assertThat(toReturn).isNotNull(); return toReturn; } diff --git a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-parent/pom.xml b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-parent/pom.xml index 85d496c9447..0f5a7199b36 100644 --- a/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-parent/pom.xml +++ b/kie-maven-plugin/src/it/kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-parent/pom.xml @@ -35,6 +35,7 @@ UTF-8 11 4.13.1 + 5.10.2 3.14.0 3.11.0 3.1.0 @@ -48,11 +49,11 @@ ${org.kie.version} - junit - junit - ${junit.version} + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} test - + org.assertj assertj-core