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 GET API #20932

Conversation

BimsaraBodaragama
Copy link
Member

Description

This PR adds a comprehensive set of integration tests for the Organizations GET API. The tests focus on validating the correct functionality of pagination and cursor-based navigation, including handling various edge cases. Additionally, failure scenarios are tested to ensure proper error handling when invalid inputs are provided.

Purpose

The purpose of this PR is to enhance the test coverage of the Organizations GET API by implementing comprehensive tests that verify the correct behaviour of pagination features.

Goals

  • To validate the correct functionality of the pagination and cursor-based navigation features in the Organizations GET API.
  • To ensure that the API returns appropriate error responses for invalid inputs, such as incorrect pagination limits and cursor values.
  • To improve the overall stability and reliability of the API by covering both standard and edge cases.

Approach

  1. Success Tests:
  • Implemented tests for pagination with different limits (10, 20, 25), verifying that the API correctly handles varying limits.
  • Added cursor-based pagination tests to validate the functionality of navigating through pages using after and before cursors.
  • Included checks for edge cases, such as when the limit equals or exceeds the total number of organizations, ensuring correct API behaviour.
  1. Failure Tests:
  • Added tests to validate that providing an invalid pagination limit (e.g., -1) results in a 400 Bad Request response.
  • Implemented tests for invalid cursor values, ensuring that the API returns appropriate error messages when invalid after or before cursor values are used.

@BimsaraBodaragama
Copy link
Member Author

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

@ShanChathusanda93 ShanChathusanda93 merged commit 185420d into wso2:master Aug 27, 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.

6 participants