feat: add insurance claim HTTP tool scaffold
Some checks failed
Deploy to OCIWP / deploy (push) Has been cancelled
Some checks failed
Deploy to OCIWP / deploy (push) Has been cancelled
This commit is contained in:
@@ -878,7 +878,7 @@ public class ToolScaffolder {
|
||||
Files.writeString(generatedTestPath, useCaseTestContent(bizPackage, baseName));
|
||||
log.append("[Unit Test] ").append(generatedTestPath).append("\\n");
|
||||
log.append("[Test Command] .\\gradlew.bat :").append(moduleName.substring(moduleName.lastIndexOf(java.io.File.separator) + 1)).append(":test --tests \"*").append(baseName).append("UseCaseTest\"\\n");
|
||||
log.append("\n Tip: HTTP Tool? WireMock???ㅽ뻾?????앹꽦??mapping URL濡??몄텧???뺤씤?섏꽭??\n");
|
||||
log.append("\n Tip: HTTP Tool은 WireMock 실행 후 생성된 mapping URL로 호출을 확인하세요.\n");
|
||||
|
||||
return log.toString();
|
||||
}
|
||||
@@ -906,7 +906,7 @@ public class ToolScaffolder {
|
||||
method: POST
|
||||
content-type: application/json;charset=UTF-8
|
||||
biz-pod: false
|
||||
""".formatted(httpApiName, environmentKey, environmentKey, toolName);
|
||||
""".formatted(httpApiName, environmentKey, environmentKey, toolName).stripTrailing() + "\n";
|
||||
if (existing.isBlank()) {
|
||||
existing = """
|
||||
spring:
|
||||
@@ -920,7 +920,7 @@ public class ToolScaffolder {
|
||||
api-list:
|
||||
""" + apiEntry;
|
||||
} else if (existing.contains("\n mci:")) {
|
||||
existing = existing.replace("\n mci:", apiEntry + " mci:");
|
||||
existing = existing.replace("\n mci:", "\n" + apiEntry + " mci:");
|
||||
} else if (existing.contains("\naxhub:")) {
|
||||
existing = existing.replace("\naxhub:", apiEntry + "axhub:");
|
||||
} else if (existing.contains("api-list:")) {
|
||||
|
||||
@@ -19,6 +19,12 @@ glow:
|
||||
method: POST
|
||||
content-type: application/json;charset=UTF-8
|
||||
biz-pod: false
|
||||
- name: insurance
|
||||
domain: ${AXHUB_INSURANCE_HTTP_DOMAIN:http://localhost:${server.port}}
|
||||
url: ${AXHUB_INSURANCE_HTTP_URL:/api/mock/http/ins_insurance_processor}
|
||||
method: POST
|
||||
content-type: application/json;charset=UTF-8
|
||||
biz-pod: false
|
||||
mci:
|
||||
host: ${GLOW_COMMUNICATION_MCI_HOST:http://localhost}
|
||||
port: ${GLOW_COMMUNICATION_MCI_PORT:8080}
|
||||
|
||||
@@ -150,7 +150,7 @@ class ToolScaffolderTest {
|
||||
|
||||
List<ToolScaffolder.FieldDefinition> inputFields = List.of(
|
||||
new ToolScaffolder.FieldDefinition("employeeId", "String", "Employee identifier", "EMP10001", true));
|
||||
ToolScaffolder.scaffold("employee search", "HR_EMPLOYEE_SEARCH", "Employee search", "smp", "HTTP", moduleName,
|
||||
String resultLog = ToolScaffolder.scaffold("employee search", "HR_EMPLOYEE_SEARCH", "Employee search", "smp", "HTTP", moduleName,
|
||||
"tester", "2026.08.11", false, null, null, null, inputFields, outputFields);
|
||||
|
||||
Path dtoRoot = root.resolve("dap-was-http/src/main/java/io/shinhanlife/dap/mcc/biz/smp/dto");
|
||||
@@ -191,6 +191,7 @@ class ToolScaffolderTest {
|
||||
assertTrue(Files.readString(localConfig).contains("url: ${AXHUB_EMPLOYEE_SEARCH_HTTP_URL:/api/mock/http/smp_employee_search}"));
|
||||
Path podMockResponse = root.resolve("dap-was-http/src/main/resources/mock-responses/smp_employee_search.json");
|
||||
assertTrue(Files.exists(podMockResponse), podMockResponse.toString());
|
||||
assertTrue(resultLog.contains("Tip: HTTP Tool은 WireMock 실행 후 생성된 mapping URL로 호출을 확인하세요."), resultLog);
|
||||
|
||||
ToolScaffolder.scaffold("employee search", "HR_EMPLOYEE_SEARCH", "Employee search", "smp", "HTTP", moduleName,
|
||||
"tester", "2026.08.11", false, null, null, null, inputFields, outputFields);
|
||||
@@ -229,4 +230,29 @@ class ToolScaffolderTest {
|
||||
assertFalse(implementation.contains("AxhubHttpDomain"), implementation);
|
||||
assertFalse(implementation.contains("\"/HR_EMPLOYEE_SEARCH\""), implementation);
|
||||
}
|
||||
|
||||
@Test
|
||||
void addsHttpApiEntryOnItsOwnYamlLineBeforeMciConfiguration() throws Exception {
|
||||
String moduleName = root.resolve("dap-was-http-yaml").toString();
|
||||
Path localConfig = root.resolve("dap-was-lib/src/main/resources/glow/application-glow-local.yml");
|
||||
Files.createDirectories(localConfig.getParent());
|
||||
Files.writeString(localConfig, """
|
||||
glow:
|
||||
communication:
|
||||
http:
|
||||
api-list:
|
||||
- name: memo
|
||||
biz-pod: false
|
||||
mci:
|
||||
host: localhost
|
||||
""");
|
||||
|
||||
ToolScaffolder.scaffold("insurance claim processor", "CLAIM0000001", "Insurance claim", "Insurance claim", "ins", "HTTP", moduleName,
|
||||
"tester", "2026.08.11", false, null, null, null, List.of(), List.of(), "insurance");
|
||||
|
||||
String yaml = Files.readString(localConfig);
|
||||
assertFalse(yaml.contains("biz-pod: false - name"), yaml);
|
||||
assertTrue(yaml.contains(" biz-pod: false\n mci:"), yaml);
|
||||
assertTrue(yaml.contains(" - name: insurance"), yaml);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user