diff --git a/test/jdk/tools/jlink/plugins/IncludeLocalesPluginTest.java b/test/jdk/tools/jlink/plugins/IncludeLocalesPluginTest.java index 0cbfe468ac848..f30adee80a3c6 100644 --- a/test/jdk/tools/jlink/plugins/IncludeLocalesPluginTest.java +++ b/test/jdk/tools/jlink/plugins/IncludeLocalesPluginTest.java @@ -46,6 +46,8 @@ import org.junit.jupiter.params.provider.MethodSource; import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; /* * @test @@ -413,9 +415,7 @@ public static void setup() throws IOException { "present."); helper = Helper.newHelper(isLinkableRuntime); - if (helper == null) { - fail("Helper could not be initialized"); - } + assertNotNull(helper, "Helper could not be initialized"); } @ParameterizedTest @@ -480,11 +480,8 @@ private static void testAvailableLocales(Path image, List availableLocal + (len < availableLocales.size() ? " ..." : ""); int status = proc.waitFor(); - if (status == 0) { - System.out.println("\tDone\t" + command); - } else { - fail("\tExit " + status + "\t" + command); - } + assertTrue(status == 0, "\tExit " + status + "\t" + command); + System.out.println("\tDone\t" + command); System.out.println(); } }