Skip to content

Conversation

@mattinannt
Copy link
Member

This pull request adds three new test cases to the FormbricksApiServiceInstrumentedTest class to improve the robustness and reliability of the FormbricksApiService by covering additional edge cases.

New test cases added:

  • Error handling for null attributes in postUser:

    • Added testPostUser_withNullAttributes_handlesErrorGracefully to ensure the postUser method handles cases where user attributes are null without crashing.
  • Robustness of multiple initializations:

    • Added testInitialize_multipleTimes_noCrash to verify that calling initialize multiple times with different configurations does not result in a crash or exception.
  • Behavior before initialization:

    • Added testGetEnvironmentStateObject_beforeInitialize_returnsFailure to confirm that calling getEnvironmentStateObject before initializing the service fails gracefully with an appropriate exception (UninitializedPropertyAccessException).

@mattinannt mattinannt merged commit 83bd2e7 into main May 15, 2025
3 checks passed
@sonarqubecloud
Copy link

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.

2 participants