Skip to content

[ADMINAPI-1448] Increase unit tests coverage in all unit tests V2/V3#392

Open
josephcampos-gap wants to merge 39 commits into
mainfrom
ADMINAPI-1448
Open

[ADMINAPI-1448] Increase unit tests coverage in all unit tests V2/V3#392
josephcampos-gap wants to merge 39 commits into
mainfrom
ADMINAPI-1448

Conversation

@josephcampos-gap

Copy link
Copy Markdown
Contributor

This pull request adds new and comprehensive unit tests for several core features in the Admin API, focusing on applications, authorization strategies, API client validation, and multi-tenancy middleware. The new tests improve coverage for validators, command handlers, and mapping logic, ensuring more robust validation and correct behavior across these components.

Unit tests for application features:

  • Added tests for the AddApplication and EditApplication validators to check for required fields, maximum lengths, and valid IDs. This includes new test classes AddApplicationValidatorTests and EditApplicationValidatorTests. [1] [2]
  • Introduced tests for the DeleteApplication handler to verify the delete command is executed and exceptions are handled.
  • Added a test for the ResetApplicationCredentials handler to ensure it throws a validation exception when the endpoint is disabled.

Unit tests for authorization strategies:

  • Added tests for AuthorizationStrategyMapper to verify correct mapping from data models to API models and preservation of list order.
  • Added tests for ReadAuthorizationStrategy to ensure the query returns correctly mapped strategies and proper HTTP results.

Improvements to API client validation:

  • Added tests to AddApiClientValidatorTests and EditApiClientValidatorTests to ensure validation errors are raised when OdsInstanceIds is null, in addition to when it is empty. [1] [2]

Unit tests for multi-tenancy middleware:

  • Introduced comprehensive tests for TenantResolverMiddleware, covering scenarios such as valid and invalid tenant headers, missing headers, Swagger requests, and V1 mode bypasses.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Test Results

   15 files     15 suites   1m 8s ⏱️
1 753 tests 1 739 ✅ 14 💤 0 ❌
4 125 runs  4 087 ✅ 38 💤 0 ❌

Results for commit b0c676f.

♻️ This comment has been updated with latest results.

josephcampos-gap and others added 19 commits July 3, 2026 07:43
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…mSetEditor

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…, and V2/V3 application commands

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… sweep

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
josephcampos-gap and others added 9 commits July 3, 2026 10:38
…overage tracker

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…plication, ReadClaimSets

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ance, V3 DataStore

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…adClaimSets V3

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ication V3

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
josephcampos-gap and others added 11 commits July 3, 2026 11:11
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…r, EditDataStore V3

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…Context, EditResourceClaimActions validator

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…r V2, CopyClaimSet V3 handler tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…etCommand InMemory test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…aims V2+V3, ReadOdsInstance handler tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…emaining gaps, and new issues

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…erage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant