Skip to content

Multiple stubbings with throwException causes unexpected behavior #537

Description

@dindy

When you set two stubbings that match the same invocation with the first stubbing calling throwException declaring the second stubbing trigger the exception of the first stubbing.

Example :

td.when(dep()).thenThrow(new Error())
td.when(dep()).thenReturn(true)

Executing the above code will throw an error of type Error.

I think it relates to this issue. Not sure if it can be fixed in testdouble but is there at least a workaround ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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