Skip to content

Add comprehensive Postman tests for search - #135

Merged
jdaigneau5 merged 3 commits into
devfrom
af/postman-search-tests
Aug 20, 2026
Merged

jdaigneau5 merged 3 commits into
devfrom
af/postman-search-tests

Conversation

@afoote-mitre

@afoote-mitre afoote-mitre commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add a generated Postman collection covering every documented POST /search field, representative filter combinations, deterministic validation failures, and optional manual fault-injection checks.
  • Add local and dev Postman environments plus instructions for importing, running, maintaining, and recalibrating fixture-based checks.
  • Return status: "ok" consistently from successful semantic post-filter searches so CVSS, SSVC, KEV date, cpeName, and virtualMatchString responses match the standard search response shape.
  • Link the manual Postman suite from the repository README.

Why These Changes Are Needed

Semantic post-filter searches returned pagination and hit data but omitted the top-level success status produced by ordinary searches. This caused response-contract checks to fail even when the requested filter returned the correct CVE records.

The API also lacked a maintainable manual test collection covering its complete search contract. The builder now checks that every documented SearchRequest property has positive Postman coverage and generates portable local/dev artifacts from one source file.

Primary Files

  • controllers/searchController.js: adds the missing success status to optimized post-filter responses.
  • controllers/searchController.test.js: locks the consistent response shape across semantic filter paths.
  • test/postman/buildCollection.js: defines and generates the complete manual contract suite.
  • test/postman/CVE-Search-API.postman_collection.json: importable generated collection.
  • test/postman/local.postman_environment.json: localhost configuration.
  • test/postman/dev.postman_environment.json: deployed dev configuration.
  • test/postman/README.md: usage, fixture, maintenance, and fault-injection guidance.
  • README.md: links to the Postman documentation.

@afoote-mitre afoote-mitre self-assigned this Aug 20, 2026
@jdaigneau5
jdaigneau5 merged commit 06f0ff3 into dev Aug 20, 2026
1 check 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