Class InterceptedInvocation

    • Field Detail

      • arguments

        private final java.lang.Object[] arguments
      • rawArguments

        private final java.lang.Object[] rawArguments
      • sequenceNumber

        private final int sequenceNumber
      • location

        private final Location location
      • verified

        private boolean verified
      • isIgnoredForVerification

        private boolean isIgnoredForVerification
    • Constructor Detail

      • InterceptedInvocation

        public InterceptedInvocation​(MockReference<java.lang.Object> mockRef,
                                     MockitoMethod mockitoMethod,
                                     java.lang.Object[] arguments,
                                     RealMethod realMethod,
                                     Location location,
                                     int sequenceNumber)
    • Method Detail

      • getSequenceNumber

        public int getSequenceNumber()
        Specified by:
        getSequenceNumber in interface Invocation
        Returns:
        the sequence number of the Invocation. Useful to determine the order of invocations. Used by verification in order.
      • getRawArguments

        public java.lang.Object[] getRawArguments()
        Description copied from interface: Invocation
        Returns unprocessed arguments whereas InvocationOnMock.getArguments() returns arguments already processed (e.g. varargs expended, etc.).
        Specified by:
        getRawArguments in interface Invocation
        Returns:
        unprocessed arguments, exactly as provided to this invocation.
      • getRawReturnType

        public java.lang.Class<?> getRawReturnType()
        Description copied from interface: Invocation
        Returns unprocessed arguments whereas InvocationOnMock.getArguments() returns arguments already processed (e.g. varargs expended, etc.).
        Specified by:
        getRawReturnType in interface Invocation
        Returns:
        unprocessed arguments, exactly as provided to this invocation.
      • stubInfo

        public StubInfo stubInfo()
        Specified by:
        stubInfo in interface Invocation
        Returns:
        the stubbing information for this invocation. May return null - this means the invocation was not stubbed.
      • markStubbed

        public void markStubbed​(StubInfo stubInfo)
        Description copied from interface: Invocation
        Marks this invocation as stubbed.
        Specified by:
        markStubbed in interface Invocation
        Parameters:
        stubInfo - the information about stubbing.
      • isIgnoredForVerification

        public boolean isIgnoredForVerification()
        Description copied from interface: Invocation
        Informs if the invocation participates in verify-no-more-invocations or verification in order.
        Specified by:
        isIgnoredForVerification in interface Invocation
        Returns:
        whether this invocation should be ignored for the purposes of verify-no-more-invocations or verification in order.
      • getMock

        public java.lang.Object getMock()
        Description copied from interface: InvocationOnMock
        returns the mock object
        Specified by:
        getMock in interface InvocationOnMock
        Returns:
        mock object
      • getArguments

        public java.lang.Object[] getArguments()
        Description copied from interface: InvocationOnMock
        Returns arguments passed to the method. Vararg are expanded in this array.
        Specified by:
        getArguments in interface InvocationOnMock
        Returns:
        arguments
      • callRealMethod

        public java.lang.Object callRealMethod()
                                        throws java.lang.Throwable
        Description copied from interface: InvocationOnMock
        calls real method

        Warning: depending on the real implementation it might throw exceptions

        Specified by:
        callRealMethod in interface InvocationOnMock
        Returns:
        whatever the real method returns / throws
        Throws:
        java.lang.Throwable - in case real method throws
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • equalArguments

        private boolean equalArguments​(java.lang.Object[] arguments)
      • toString

        public java.lang.String toString()
        Description copied from interface: DescribedInvocation
        Describes the invocation in the human friendly way.
        Specified by:
        toString in interface DescribedInvocation
        Overrides:
        toString in class java.lang.Object
        Returns:
        the description of this invocation.