Skip to content

MemberSubstitution.failIfNoMatch seems to be ignored #1780

Answered by raphw
manoelcampos asked this question in Q&A
Discussion options

You must be logged in to vote

failIfNoMatch is meant to fail an application if a method does not contain any substitution that is specified. That means, you mean to replace a callback method, but the method has changed and does no longer contain an invocation to a callback.

The error you are getting is different. It says that you try to replace a method with another, by using a matcher, but the matcher does not yield exactly one replacement. If you want to only replace a method or field if a method exists, you should already exclude that element in the method or field matcher that identifies the element that is to be substituted.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@manoelcampos
Comment options

@manoelcampos
Comment options

@raphw
Comment options

@manoelcampos
Comment options

Answer selected by manoelcampos
Comment options

You must be logged in to vote
2 replies
@manoelcampos
Comment options

@manoelcampos
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants