Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration tests for Organizations Discovery GET API #21023

Conversation

BimsaraBodaragama
Copy link
Member

Description

This PR introduces a set of comprehensive integration tests for the Organization Discovery GET API, focusing on validating pagination and cursor-based navigation. The tests also cover various edge cases and failure scenarios, ensuring that the API responds correctly to invalid inputs and handles different pagination limits and offsets.

Purpose

The purpose of this PR is to enhance the test coverage of the Organization Discovery GET API by implementing thorough tests that verify the correct functionality of pagination, including both forward and backward navigation, and by ensuring the API's robustness against invalid inputs.

Goals

  • Verify that the pagination and offset-based navigation features in the Organization Discovery GET API function are as expected across various scenarios.
  • To ensure the API returns appropriate error responses when invalid pagination parameters, such as incorrect limits and offsets, are provided.
  • To improve the overall reliability of the API by covering standard use cases, as well as numeric and non-numeric edge cases.

Approach

  1. Success Tests:
  • Implemented tests for enabling email domain discovery and added email domains to multiple organizations for subsequent pagination tests.
  • Created a series of tests that validate pagination with different limits (e.g., 3, 5, 10, 15, 17, 20, 25), ensuring that the API correctly returns organizations based on the provided limit.
  • Added tests for offset-based pagination, validating the correct behavior of navigating forward and backward through organization pages, with checks for both next and previous links.
  • Included edge case tests for limits and offsets, verifying the API's behavior when limits are zero or exceed the total number of organizations.
  1. Failure Tests:
  • Added tests to ensure that providing an invalid pagination limit or offset (e.g., negative values, zero, or missing values) results in appropriate error responses, such as 400 Bad Request Error.
  • Implemented scenarios that validate the API's handling of non-numeric edge cases, such as empty or missing limit and offset parameters, ensuring robust error handling.

…cases of LIMIT query parameter and rename data providers adhering to a consistent format
@jenkins-is-staging
Copy link
Contributor

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/10694771862

@BimsaraBodaragama
Copy link
Member Author

All the tests passed locally:
image
Source: target/surefire-reports/emailable-report.html

@jenkins-is-staging
Copy link
Contributor

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/10694771862
Status: success

Copy link
Contributor

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

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

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/10694771862

@sahandilshan sahandilshan merged commit efc6e95 into wso2:master Sep 4, 2024
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.

4 participants