Skip to content

Convert VenmoClientUnitTest to kotlin #1306

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

saralvasquez
Copy link
Contributor

Summary of changes

  • Converts VenmoClientUnitTest file from Java to Kotlin
  • Converts MockVenmoApiBuilder to Kotlin and deprecates the java version
  • Fixes/adds functionality in MockkBraintreeClientBuilder to support venmo test functionality

Checklist

  • Added a changelog entry
  • Relevant test coverage
  • Tested and confirmed payment flows affected by this change are functioning as expected

Authors

List GitHub usernames for everyone who contributed to this pull request.

@saralvasquez saralvasquez requested a review from a team as a code owner April 24, 2025 18:10
Comment on lines +114 to +124
sut = VenmoClient(
braintreeClient,
apiClient,
venmoApi,
sharedPrefsWriter,
analyticsParamRepository,
merchantRepository,
venmoRepository,
getReturnLinkTypeUseCase,
getReturnLinkUseCase
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What are your thoughts on creating the VenmoClient in the @before function? One benefit is that we won't need to update all unit tests if the dependencies end up changing. It also might not be possible if we need to test certain behavior in the VenmoClient's init.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah... I was thinking about this. You mentioning it makes me think it's worth the added effort. I'll look into it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok so there are like 13 iterations of VenmoClient parameters that are passed in the tests depending on what functionality is being tested. I think there might be a way to abstract away some of the parameters since braintreeClient and venmoApi are the only ones that change, but I think that might be more complicated than simply creating the client in the @before

@@ -7,6 +7,7 @@

import org.mockito.stubbing.Answer;

@Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

If deprecating do we need to call out in Changelog?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a great question! I figured that since it's only relevant to unit tests and isn't used anywhere it wasn't necessary to call it out in the CHANGELOG, but that was just a guess on best protocol. Do you all have any guidelines on CHANGELOG messages for tests?

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.

4 participants