Add api_test.mustache template for auto-generated test classes#1674
Open
agrja-rastogi-okta wants to merge 2 commits intomasterfrom
Open
Add api_test.mustache template for auto-generated test classes#1674agrja-rastogi-okta wants to merge 2 commits intomasterfrom
agrja-rastogi-okta wants to merge 2 commits intomasterfrom
Conversation
This template generates comprehensive unit tests for all API operations. Each test: - Loads prerequisite data created by Terraform - Extracts method parameters from the prerequisite data - Executes the actual API method - Validates HTTP response codes (200, 201, 202, 204) The template includes: - Smart parameter extraction that handles field name variations - Support for file uploads via file_path parameter - Automatic model deserialization with fallback to alternative class names - Comprehensive error handling and validation - Javadoc comments explaining test behavior This enables automated testing of all Okta SDK operations against live APIs while maintaining code consistency and reducing manual test maintenance.
The toSnakeCase method was not being called anywhere in the template. The camelCase to snake_case conversion is already handled by TerraformHelper.getPrerequisiteDataForTest() on the backend.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This template generates comprehensive unit tests for all API operations. Each test:
The template includes:
This enables automated testing of all Okta SDK operations against live APIs while maintaining code consistency and reducing manual test maintenance.