Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

Uncomfortable ExpoPushClient singleton design. #5

Open
Bryksin opened this issue Apr 14, 2020 · 1 comment
Open

Uncomfortable ExpoPushClient singleton design. #5

Bryksin opened this issue Apr 14, 2020 · 1 comment

Comments

@Bryksin
Copy link

Bryksin commented Apr 14, 2020

Hi

We use Spring Boot for our back-end, and based on the active profile (dev, qa, prod) we would need to either send real notification or fake it.
I saw your UnitTests and the way you mock WebServer, however, with the mock server, u manually created retrofit object with custom BASE_URL to mock WebServer and later u use raw ExpoPushService instead of ExpoPushClient

First of all your unit tests missing some coverage of actual ExpoPushClient (for example how u handle the response in case isSuccessful or failure)
Secondly, such an approach is not nicely working for dynamic beans which are based on profiles.
In real code we use ExpoPushClient not raw ExpoPushService therefore there must be an option to create ExpoPushClient object with mock WebServer and custom BASE_URL, that would allow to set up dynamic been based on the profile (mock for DEV profile and real for QA and PROD)

However, right now in ExpoPushClient the BASE_URL, retrofit and service are private static final and cannot be modified nicely.

@celandro
Copy link

celandro commented Aug 4, 2020

There are a few other issues with the code but I don't want to get too deep into it right now.

The bigger issue seems to be this repo is no longer being maintained by the owner.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants