timothyjward commented on code in PR #403:
URL: https://github.com/apache/felix-dev/pull/403#discussion_r2036860813


##########
framework/src/test/java/org/apache/felix/framework/BundleWiringImplTest.java:
##########
@@ -104,41 +98,38 @@ public void initializeSimpleBundleWiring() throws Exception
 
         bundleWiring = new BundleWiringImpl(logger, configMap, mockResolver,
                 mockRevisionImpl, fragments, wires, importedPkgs, 
requiredPkgs);
-    }
-
-    @Test
-    public void testBundleClassLoader() throws Exception
+    }
+
+    @Test
+    void bundleClassLoader() throws Exception
     {
         bundleWiring = mock(BundleWiringImpl.class);
         BundleClassLoader bundleClassLoader = createBundleClassLoader(
-                BundleClassLoader.class, bundleWiring);
-        assertNotNull(bundleClassLoader);
-    }
-
-    @SuppressWarnings("rawtypes")
-    @Test
-    public void testFindClassNonExistant() throws Exception
+                BundleClassLoader.class, bundleWiring);
+        assertThat(bundleClassLoader).isNotNull();
+    }
+
+    @SuppressWarnings("rawtypes")
+    @Test
+    void findClassNonExistant() throws Exception
     {
         initializeSimpleBundleWiring();
 
         BundleClassLoader bundleClassLoader = createBundleClassLoader(
-                BundleClassLoader.class, bundleWiring);
-        assertNotNull(bundleClassLoader);
-        Class foundClass = null;
-        try
-        {
-            foundClass = bundleClassLoader
-                    .findClass("org.apache.felix.test.NonExistant");
-        } catch (ClassNotFoundException e)
-        {
-            fail("Class should not throw exception");
-        }
-        assertNull("Nonexistant Class Should be null", foundClass);
-    }
-
-    @SuppressWarnings("rawtypes")
-    @Test
-    public void testFindClassExistant() throws Exception
+                BundleClassLoader.class, bundleWiring);
+        assertThat(bundleClassLoader).isNotNull();
+        AtomicReference<Class<?>> foundClassRef = new AtomicReference<>();

Review Comment:
   There's no need for an `AtomicReference` as `assertDoesNotThrow` can return 
the value directly
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@felix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to