Skip to content

test: add unit tests for attestation type processors (JUnit, Snyk, SonarQube, Jira)#119

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/add-unit-tests-for-attestation-processors
Draft

test: add unit tests for attestation type processors (JUnit, Snyk, SonarQube, Jira)#119
Copilot wants to merge 1 commit intomainfrom
copilot/add-unit-tests-for-attestation-processors

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

Four attestation processors (JunitAttestationProcessor, SnykAttestationProcessor, SonarAttestationProcessor, JiraAttestationProcessor) had no test coverage.

Tests added

Each test class is a pure unit test (no Spring context) directly instantiating the processor under test.

  • JunitAttestationProcessorTest — passing XML, failures/errors > 0 → FAILED, malformed XML, empty document
  • SnykAttestationProcessorTest — SARIF and Snyk JSON formats; 0 vulns → PASSED, >0 → FAILED, malformed JSON
  • SonarAttestationProcessorTest — flat {"status":"OK/ERROR"} and nested {"projectStatus":{"status":...}}; PASSED string alias; malformed JSON
  • JiraAttestationProcessorTest — valid/invalid [A-Z]+-\d+ key as plain text and within JSON issueRef; malformed JSON

All processors follow the same contract: parse input, set attestation.status, populate attestation.details, and fall through to FAILED with an "error" detail on any parse exception.

@Test
fun `malformed XML sets status FAILED with error details`() {
    val attestation = makeAttestation()
    processor.process("<<not valid xml!!>>".toByteArray(), attestation)

    assertEquals(AttestationStatus.FAILED, attestation.status)
    assertTrue(attestation.details!!.contains("error"))
}

Copilot AI changed the title [WIP] Add unit tests for attestation type processors test: add unit tests for attestation type processors (JUnit, Snyk, SonarQube, Jira) Apr 20, 2026
Copilot AI requested a review from MaximumTrainer April 20, 2026 17:50
@MaximumTrainer MaximumTrainer requested review from Copilot and removed request for MaximumTrainer April 20, 2026 17:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add unit tests for attestation type processors (JUnit, Snyk, SonarQube, Jira)

3 participants