diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2024-01-26 15:28:56 +0000 |
---|---|---|
committer | Adheli Tavares <adheli.tavares@est.tech> | 2024-02-09 10:31:15 +0000 |
commit | cc1d3d352771d1fa35d297e90663539e34b022f6 (patch) | |
tree | b1b00d678b0157742b91be1262fbf614a62063b1 /policy-utils/src/test/java/org/onap/policy/drools/utils/ReflectionUtilTest.java | |
parent | cce79248655f484e007769ba81b092148f940d27 (diff) |
Removing deprecated DMAAP library
Issue-ID: POLICY-4402
Change-Id: I4ce5b303cb3a775010683d3c7102b0bd065280ea
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'policy-utils/src/test/java/org/onap/policy/drools/utils/ReflectionUtilTest.java')
-rw-r--r-- | policy-utils/src/test/java/org/onap/policy/drools/utils/ReflectionUtilTest.java | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/policy-utils/src/test/java/org/onap/policy/drools/utils/ReflectionUtilTest.java b/policy-utils/src/test/java/org/onap/policy/drools/utils/ReflectionUtilTest.java index b7feaf06..cd1aac43 100644 --- a/policy-utils/src/test/java/org/onap/policy/drools/utils/ReflectionUtilTest.java +++ b/policy-utils/src/test/java/org/onap/policy/drools/utils/ReflectionUtilTest.java @@ -3,6 +3,7 @@ * policy-utils * ================================================================================ * Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,26 +21,27 @@ package org.onap.policy.drools.utils; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ReflectionUtilTest { +class ReflectionUtilTest { public class ParentClass { } - public class ChildClass extends ParentClass{ + class ChildClass extends ParentClass{ } @Test - public void testReflection() { + void testReflection() { try { @@ -61,25 +63,27 @@ public class ReflectionUtilTest { } } - @Test(expected = IllegalArgumentException.class) - public void testException1() { - ReflectionUtil.fetchClass(null, "org.onap.policy.drools.utils.ReflectionUtil"); + @Test + void testException1() { + assertThrows(IllegalArgumentException.class, () -> + ReflectionUtil.fetchClass(null, "org.onap.policy.drools.utils.ReflectionUtil")); } - @Test(expected = IllegalArgumentException.class) - public void testException2() { + @Test + void testException2() { Class<?> class1; try { class1 = Class.forName("org.onap.policy.drools.utils.ReflectionUtil"); ClassLoader classLoader = class1.getClassLoader(); - ReflectionUtil.fetchClass(classLoader, null); + assertThrows(IllegalArgumentException.class, () -> + ReflectionUtil.fetchClass(classLoader, null)); } catch (ClassNotFoundException e) { fail(); } } @Test - public void testException3() throws ClassNotFoundException { + void testException3() { assertNull(ReflectionUtil.fetchClass(ClassLoader.getSystemClassLoader(), "foo.bar")); } } |