From 6e9f9a32fa85893ce48ecdd476f56cc35cfb9fec Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Thu, 31 Aug 2023 09:24:59 +0900 Subject: [PATCH] =?UTF-8?q?gpki=20=EC=B4=88=EA=B8=B0=ED=99=94=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/interfaces/disabledparking/service/bean/GPKI.java | 7 +++---- .../service/DisabledParkingServiceTest.java | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/cokr/xit/interfaces/disabledparking/service/bean/GPKI.java b/src/main/java/cokr/xit/interfaces/disabledparking/service/bean/GPKI.java index c2a263e..1d477ed 100644 --- a/src/main/java/cokr/xit/interfaces/disabledparking/service/bean/GPKI.java +++ b/src/main/java/cokr/xit/interfaces/disabledparking/service/bean/GPKI.java @@ -37,10 +37,6 @@ public class GPKI extends AbstractComponent { private gpkiapi_jni gpki; - static { - init(); - } - /**주어진 문자열을 지정한 아이디의 서버인증서로 암호화하여 반환한다. * @param serverID 서버인증서 아이디 * @param data 문자열 @@ -91,6 +87,8 @@ public class GPKI extends AbstractComponent { } private static void init() { + if (!serverCerts.isEmpty()) return; + try { GpkiApi.init(conf.license); gpkiapi_jni gpki = getGpki(); @@ -230,6 +228,7 @@ public class GPKI extends AbstractComponent { if (gpki != null) return false; try { + init(); gpki = getGpki(); return true; } catch (Exception e) { diff --git a/src/test/java/cokr/xit/interfaces/disabledparking/service/DisabledParkingServiceTest.java b/src/test/java/cokr/xit/interfaces/disabledparking/service/DisabledParkingServiceTest.java index fd48e4d..d7f2736 100644 --- a/src/test/java/cokr/xit/interfaces/disabledparking/service/DisabledParkingServiceTest.java +++ b/src/test/java/cokr/xit/interfaces/disabledparking/service/DisabledParkingServiceTest.java @@ -12,6 +12,8 @@ import cokr.xit.interfaces.disabledparking.service.bean.DisabledParkingBean; import cokr.xit.interfaces.disabledparking.service.bean.GPKI; public class DisabledParkingServiceTest extends TestSupport { + @Resource(name = "disabledParkingBean") + private DisabledParkingBean bean; @Resource(name = "disabledParkingService") private DisabledParkingService service; @@ -50,7 +52,7 @@ public class DisabledParkingServiceTest extends TestSupport { "56저2472", "Y" ) .forEach((k, v) -> { - Map result = service.getParkingInfo(k); + Map result = bean.getParkingInfo(k); Assertions.assertEquals(v, result.get("PARKING_PSBL_YN")); }); }