Package mockit
Class ExpectationsForConstructorsTest
java.lang.Object
mockit.ExpectationsForConstructorsTest
The Class ExpectationsForConstructorsTest.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The Class BaseCollaborator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Mock all constructors.void
mockClassHierarchyWhereFirstConstructorInBaseClassIsPrivate
(mockit.ExpectationsForConstructorsTest.B mock) Mock class hierarchy where first constructor in base class is private.void
mockClassHierarchyWhereFirstConstructorInBaseClassOnAnotherPackageIsPackagePrivate
(mockit.ExpectationsForConstructorsTest.D mock) Mock class hierarchy where first constructor in base class on another package is package private.void
mockConstructorWhichCallsTwoOthersOfTheSameClass
(mockit.ExpectationsForConstructorsTest.Collaborator2 mock) Mock constructor which calls two others of the same class.void
Record and replay base constructor invocation.void
recordExpectationOnBaseConstructorAndReplayWithCallToSuper
(mockit.ExpectationsForConstructorsTest.Base mocked) Record expectation on base constructor and replay with call to super.void
verifyExpectationOnBaseConstructorReplayedWithCallToSuper
(mockit.ExpectationsForConstructorsTest.Base mocked) Verify expectation on base constructor replayed with call to super.
-
Constructor Details
-
ExpectationsForConstructorsTest
public ExpectationsForConstructorsTest()
-
-
Method Details
-
mockAllConstructors
Mock all constructors.- Parameters:
unused
- the unused
-
mockClassHierarchyWhereFirstConstructorInBaseClassIsPrivate
public void mockClassHierarchyWhereFirstConstructorInBaseClassIsPrivate(mockit.ExpectationsForConstructorsTest.B mock) Mock class hierarchy where first constructor in base class is private.- Parameters:
mock
- the mock
-
mockClassHierarchyWhereFirstConstructorInBaseClassOnAnotherPackageIsPackagePrivate
public void mockClassHierarchyWhereFirstConstructorInBaseClassOnAnotherPackageIsPackagePrivate(mockit.ExpectationsForConstructorsTest.D mock) Mock class hierarchy where first constructor in base class on another package is package private.- Parameters:
mock
- the mock
-
recordAndReplayBaseConstructorInvocation
public void recordAndReplayBaseConstructorInvocation(mockit.ExpectationsForConstructorsTest.Base mocked) Record and replay base constructor invocation.- Parameters:
mocked
- the mocked
-
recordExpectationOnBaseConstructorAndReplayWithCallToSuper
public void recordExpectationOnBaseConstructorAndReplayWithCallToSuper(mockit.ExpectationsForConstructorsTest.Base mocked) Record expectation on base constructor and replay with call to super.- Parameters:
mocked
- the mocked
-
verifyExpectationOnBaseConstructorReplayedWithCallToSuper
public void verifyExpectationOnBaseConstructorReplayedWithCallToSuper(mockit.ExpectationsForConstructorsTest.Base mocked) Verify expectation on base constructor replayed with call to super.- Parameters:
mocked
- the mocked
-
mockConstructorWhichCallsTwoOthersOfTheSameClass
public void mockConstructorWhichCallsTwoOthersOfTheSameClass(mockit.ExpectationsForConstructorsTest.Collaborator2 mock) Mock constructor which calls two others of the same class.- Parameters:
mock
- the mock
-