Skip to content

Multiple stubbings with throwException causes unexpected behavior #537

@dindy

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions