Skip to content

Conversation

@laura-rodriguez
Copy link
Contributor

@laura-rodriguez laura-rodriguez commented Jan 7, 2025

Description

Reproducing 429/retry issues is a complex task as we’ll need to interact with a test Okta org to force a 429. To facilitate the testing and resolution of 429 responses, we need to create a mock HTTP listener that can be started from UTs and where responses can be tailored according to the test needs.

What's changed?

  • Added an HttpListener module for testing
  • Added HttpListener unit tests
  • Added a new module for private functions such as Invoke-OktaApiClient for testing purposes
  • Updated the templates so the Private module is always generated

Fix OKTA-849405

@laura-rodriguez laura-rodriguez marked this pull request as draft January 7, 2025 16:06
@laura-rodriguez laura-rodriguez changed the title Add a test HTTP listener that can started from UTs and responses can be tailored according to the test needs Add a test HTTP listener that can be started from UTs and responses can be tailored according to the test needs Jan 9, 2025
Copy link
Contributor

@bryanapellanes-okta bryanapellanes-okta left a comment

Choose a reason for hiding this comment

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

A question of curiosity but approved 👍

Remove-Module -Name Okta.PowerShell.PrivateFunctions -Verbose
}

It 'OktaApiClient should use the HttpListener when calling IWR' {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is IWR a known concept? What does it stand for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It refers to Invoke-WebRequest

@laura-rodriguez laura-rodriguez merged commit 4029070 into main Jan 20, 2025
5 checks passed
@laura-rodriguez laura-rodriguez deleted the lr-OKTA-849405-add-test-httplistener-to-improve-testeability branch January 20, 2025 16:37
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.

3 participants