From b4f997a00851784882961a7894b2d2a2224218f2 Mon Sep 17 00:00:00 2001 From: jeyong Date: Thu, 19 Dec 2024 00:11:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=8B=9C=EA=B7=B8=EB=84=90=EC=9D=98=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=EC=9D=84=20=EB=B6=88=EB=9F=AC=EC=98=A4?= =?UTF-8?q?=EC=A7=80=20=EB=AA=BB=ED=95=B4=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EA=B0=80=20=EA=B9=A8=EC=A7=80=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/jeyong/test/unit/ApplicationTerminatorTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/src/test/java/io/jeyong/test/unit/ApplicationTerminatorTest.java b/test/src/test/java/io/jeyong/test/unit/ApplicationTerminatorTest.java index 0b15005..02a5598 100644 --- a/test/src/test/java/io/jeyong/test/unit/ApplicationTerminatorTest.java +++ b/test/src/test/java/io/jeyong/test/unit/ApplicationTerminatorTest.java @@ -8,6 +8,7 @@ import java.nio.file.Files; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import sun.misc.Signal; import sun.misc.SignalHandler; @DisplayName("ApplicationTerminator Unit Test") @@ -30,7 +31,7 @@ protected int getExitCode() { }; // when - catchSystemExit(() -> terminator.handleTermination().handle(null)); + catchSystemExit(() -> terminator.handleTermination().handle(new Signal("TERM"))); // then assertThat(Files.readString(tempFile.toPath())).isEqualTo(expectedMessage); @@ -54,7 +55,7 @@ protected int getExitCode() { SignalHandler handler = terminator.handleTermination(); // when - int actualExitCode = catchSystemExit(() -> handler.handle(null)); + int actualExitCode = catchSystemExit(() -> handler.handle(new Signal("TERM"))); // then assertThat(actualExitCode).isEqualTo(expectedExitCode);