I don't know what gave you the impression that you "should use" MockUp
for something, while using @Mocked
for something else in the same test.
In fact, you can use either one of these two APIs, since they are both very capable. Normally, though, only one or the other is used in a given test (or test class), not both.
To verify how many invocations occurred to a given mocked method, you can use the "invocations/minInvocations/maxInvocations" attributes of the @Mock
annotation when using a MockUp
; or the "times/minTimes/maxTimes" fields when using @Mocked
. Choose whichever one best satisfies your needs and testing style. For example tests, check out the JMockit documentation.