Class Description

java.lang.Object
org.mockito.internal.verification.Description
All Implemented Interfaces:
VerificationMode

public class Description extends 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
  • Constructor Details

    • Description

      public Description(VerificationMode verification, String description)
      Constructs a verification mode which wraps the given verification mode.
      Parameters:
      verification - The implementation to use for verification
      description - The failure message to prepend if verification fails
  • Method Details

    • 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 interface VerificationMode
      Parameters:
      data - the data to be verified