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 <noreply@anthropic.com>
This commit is contained in:
shankar0123
2026-03-22 15:55:44 -04:00
parent 5407fabe1d
commit d4fd46155e
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -52,6 +52,10 @@ func TestCertificateLifecycle(t *testing.T) {
policyService := service.NewPolicyService(policyRepo, auditService) policyService := service.NewPolicyService(policyRepo, auditService)
certificateService := service.NewCertificateService(certRepo, policyService, auditService) certificateService := service.NewCertificateService(certRepo, policyService, auditService)
notificationService := service.NewNotificationService(notifRepo, make(map[string]service.Notifier)) 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") renewalService := service.NewRenewalService(certRepo, jobRepo, renewalPolicyRepo, nil, auditService, notificationService, issuerRegistry, "server")
deploymentService := service.NewDeploymentService(jobRepo, targetRepo, agentRepo, certRepo, auditService, notificationService) deploymentService := service.NewDeploymentService(jobRepo, targetRepo, agentRepo, certRepo, auditService, notificationService)
jobService := service.NewJobService(jobRepo, renewalService, deploymentService, logger) jobService := service.NewJobService(jobRepo, renewalService, deploymentService, logger)
+1 -1
View File
@@ -412,7 +412,7 @@ func TestRevokeCertificate_HandlerInterfaceMethod(t *testing.T) {
// M15b: CRL and OCSP Service Tests // M15b: CRL and OCSP Service Tests
func TestGenerateDERCRL_Success(t *testing.T) { func TestGenerateDERCRL_Success(t *testing.T) {
svc, certRepo, revocationRepo, _ := newRevocationTestService() svc, _, revocationRepo, _ := newRevocationTestService()
// Add some revoked certificates to the repo // Add some revoked certificates to the repo
now := time.Now() now := time.Now()