Skip to content

test(asset): fix two order/data-dependent sanity test failures - #285

Merged
reeshika-h merged 2 commits into
developmentfrom
fix/asset-sanity-test-isolation
Nov 24, 2026
Merged

reeshika-h merged 2 commits into
developmentfrom
fix/asset-sanity-test-isolation

Conversation

@reeshika-h

@reeshika-h reeshika-h commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

What

Two test-only fixes that were the last failures in the Java CMA sanity runs. No SDK source changes.

  1. AssetUnitTest.testPublishIncludesApiVersionHeader added api_version: 3.2 to the shared static asset, so any later test reusing it saw 3 headers. testAssetGetByTypeVideo asserts exactly 2 and failed (expected: <2> but was: <3>) in the AWS-NA prod pipeline. The publish test now builds its own Asset, like testApiVersionHeaderScopedToPublish already does.
  2. AssetAPITest.testFindAssetsAllScanStatusesAreValid searched the whole list response for a status string. On dev11 the first page contains only assets created before scanning was enabled, which have no _asset_scan_status, so the check failed although nothing was wrong. It now parses assets and validates the status only on assets that carry one. Presence of the field on new assets is still covered by the upload, fetch and find-with-uploaded-asset tests.

Verification

Full suite against a dev11 stack with these changes: Tests run: 545, Failures: 0, Errors: 0, Skipped: 17.

Not included

No changes to pom.xml, TestClient or any credentials.

🤖 Generated with Claude Code

Follow-up commit

  1. Nine AssetUnitTest tests (testAssetSingle, testAssetReplace, testAssetDelete, testAssetRteInformation, testAssetSetVersionName, testAssetDeleteVersionName, testAssetUnpublish, testAssetSingleFolder, testAssetCreateFolder) asserted 3 headers, a value commit 61dd73b raised to match the api_version header leaked by fix 1. With the leak removed a request carries api_key and authorization only, so they now assert 2, consistent with the other AssetUnitTest cases. Full suite re-run on dev11: 545 tests, 0 failures.

- AssetUnitTest.testPublishIncludesApiVersionHeader added api_version to the
  shared static Asset, leaking a third header into later tests, so
  testAssetGetByTypeVideo (asserts exactly 2 headers) failed in CI. Use a
  fresh Asset for the publish test.
- AssetAPITest.testFindAssetsAllScanStatusesAreValid searched the whole list
  body for a status string, which fails when the first page only holds assets
  created before scanning was enabled (no _asset_scan_status field). Parse the
  list and validate the status only on assets that carry one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@reeshika-h
reeshika-h requested a review from a team as a code owner November 24, 2026 10:35
@snyk-io

snyk-io Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

…d api_version

Commit 61dd73b raised these assertions to 3 to match the api_version header
leaked from testPublishIncludesApiVersionHeader through the shared static
Asset. With the publish test isolated, a request carries only api_key and
authorization, so assert 2 like the other AssetUnitTest cases.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@reeshika-h
reeshika-h merged commit 77b2b43 into development Nov 24, 2026
9 checks passed
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.

2 participants