test: add unit tests for ScmIntegrationService, ScmTokenEncryptionService, and OidcAttestationService#118
Merged
MaximumTrainer merged 1 commit intomainfrom Apr 20, 2026
Conversation
3 tasks
Copilot
AI
changed the title
[WIP] Add unit tests for ScmIntegrationService, ScmTokenEncryptionService, and OidcAttestationService
test: add unit tests for ScmIntegrationService, ScmTokenEncryptionService, and OidcAttestationService
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three services lacked any test coverage:
ScmIntegrationService(SCM integration CRUD),ScmTokenEncryptionService(AES-256-GCM token encryption), andOidcAttestationService(OIDC JWT attestation with JTI replay protection).New test classes (17 tests total, no Spring context)
ScmIntegrationServiceUnitTest— CRUD happy paths,ConflictExceptionon duplicate provider,NotFoundExceptionon missing integration; uses Mockito for the repository and a liveScmTokenEncryptionServiceinstance.ScmTokenEncryptionServiceTest— encrypt→decrypt round-trip, IV randomness (two encryptions of the same plaintext must differ), short-key zero-padding, empty string, 10 000-char token, and rejection of invalid base64 ciphertext.OidcAttestationServiceTest— GitHub Actions and GitLab CI happy paths producePASSEDattestations;NotFoundExceptionfor unknown trail;IllegalArgumentExceptionfor untrusted issuer and missingissclaim;ConflictExceptionon JTI replay.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
invalid-confluence.example.com/usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -Dorg.gradle.internal.worker.tmpdir=/home/REDACTED/work/OpenFactstore/OpenFactstore/backend/build/tmp/test/work @/home/REDACTED/.gradle/.tmp/gradle-worker-classpath11858267110009719177txt -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 4'(dns block)invalid-jira-url-that-does-not-exist.example.com/usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -Dorg.gradle.internal.worker.tmpdir=/home/REDACTED/work/OpenFactstore/OpenFactstore/backend/build/tmp/test/work @/home/REDACTED/.gradle/.tmp/gradle-worker-classpath11858267110009719177txt -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 4'(dns block)invalid-jira.example.com/usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -Dorg.gradle.internal.worker.tmpdir=/home/REDACTED/work/OpenFactstore/OpenFactstore/backend/build/tmp/test/work @/home/REDACTED/.gradle/.tmp/gradle-worker-classpath11858267110009719177txt -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 4'(dns block)If you need me to access, download, or install something from one of these locations, you can either: