UMS 코드 개선
This commit is contained in:
@@ -4,10 +4,12 @@ import com.eactive.apim.portal.template.entity.MessageCode;
|
||||
import com.eactive.apim.portal.template.entity.MessageRequest;
|
||||
import com.eactive.ext.kjb.common.KjbEaiBatchException;
|
||||
import com.eactive.ext.kjb.common.KjbProperty;
|
||||
import com.eactive.ext.kjb.common.KjbUmsException;
|
||||
import com.eactive.ext.kjb.ums.KjbEmailSendModule;
|
||||
import com.eactive.ext.kjb.ums.KjbUmsService;
|
||||
import com.eactive.ext.kjb.utils.OsUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Assumptions;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -23,16 +25,22 @@ public class UmsTest {
|
||||
@BeforeAll
|
||||
public static void init() {
|
||||
prop = new KjbProperty();
|
||||
prop.setEaiBatchUrl("http://172.31.32.111:10230/BATAppWeb/EaiBatCall");
|
||||
prop.setUmsEaiBatchInterfaceId("UAGFF00001UIE");
|
||||
|
||||
prop.setUmsHostUrl("http://172.31.35.144:9021");
|
||||
prop.setUmsApiKey("7cca6d58-e4f7-474d-9edd-525806bc99ff");
|
||||
|
||||
if (OsUtil.isWindows()) {
|
||||
prop.setUmsEaiBatchSendDir("c:\\kjb-logs\\sendmail\\snd");
|
||||
prop.setUmsEaiBatchBackupDir("c:\\kjb-logs\\sendmail\\bak");
|
||||
prop.setUmsEaiBatchErrorDir("c:\\kjb-logs\\sendmail\\error");
|
||||
}
|
||||
|
||||
if (OsUtil.isLinux()) {
|
||||
prop.setUmsEaiBatchSendDir("/Data/eapim/portal/sendmail/snd");
|
||||
prop.setUmsEaiBatchBackupDir("/Data/eapim/portal/sendmail/bak");
|
||||
prop.setUmsEaiBatchErrorDir("/Data/eapim/portal/sendmail/error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,9 +50,6 @@ public class UmsTest {
|
||||
"true".equalsIgnoreCase(System.getenv("KJB_EAPIM_TEST_ENABLED")),
|
||||
"OS 환경변수 내 KJB_EAPIM_TEST_ENABLED=TRUE 설정되어 있어야 동작함");
|
||||
|
||||
prop.setUmsHostUrl("http://172.31.35.144:9021");
|
||||
prop.setUmsApiKey("7cca6d58-e4f7-474d-9edd-525806bc99ff");
|
||||
|
||||
MessageRequest messageRequest = new MessageRequest();
|
||||
messageRequest.setId(UUID.randomUUID().toString());
|
||||
messageRequest.setMessageCode(MessageCode.USER_VERIFICATION_MOBILEPHONE);
|
||||
@@ -52,10 +57,17 @@ public class UmsTest {
|
||||
messageRequest.setEmail("dearmai@dearmai.net");
|
||||
messageRequest.setUsername("김광은");
|
||||
messageRequest.setSubject("제목 - test");
|
||||
messageRequest.setMessage("junit test");
|
||||
messageRequest.setMessage("{\"ATHN_NO\"; \"369369\"}");
|
||||
|
||||
KjbUmsService umsService = new KjbUmsService(prop);
|
||||
umsService.send(messageRequest);
|
||||
try {
|
||||
boolean result = umsService.send(messageRequest);
|
||||
|
||||
} catch (KjbUmsException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
Assertions.fail(e);
|
||||
return;
|
||||
}
|
||||
|
||||
log.info("done");
|
||||
}
|
||||
@@ -66,13 +78,6 @@ public class UmsTest {
|
||||
"true".equalsIgnoreCase(System.getenv("KJB_EAPIM_TEST_ENABLED")),
|
||||
"OS 환경변수 내 KJB_EAPIM_TEST_ENABLED=TRUE 설정되어 있어야 동작함");
|
||||
|
||||
prop.setEaiBatchUrl("http://172.31.32.111:10230/BATAppWeb/EaiBatCall");
|
||||
prop.setEaiBatchUrl("");
|
||||
prop.setUmsEaiBatchSendDir("c:\\kjb-logs\\sendmail\\snd");
|
||||
prop.setUmsEaiBatchBackupDir("c:\\kjb-logs\\sendmail\\bak");
|
||||
prop.setUmsEaiBatchErrorDir("c:\\kjb-logs\\sendmail\\error");
|
||||
prop.setUmsEaiBatchInterfaceId("UAGFF00001UIE");
|
||||
|
||||
|
||||
System.getProperties().keySet().forEach(key -> {
|
||||
log.info("{}: {}", key, System.getProperty((String) key));
|
||||
@@ -105,13 +110,6 @@ public class UmsTest {
|
||||
"true".equalsIgnoreCase(System.getenv("KJB_EAPIM_TEST_ENABLED")),
|
||||
"OS 환경변수 내 KJB_EAPIM_TEST_ENABLED=TRUE 설정되어 있어야 동작함");
|
||||
|
||||
prop.setEaiBatchUrl("http://172.31.32.111:10230/BATAppWeb/EaiBatCall");
|
||||
prop.setUmsEaiBatchSendDir("/Data/eapim/portal/sendmail/snd");
|
||||
prop.setUmsEaiBatchBackupDir("/Data/eapim/portal/sendmail/bak");
|
||||
prop.setUmsEaiBatchErrorDir("/Data/eapim/portal/sendmail/error");
|
||||
prop.setUmsEaiBatchInterfaceId("UAGFF00001UIE");
|
||||
|
||||
|
||||
System.getProperties().keySet().forEach(key -> {
|
||||
log.info("{}: {}", key, System.getProperty((String) key));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user