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

Uncomfortable ExpoPushClient singleton design. #5

Description

@Bryksin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions