From af0ab46042d9953912d5ed665029dfda0e40b720 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 10 Sep 2024 00:29:28 +0800 Subject: [PATCH] Fix sonar issue on StandaloneProcessPersistServiceTest (#32820) --- .../persist/StandaloneProcessPersistServiceTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/StandaloneProcessPersistServiceTest.java b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/StandaloneProcessPersistServiceTest.java index d4611c69cd8ac..da33243ea0aa8 100644 --- a/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/StandaloneProcessPersistServiceTest.java +++ b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/StandaloneProcessPersistServiceTest.java @@ -28,6 +28,7 @@ import java.sql.Statement; import java.util.Collections; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -59,10 +60,10 @@ void assertKillProcess() throws SQLException { } @Test - void assertKillProcessWithNotExistedProcessId() throws SQLException { + void assertKillProcessWithNotExistedProcessId() { ProcessRegistry processRegistry = mock(ProcessRegistry.class); when(ProcessRegistry.getInstance()).thenReturn(processRegistry); when(processRegistry.get("foo_id")).thenReturn(null); - processPersistService.killProcess("foo_id"); + assertDoesNotThrow(() -> processPersistService.killProcess("foo_id")); } }