feat: record DDS protection evidence

This commit is contained in:
devmrko
2026-06-30 20:56:52 +09:00
parent f162851bc6
commit 22a7eda219
17 changed files with 985 additions and 18 deletions

View File

@@ -6,11 +6,15 @@ import com.cloudhandson.ddsbackoffice.config.DdsProperties;
import com.cloudhandson.ddsbackoffice.domain.DdsGrantInventoryEntry;
import com.cloudhandson.ddsbackoffice.domain.DdsGrantInventorySnapshot;
import com.cloudhandson.ddsbackoffice.domain.DdsGrantPlan;
import com.cloudhandson.ddsbackoffice.domain.DdsPublishedProtectionSpec;
import com.cloudhandson.ddsbackoffice.domain.DdsProvisioningPlan;
import com.cloudhandson.ddsbackoffice.domain.DdsValidationEvidence;
import com.cloudhandson.ddsbackoffice.domain.DdsValidationFixture;
import java.time.Duration;
import java.time.Instant;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.junit.jupiter.api.Test;
class DdsProtectionStatusServiceTest {
@@ -20,7 +24,8 @@ class DdsProtectionStatusServiceTest {
DdsGrantInventory inventory = object -> new DdsGrantInventorySnapshot(
false, List.of(), Instant.parse("2026-06-30T00:00:00Z"), "catalog 접근 실패"
);
var service = new DdsProtectionStatusService(properties(), inventory, emptyPlanProvider());
var service = new DdsProtectionStatusService(
properties(), inventory, emptyPlanProvider(), emptyEvidenceStore());
var overview = service.overview();
@@ -42,7 +47,7 @@ class DdsProtectionStatusServiceTest {
"ADMIN.CB_DDS_VECTOR_SEARCH_DOCUMENTS", "DDS_DEMO_BOTH_VECTOR_GRANT", "1 = 1", "",
"CREATE DATA GRANT", true, "게시 가능"
)), List.of(), 1);
var service = new DdsProtectionStatusService(properties(), inventory, provider);
var service = new DdsProtectionStatusService(properties(), inventory, provider, emptyEvidenceStore());
var overview = service.overview();
@@ -51,7 +56,7 @@ class DdsProtectionStatusServiceTest {
var direct = service.directComparison();
assertEquals(1, direct.size());
assertEquals("재검증 필요", direct.getFirst().primaryLabel());
assertEquals("선언 관측", direct.getFirst().synchronizationLabel());
assertEquals("게시 기준 미등록", direct.getFirst().synchronizationLabel());
}
@Test
@@ -67,7 +72,7 @@ class DdsProtectionStatusServiceTest {
"ADMIN.CB_DDS_VECTOR_SEARCH_DOCUMENTS", "DDS_DEMO_BOTH_VECTOR_GRANT", "", "", "",
false, "ALLOW 규칙 없음"
)), List.of(), 1);
var service = new DdsProtectionStatusService(properties(), inventory, provider);
var service = new DdsProtectionStatusService(properties(), inventory, provider, emptyEvidenceStore());
var direct = service.directComparison().getFirst();
@@ -89,4 +94,32 @@ class DdsProtectionStatusServiceTest {
private static DdsProvisionPlanProvider emptyPlanProvider() {
return () -> new DdsProvisioningPlan(List.of(), List.of(), 0);
}
private static DdsProtectionEvidenceStore emptyEvidenceStore() {
return new DdsProtectionEvidenceStore() {
@Override
public Optional<DdsPublishedProtectionSpec> latestPublished(String path, String subjectKey) {
return Optional.empty();
}
@Override
public Optional<DdsValidationEvidence> latestValidation(String path, String subjectKey) {
return Optional.empty();
}
@Override
public List<DdsValidationFixture> activeFixtures(String path) {
return List.of();
}
@Override
public void recordPublished(DdsPublishedProtectionSpec spec, String actor, String note) {
}
@Override
public void recordValidation(String runId, String fixtureId, String path, String subjectKey,
boolean expectedVisible, boolean actualVisible, String fingerprint) {
}
};
}
}