Skip to content
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

EventResponse cannot be constructed during tests #57

Open
lorenzo-bc opened this issue Aug 18, 2020 · 0 comments
Open

EventResponse cannot be constructed during tests #57

lorenzo-bc opened this issue Aug 18, 2020 · 0 comments

Comments

@lorenzo-bc
Copy link

lorenzo-bc commented Aug 18, 2020

I'm writing a local implementation of the Sift client and I'm adding integration tests. My (simplified) interface is

interface SiftPPService {
    fun createOrder(event: SiftPPCreateOrderEvent): EventResponse
}

And this interface has both a local and a remote implementation.
In the Local implementation I have to construct a com.siftscience.EventResponse object but this has a protected constructor so cannot be done. This is required in order to test scenario like 'what happens if the API returns a very specific fraud score or a specific error code'

Is there another way to build a EventResponse in a test without performing a remote call to the Sift API?
Note that EventResponseBody can be constructed but EventResponse not.

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

No branches or pull requests

1 participant