Class Description
- java.lang.Object
-
- org.mockito.internal.verification.Description
-
- All Implemented Interfaces:
VerificationMode
public class Description extends java.lang.Object implements VerificationMode
Description verification mode wraps an existing verification mode and prepends a custom message to the assertion error if verification fails.- Since:
- 2.1.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
description
private VerificationMode
verification
-
Constructor Summary
Constructors Constructor Description Description(VerificationMode verification, java.lang.String description)
Constructs a verification mode which wraps the given verification mode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
verify(VerificationData data)
Performs verification using the wrapped verification mode implementation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mockito.verification.VerificationMode
description
-
-
-
-
Field Detail
-
verification
private final VerificationMode verification
-
description
private final java.lang.String description
-
-
Constructor Detail
-
Description
public Description(VerificationMode verification, java.lang.String description)
Constructs a verification mode which wraps the given verification mode.- Parameters:
verification
- The implementation to use for verificationdescription
- The failure message to prepend if verification fails
-
-
Method Detail
-
verify
public void verify(VerificationData data)
Performs verification using the wrapped verification mode implementation. Prepends the custom failure message if verification fails.- Specified by:
verify
in interfaceVerificationMode
- Parameters:
data
- the data to be verified
-
-