Skip to content

Rust SDK: test coverage for admin.audit.search(filters) #767

Description

@Mac-5

Description
Add focused unit tests for admin.audit.search(filters) and admin.audit.export_csv(filters) (implemented in Issue #124) using a mocked HTTP transport — no live server, no database.

Scope guardrail: this PR must only touch files under sdks/rust/. Do not touch anything under src/ — read the handler referenced below only to learn the request/response contract.

Requirements and context

  • Cover the happy path for both JSON search and CSV export modes.
  • Test the cursor pagination edge case: the last page (where next_cursor is null) must be clearly distinguishable from a mid-stream page that happens to have zero results in the data array.
  • Test that applying all optional filters (actor, action, from_date, to_date, entity_type) correctly serialises them as query parameters.
  • Test that the admin key (not the public key) is sent.
  • Depends on Issue Cursor Pagination Unit Tests #124.

Suggested execution

  1. Fork the repo and create a branch
    git checkout -b feature/rust-sdk-test-coverage-for-adminauditsearch
  2. Implement changes
    • Set up a mocked HTTP transport returning canned JSON and CSV responses.
    • Write happy-path tests for the JSON and CSV modes.
    • Write the last-page cursor edge case test.
    • Write the filter serialisation test.
    • Confirm cargo test is green with no network access required.
  3. Test and commit
    • Run the crate's test command and confirm it's green
    • Example commit message: test(sdk): add coverage for admin audit search method

Guidelines

  • Assignment required before starting
  • PR description must include: Closes #125
  • PR must only touch files under sdks/rust/
  • Complexity: High (200 points) — Every issue in this Wave is tagged High — full points regardless of individual scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions