Skip to content

EventResponse cannot be constructed during tests #57

@lorenzo-bc

Description

@lorenzo-bc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions