Skip to content

Add OkHttpClientProvider tests#48958

Closed
mateoguzmana wants to merge 3 commits into
facebook:mainfrom
mateoguzmana:test/ok-http-client-provider-tests
Closed

Add OkHttpClientProvider tests#48958
mateoguzmana wants to merge 3 commits into
facebook:mainfrom
mateoguzmana:test/ok-http-client-provider-tests

Conversation

@mateoguzmana
Copy link
Copy Markdown
Collaborator

Summary:

Currently, the class OkHttpClientProvider is still in Java. Adding some tests before migrating it to Kotlin

Changelog:

[INTERNAL] - Add OkHttpClientProvider tests

Test Plan:

./gradlew :packages:react-native:ReactAndroid:test -Dtest.single=com.facebook.react.modules.network

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jan 27, 2025
Copy link
Copy Markdown
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

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

Also not a huge fan of us using reflection here. But if you plan on migrating OkHttpClientProvider to Kotlin, then you can make those fields internal to make this test cleaner

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Co-authored-by: Nicola Corti <corti.nico@gmail.com>
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@mateoguzmana
Copy link
Copy Markdown
Collaborator Author

Thanks for the feedback @cortinico, I cleaned this up a bit in 36b5556. Will make sure to clean up the reflection as well when migrating the class to Kotlin

@cortinico
Copy link
Copy Markdown
Contributor

Thanks for the feedback @cortinico, I cleaned this up a bit in 36b5556. Will make sure to clean up the reflection as well when migrating the class to Kotlin

Never mind. I actually have to commit a different version of this file, due to differences in the OkHTTP version between internal and OSS. I'd just skip 36b5556 if you don't mind and we can follow-up on the cleanup after your migration

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jan 28, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cortinico merged this pull request in 9572bcf.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @mateoguzmana in 9572bcf

When will my fix make it into a release? | How to file a pick request?

facebook-github-bot pushed a commit that referenced this pull request Feb 12, 2025
Summary:
Migrate com.facebook.react.modules.network.OkHttpClientProvider to Kotlin. Also, as follow up from #48958 I'm cleaning up the reflection on `OkHttpClientProviderTest` as we can make `sClient` and `sFactory` internal.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.modules.network.OkHttpClientProvider to Kotlin

Pull Request resolved: #49108

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D69050956

Pulled By: javache

fbshipit-source-id: 62dcf8e8f999f3b687c57ed02e9ac1f2db8183ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants