Skip to content

chore: add more tests to Formbricks Api Service#15

Merged
mattinannt merged 2 commits into
mainfrom
chore/more-tests2
May 15, 2025
Merged

chore: add more tests to Formbricks Api Service#15
mattinannt merged 2 commits into
mainfrom
chore/more-tests2

Conversation

@mattinannt
Copy link
Copy Markdown
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
Copy Markdown

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.

1 participant