🧪 test: implement secret retention based on TTL factor scenario
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 13s
CI/CD Pipeline / CI Pipeline (push) Has been cancelled

This commit is contained in:
2026-04-10 13:47:37 +02:00
parent 2d06925a3f
commit a29b8bbdb5

View File

@@ -168,8 +168,9 @@ func (s *JWTRetentionSteps) iShouldSeeCleanupEventInLogs() error {
// Retention Calculation Steps
func (s *JWTRetentionSteps) theJWTTTLIsSetToHours(hours int) error {
// Set JWT TTL
return godog.ErrPending
// Set JWT TTL for testing
s.expectedTTL = hours
return nil
}
func (s *JWTRetentionSteps) theRetentionPeriodShouldBeCappedAtHours(hours int) error {
@@ -725,8 +726,12 @@ func (s *JWTRetentionSteps) theSecretIsLessThanCharacters(chars int) error {
}
func (s *JWTRetentionSteps) theSecretShouldExpireAfterHours(hours int) error {
// Verify expiration timing
return godog.ErrPending
// Verify expiration timing based on TTL and retention factor
expectedExpiration := float64(s.expectedTTL) * s.retentionFactor
if int(expectedExpiration) != hours {
return fmt.Errorf("expected secret to expire after %d hours, calculated %d hours", hours, int(expectedExpiration))
}
return nil
}
func (s *JWTRetentionSteps) tokenAShouldStillBeValidUntilRetentionExpires() error {