From d4fd46155ec1b730e9aa16791d8f81f42ccfd085 Mon Sep 17 00:00:00 2001 From: shankar0123 Date: Sun, 22 Mar 2026 15:55:44 -0400 Subject: [PATCH] fix: unused certRepo variable and missing revocation wiring - revocation_test.go: certRepo unused in TestGenerateDERCRL_Success, replaced with blank identifier - lifecycle_test.go: missing revocationRepo init and setter calls (SetRevocationRepo, SetNotificationService, SetIssuerRegistry) that negative_test.go already had Co-Authored-By: Claude Opus 4.6 --- internal/integration/lifecycle_test.go | 4 ++++ internal/service/revocation_test.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/integration/lifecycle_test.go b/internal/integration/lifecycle_test.go index 5ac3831..53743d2 100644 --- a/internal/integration/lifecycle_test.go +++ b/internal/integration/lifecycle_test.go @@ -52,6 +52,10 @@ func TestCertificateLifecycle(t *testing.T) { policyService := service.NewPolicyService(policyRepo, auditService) certificateService := service.NewCertificateService(certRepo, policyService, auditService) notificationService := service.NewNotificationService(notifRepo, make(map[string]service.Notifier)) + revocationRepo := newMockRevocationRepository() + certificateService.SetRevocationRepo(revocationRepo) + certificateService.SetNotificationService(notificationService) + certificateService.SetIssuerRegistry(issuerRegistry) renewalService := service.NewRenewalService(certRepo, jobRepo, renewalPolicyRepo, nil, auditService, notificationService, issuerRegistry, "server") deploymentService := service.NewDeploymentService(jobRepo, targetRepo, agentRepo, certRepo, auditService, notificationService) jobService := service.NewJobService(jobRepo, renewalService, deploymentService, logger) diff --git a/internal/service/revocation_test.go b/internal/service/revocation_test.go index f4a72cd..c02baa3 100644 --- a/internal/service/revocation_test.go +++ b/internal/service/revocation_test.go @@ -412,7 +412,7 @@ func TestRevokeCertificate_HandlerInterfaceMethod(t *testing.T) { // M15b: CRL and OCSP Service Tests func TestGenerateDERCRL_Success(t *testing.T) { - svc, certRepo, revocationRepo, _ := newRevocationTestService() + svc, _, revocationRepo, _ := newRevocationTestService() // Add some revoked certificates to the repo now := time.Now()