Package mockit

Class PartialMockingTest

java.lang.Object
mockit.PartialMockingTest

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

    • thrown

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

    • PartialMockingTest

      public PartialMockingTest()
  • Method Details

    • attemptToPartiallyMockAClass

      public void attemptToPartiallyMockAClass()
      Attempt to partially mock A class.
    • dynamicMockFullyVerified_verifyAllRecordedExpectationsButNotAllOfTheReplayedOnes

      public void dynamicMockFullyVerified_verifyAllRecordedExpectationsButNotAllOfTheReplayedOnes()
      Dynamic mock fully verified verify all recorded expectations but not all of the replayed ones.
    • dynamicMockFullyVerifiedInOrder_verifyAllRecordedExpectationsButNotAllOfTheReplayedOnes

      public void dynamicMockFullyVerifiedInOrder_verifyAllRecordedExpectationsButNotAllOfTheReplayedOnes()
      Dynamic mock fully verified in order verify all recorded expectations but not all of the replayed ones.
    • expectTwoInvocationsOnDynamicMockButReplayOnce

      public void expectTwoInvocationsOnDynamicMockButReplayOnce()
      Expect two invocations on dynamic mock but replay once.
    • expectOneInvocationOnDynamicMockButReplayTwice

      public void expectOneInvocationOnDynamicMockButReplayTwice()
      Expect one invocation on dynamic mock but replay twice.
    • dynamicallyMockAnInstance

      public void dynamicallyMockAnInstance()
      Dynamically mock an instance.
    • mockMethodInSameClass

      public void mockMethodInSameClass()
      Mock method in same class.
    • dynamicallyMockASubCollaboratorInstance

      public void dynamicallyMockASubCollaboratorInstance()
      Dynamically mock A sub collaborator instance.
    • dynamicallyMockAnAnonymousClassInstanceThroughTheImplementedInterface

      public void dynamicallyMockAnAnonymousClassInstanceThroughTheImplementedInterface()
      Dynamically mock an anonymous class instance through the implemented interface.
    • attemptToUseDynamicMockingForInvalidTypes

      public void attemptToUseDynamicMockingForInvalidTypes(PartialMockingTest.AnotherInterface publicInterfaceMock, mockit.PartialMockingTest.NonPublicInterface nonPublicInterfaceMock)
      Attempt to use dynamic mocking for invalid types.
      Parameters:
      publicInterfaceMock - the public interface mock
      nonPublicInterfaceMock - the non public interface mock
    • dynamicPartialMockingWithExactArgumentMatching

      public void dynamicPartialMockingWithExactArgumentMatching()
      Dynamic partial mocking with exact argument matching.
    • dynamicPartialMockingWithFlexibleArgumentMatching

      public void dynamicPartialMockingWithFlexibleArgumentMatching()
      Dynamic partial mocking with flexible argument matching.
    • dynamicPartialMockingWithInstanceSpecificMatching

      public void dynamicPartialMockingWithInstanceSpecificMatching()
      Dynamic partial mocking with instance specific matching.
    • dynamicPartialMockingWithInstanceSpecificMatchingOnTwoInstancesOfSameClass

      public void dynamicPartialMockingWithInstanceSpecificMatchingOnTwoInstancesOfSameClass()
      Dynamic partial mocking with instance specific matching on two instances of same class.
    • methodWithNoRecordedExpectationCalledTwiceDuringReplay

      public void methodWithNoRecordedExpectationCalledTwiceDuringReplay()
      Method with no recorded expectation called twice during replay.
    • attemptToPartiallyMockNativeMethod

      public void attemptToPartiallyMockNativeMethod()
      Attempt to partially mock native method.
    • mockAnnotatedConstructor

      public void mockAnnotatedConstructor(mockit.PartialMockingTest.Collaborator mock) throws Exception
      Mock annotated constructor.
      Parameters:
      mock - the mock
      Throws:
      Exception - the exception
    • mockClassIndirectlyExtendingBaseWhoseFirstConstructorHasMoreParametersThanTheSecondOne

      public void mockClassIndirectlyExtendingBaseWhoseFirstConstructorHasMoreParametersThanTheSecondOne(mockit.PartialMockingTest.SubSubClass mock)
      Mock class indirectly extending base whose first constructor has more parameters than the second one.
      Parameters:
      mock - the mock