Package mockit

Class ExpectationsTest

java.lang.Object
mockit.ExpectationsTest

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

    • thrown

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

    • ExpectationsTest

      public ExpectationsTest()
  • Method Details

    • recordSimpleInvocations

      public void recordSimpleInvocations()
      Record simple invocations.
    • recordInvocationThatWillNotOccur

      public void recordInvocationThatWillNotOccur()
      Record invocation that will not occur.
    • expectationsRecordedOnSameMethodWithSameMatchersButDifferentArguments

      public void expectationsRecordedOnSameMethodWithSameMatchersButDifferentArguments()
      Expectations recorded on same method with same matchers but different arguments.
    • expectationsRecordedOnSameMethodWithMatcherInOneAndFixedArgumentInAnother

      public void expectationsRecordedOnSameMethodWithMatcherInOneAndFixedArgumentInAnother()
      Expectations recorded on same method with matcher in one and fixed argument in another.
    • recordInvocationWithExactExpectedNumberOfInvocationsButFailToSatisfy

      public void recordInvocationWithExactExpectedNumberOfInvocationsButFailToSatisfy()
      Record invocation with exact expected number of invocations but fail to satisfy.
    • recordInvocationWithMinimumExpectedNumberOfInvocationsButFailToSatisfy

      public void recordInvocationWithMinimumExpectedNumberOfInvocationsButFailToSatisfy()
      Record invocation with minimum expected number of invocations but fail to satisfy.
    • recordInvocationWithMaximumExpectedNumberOfInvocationsButFailToSatisfy

      public void recordInvocationWithMaximumExpectedNumberOfInvocationsButFailToSatisfy()
      Record invocation with maximum expected number of invocations but fail to satisfy.
    • recordInvocationsWithExpectedInvocationCounts

      public void recordInvocationsWithExpectedInvocationCounts()
      Record invocations with expected invocation counts.
    • recordInvocationsWithMinInvocationCountLargerThanWillOccur

      public void recordInvocationsWithMinInvocationCountLargerThanWillOccur()
      Record invocations with min invocation count larger than will occur.
    • recordWithArgumentMatcherAndIndividualInvocationCounts

      public void recordWithArgumentMatcherAndIndividualInvocationCounts()
      Record with argument matcher and individual invocation counts.
    • recordWithMaxInvocationCountFollowedByReturnValue

      public void recordWithMaxInvocationCountFollowedByReturnValue()
      Record with max invocation count followed by return value.
    • recordWithMaxInvocationCountFollowedByReturnValueButReplayOneTimeBeyondMax

      public void recordWithMaxInvocationCountFollowedByReturnValueButReplayOneTimeBeyondMax()
      Record with max invocation count followed by return value but replay one time beyond max.
    • recordWithReturnValueFollowedByExpectedInvocationCount

      public void recordWithReturnValueFollowedByExpectedInvocationCount()
      Record with return value followed by expected invocation count.
    • recordWithMinInvocationCountFollowedByReturnValueUsingDelegate

      public void recordWithMinInvocationCountFollowedByReturnValueUsingDelegate()
      Record with min invocation count followed by return value using delegate.
    • mockedClassWithAnnotatedElements

      public void mockedClassWithAnnotatedElements() throws Exception
      Mocked class with annotated elements.
      Throws:
      Exception - the exception
    • expectOnlyOneInvocationButExerciseOthersDuringReplay

      public void expectOnlyOneInvocationButExerciseOthersDuringReplay(mockit.ExpectationsTest.Collaborator mock)
      Expect only one invocation but exercise others during replay.
      Parameters:
      mock - the mock
    • expectNothingOnMockedTypeButExerciseItDuringReplay

      public void expectNothingOnMockedTypeButExerciseItDuringReplay(mockit.ExpectationsTest.Collaborator mock)
      Expect nothing on mocked type but exercise it during replay.
      Parameters:
      mock - the mock
    • replayWithUnexpectedStaticMethodInvocation

      public void replayWithUnexpectedStaticMethodInvocation(mockit.ExpectationsTest.Collaborator mock)
      Replay with unexpected static method invocation.
      Parameters:
      mock - the mock
    • failureFromUnexpectedInvocationInAnotherThread

      public void failureFromUnexpectedInvocationInAnotherThread(mockit.ExpectationsTest.Collaborator mock) throws Exception
      Failure from unexpected invocation in another thread.
      Parameters:
      mock - the mock
      Throws:
      Exception - the exception
    • recordingExpectationOnMethodWithOneArgumentButReplayingWithAnotherShouldProduceUsefulErrorMessage

      public void recordingExpectationOnMethodWithOneArgumentButReplayingWithAnotherShouldProduceUsefulErrorMessage(mockit.ExpectationsTest.Collaborator mock)
      Recording expectation on method with one argument but replaying with another should produce useful error message.
      Parameters:
      mock - the mock