[Developer] #618 add structured data browser
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.cloudhandson.vpdbackoffice.service;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
class StructuredDataServiceTest {
|
||||
|
||||
private final StructuredDataService service = new StructuredDataService(mock(JdbcTemplate.class));
|
||||
|
||||
@Test
|
||||
void exposesOnlyTheSevenApprovedStructuredTables() {
|
||||
assertThat(service.tables())
|
||||
.extracting(table -> table.tableName())
|
||||
.containsExactly(
|
||||
"KB_CUSTOMERS",
|
||||
"KB_PRODUCTS",
|
||||
"KB_CONTRACTS",
|
||||
"KB_COVERAGES",
|
||||
"KB_CLAIMS",
|
||||
"KB_EXTERNAL_HOLDINGS",
|
||||
"KB_STAKEHOLDERS");
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsAnyTableOutsideTheServerSideAllowlist() {
|
||||
assertThatThrownBy(() -> service.requireTable("KB_SECURITY_AUDIT_LOG"))
|
||||
.isInstanceOf(AppException.class)
|
||||
.hasMessage("선택할 수 없는 정형 데이터 테이블입니다.");
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,7 @@ class GuidedFlowTemplateTest {
|
||||
.contains("운영")
|
||||
.contains("관리자")
|
||||
.contains("조회 연동")
|
||||
.contains("정형 데이터 조회")
|
||||
.contains("MCP 서비스")
|
||||
.contains("고급 접근 조건")
|
||||
.contains("시스템 설정")
|
||||
@@ -63,7 +64,7 @@ class GuidedFlowTemplateTest {
|
||||
"effective-matrix.html", "users.html", "groups.html", "roles.html", "vector-knowledge.html",
|
||||
"operation-status.html", "settings.html", "settings-database.html", "ords-handlers.html",
|
||||
"vpd-filter-policies.html", "mcp-chatbot.html", "mcp-reasoning.html", "mcp-client-demo.html",
|
||||
"mcp-sse.html")) {
|
||||
"mcp-sse.html", "structured-data.html")) {
|
||||
assertThat(template(page))
|
||||
.contains("<summary>도움말</summary>")
|
||||
.doesNotContain("context-summary")
|
||||
|
||||
Reference in New Issue
Block a user