Package mockit

Class DelegateTest

java.lang.Object
mockit.DelegateTest

public final class DelegateTest extends Object
The Class DelegateTest.
  • Field Details

    • thrown

      public final org.junit.rules.ExpectedException thrown
      The thrown.
  • Constructor Details

    • DelegateTest

      public DelegateTest()
  • Method Details

    • resultFromDelegate

      public void resultFromDelegate(mockit.DelegateTest.Collaborator collaborator)
      Result from delegate.
      Parameters:
      collaborator - the collaborator
    • consecutiveResultsThroughDelegatesHavingDifferentValues

      public void consecutiveResultsThroughDelegatesHavingDifferentValues(mockit.DelegateTest.Collaborator mock)
      Consecutive results through delegates having different values.
      Parameters:
      mock - the mock
    • consecutiveReturnValuesThroughDelegatesUsingSingleReturnsWithVarargs

      public void consecutiveReturnValuesThroughDelegatesUsingSingleReturnsWithVarargs(mockit.DelegateTest.Collaborator collaborator)
      Consecutive return values through delegates using single returns with varargs.
      Parameters:
      collaborator - the collaborator
    • resultWithMultipleReturnValuesThroughSingleDelegate

      public void resultWithMultipleReturnValuesThroughSingleDelegate(mockit.DelegateTest.Collaborator collaborator)
      Result with multiple return values through single delegate.
      Parameters:
      collaborator - the collaborator
    • constructorDelegateWithSingleMethod

      public void constructorDelegateWithSingleMethod(mockit.DelegateTest.Collaborator mock)
      Constructor delegate with single method.
      Parameters:
      mock - the mock
    • constructorDelegateWithMultipleMethods

      public void constructorDelegateWithMultipleMethods(mockit.DelegateTest.Collaborator mock)
      Constructor delegate with multiple methods.
      Parameters:
      mock - the mock
    • attemptToUseConstructorDelegateWithPrivateMethodsOnly

      public void attemptToUseConstructorDelegateWithPrivateMethodsOnly(mockit.DelegateTest.Collaborator mock)
      Attempt to use constructor delegate with private methods only.
      Parameters:
      mock - the mock
    • delegateForStaticMethod

      public void delegateForStaticMethod(mockit.DelegateTest.Collaborator unused)
      Delegate for static method.
      Parameters:
      unused - the unused
    • delegateWithStaticMethod

      public void delegateWithStaticMethod(mockit.DelegateTest.Collaborator mock)
      Delegate with static method.
      Parameters:
      mock - the mock
    • delegateForNativeMethod

      public void delegateForNativeMethod(mockit.DelegateTest.Collaborator mock)
      Delegate for native method.
      Parameters:
      mock - the mock
    • delegateForFinalMethod

      public void delegateForFinalMethod(mockit.DelegateTest.Collaborator mock)
      Delegate for final method.
      Parameters:
      mock - the mock
    • delegateForMethodWithCompatibleButDistinctParameterType

      public void delegateForMethodWithCompatibleButDistinctParameterType(mockit.DelegateTest.Collaborator collaborator)
      Delegate for method with compatible but distinct parameter type.
      Parameters:
      collaborator - the collaborator
    • delegateReceivingNullArguments

      public void delegateReceivingNullArguments(mockit.DelegateTest.Collaborator collaborator)
      Delegate receiving null arguments.
      Parameters:
      collaborator - the collaborator
    • delegateWithTwoMethods

      public void delegateWithTwoMethods(mockit.DelegateTest.Collaborator collaborator)
      Delegate with two methods.
      Parameters:
      collaborator - the collaborator
    • delegateWithSingleMethodHavingADifferentName

      public void delegateWithSingleMethodHavingADifferentName(mockit.DelegateTest.Collaborator collaborator)
      Delegate with single method having A different name.
      Parameters:
      collaborator - the collaborator
    • delegateWithSingleMethodHavingNoParameters

      public void delegateWithSingleMethodHavingNoParameters(mockit.DelegateTest.Collaborator collaborator)
      Delegate with single method having no parameters.
      Parameters:
      collaborator - the collaborator
    • delegateWithSingleMethodHavingNoParametersExceptForInvocationContext

      public void delegateWithSingleMethodHavingNoParametersExceptForInvocationContext(mockit.DelegateTest.Collaborator collaborator)
      Delegate with single method having no parameters except for invocation context.
      Parameters:
      collaborator - the collaborator
    • delegateWithOneMethodHavingDifferentParameters

      public void delegateWithOneMethodHavingDifferentParameters(mockit.DelegateTest.Collaborator collaborator)
      Delegate with one method having different parameters.
      Parameters:
      collaborator - the collaborator
    • delegateWithTwoNonPrivateMethods

      public void delegateWithTwoNonPrivateMethods(mockit.DelegateTest.Collaborator collaborator)
      Delegate with two non private methods.
      Parameters:
      collaborator - the collaborator
    • delegateCausingConcurrentMockInvocation

      public void delegateCausingConcurrentMockInvocation(mockit.DelegateTest.Collaborator mock)
      Delegate causing concurrent mock invocation.
      Parameters:
      mock - the mock
    • delegateWhichCallsTheSameMockedMethod

      public void delegateWhichCallsTheSameMockedMethod(mockit.DelegateTest.Collaborator mock)
      Delegate which calls the same mocked method.
      Parameters:
      mock - the mock
    • delegateWhichCallsAnotherMockedMethod

      public void delegateWhichCallsAnotherMockedMethod(mockit.DelegateTest.Collaborator mock)
      Delegate which calls another mocked method.
      Parameters:
      mock - the mock
    • delegateWhichCallsAnotherMockedMethod_partialMockingOfInstance

      public void delegateWhichCallsAnotherMockedMethod_partialMockingOfInstance()
      Delegate which calls another mocked method partial mocking of instance.
    • delegateWhichCallsAnotherMockedMethod_injectableMocking

      public void delegateWhichCallsAnotherMockedMethod_injectableMocking(mockit.DelegateTest.Collaborator mock)
      Delegate which calls another mocked method injectable mocking.
      Parameters:
      mock - the mock
    • delegateWhichCallsAnotherMockedMethodProducingACascadedInstance

      public void delegateWhichCallsAnotherMockedMethodProducingACascadedInstance(mockit.DelegateTest.Collaborator mock)
      Delegate which calls another mocked method producing A cascaded instance.
      Parameters:
      mock - the mock
    • delegateCallingMockedMethodLaterVerified

      public void delegateCallingMockedMethodLaterVerified(mockit.DelegateTest.Collaborator collaborator, Runnable action)
      Delegate calling mocked method later verified.
      Parameters:
      collaborator - the collaborator
      action - the action
    • convertValueReturnedFromDelegateWhenReturnsTypesDiffer

      public void convertValueReturnedFromDelegateWhenReturnsTypesDiffer(mockit.DelegateTest.Collaborator mock)
      Convert value returned from delegate when returns types differ.
      Parameters:
      mock - the mock
    • returnInconvertibleValueFromDelegateWhenReturnsTypesDiffer

      public void returnInconvertibleValueFromDelegateWhenReturnsTypesDiffer(mockit.DelegateTest.Collaborator mock)
      Return inconvertible value from delegate when returns types differ.
      Parameters:
      mock - the mock
    • returnVoidFromDelegateMethodForRecordedMethodHavingPrimitiveReturnType

      public void returnVoidFromDelegateMethodForRecordedMethodHavingPrimitiveReturnType(mockit.DelegateTest.Collaborator mock)
      Return void from delegate method for recorded method having primitive return type.
      Parameters:
      mock - the mock
    • returnByteArrayFromDelegateMethod

      public void returnByteArrayFromDelegateMethod(mockit.DelegateTest.Collaborator mock)
      Return byte array from delegate method.
      Parameters:
      mock - the mock
    • returnValueOfCorrectTypeFromDelegateMethodReturningASupertype

      public void returnValueOfCorrectTypeFromDelegateMethodReturningASupertype(mockit.DelegateTest.Collaborator mock)
      Return value of correct type from delegate method returning A supertype.
      Parameters:
      mock - the mock