[Developer] #567 show recent SQL cursor candidates
This commit is contained in:
@@ -156,4 +156,28 @@ class ProbeResultTest {
|
||||
assertThat(result.executionEvidence().hasPredicatePlan()).isTrue();
|
||||
assertThat(result.effectiveSql()).contains("WHERE");
|
||||
}
|
||||
|
||||
@Test
|
||||
void keepsRecentCursorCandidatesWhenNoObjectMatchWasFound() {
|
||||
ProbeResult result = new ProbeResult(
|
||||
ProbeStatus.SUCCESS,
|
||||
List.of(),
|
||||
List.of(),
|
||||
0,
|
||||
List.of(),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
).withExecutionEvidence(null, "최근 cursor를 찾지 못했습니다.", List.of(
|
||||
new SqlExecutionCandidate(
|
||||
"candidate1", 0, "CB_ORDS", "SELECT 1 FROM dual", "2026-07-01T15:00", false)
|
||||
));
|
||||
|
||||
assertThat(result.hasExecutionEvidence()).isFalse();
|
||||
assertThat(result.hasExecutionCandidates()).isTrue();
|
||||
assertThat(result.executionCandidates()).hasSize(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,6 +110,7 @@ class GuidedFlowTemplateTest {
|
||||
assertThat(result)
|
||||
.contains("적용된 사용자와 권한")
|
||||
.contains("DB 실행 증적")
|
||||
.contains("최근 DB cursor 10건")
|
||||
.contains("실행 요청 SQL")
|
||||
.contains("실제 DB cursor SQL")
|
||||
.contains("set_vpd_context 사용자 컨텍스트")
|
||||
|
||||
@@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import com.cloudhandson.vpdbackoffice.domain.probe.ProbeResult;
|
||||
import com.cloudhandson.vpdbackoffice.domain.probe.ProbeStatus;
|
||||
import com.cloudhandson.vpdbackoffice.domain.probe.SqlExecutionCandidate;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -38,7 +39,10 @@ class ProbeResultTemplateRenderTest {
|
||||
"{}",
|
||||
"{}"
|
||||
).withExecutionEvidence(null,
|
||||
"백오피스 DB 연결이 실제 DB cursor SQL을 읽지 못했습니다. 현재 권한 검증 결과는 정상입니다.");
|
||||
"최근 cursor를 찾지 못했습니다.",
|
||||
List.of(new SqlExecutionCandidate(
|
||||
"4f2jz7n2k0s3p", 0, "CB_ORDS",
|
||||
"SELECT * FROM ADMIN.CB_V_SEARCH_DOCUMENTS", "2026-07-01T15:00", true)));
|
||||
var context = new Context(Locale.KOREAN);
|
||||
context.setVariable("result", result);
|
||||
context.setVariable("vectorSearch", false);
|
||||
@@ -47,6 +51,10 @@ class ProbeResultTemplateRenderTest {
|
||||
|
||||
String rendered = engine.process("fragments/probe-result", context);
|
||||
|
||||
assertThat(rendered).contains("백오피스 DB 연결이 실제 DB cursor SQL을 읽지 못했습니다.");
|
||||
assertThat(rendered)
|
||||
.contains("최근 cursor를 찾지 못했습니다.")
|
||||
.contains("최근 DB cursor 10건")
|
||||
.contains("4f2jz7n2k0s3p")
|
||||
.contains("보호 대상 일치");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user