Interface ContainsExtraTypeInfo

  • All Known Implementing Classes:
    ArrayEquals, Equals

    public interface ContainsExtraTypeInfo
    Intended to use in certain ArgumentMatchers. When ArgumentMatcher fails, chance is that the actual object has the same output of toString() than the wanted object. This looks weird when failures are reported. Therefore when matcher fails but toString() yields the same outputs, we will try to use the toStringWithType(String) method.
    • Method Detail

      • toStringWithType

        java.lang.String toStringWithType​(java.lang.String className)
        Parameters:
        className - - name of the class to be printed in description Returns more verbose description of the object which include type information
      • typeMatches

        boolean typeMatches​(java.lang.Object target)
        Checks if target target has matching type. If the type matches, there is no point in rendering result from toStringWithType(String)
      • getWanted

        java.lang.Object getWanted()
        Returns:
        Returns the wanted argument