Skip to content

Commit

Permalink
[Java] Mock on interface rather than concrete class.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed Jun 17, 2016
1 parent a26a92f commit 14a6093
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.aeron.driver.MediaDriver;
import io.aeron.logbuffer.FragmentHandler;
import io.aeron.logbuffer.Header;
import org.agrona.DirectBuffer;
import org.agrona.concurrent.UnsafeBuffer;
import org.junit.Test;
import org.junit.experimental.theories.DataPoint;
Expand Down Expand Up @@ -84,9 +85,9 @@ public void shouldReceivePublishedMessage(final String channel) throws Exception
while (numSpyFragments < 4 || numFragments < 4);

verify(mockFragmentHandler, times(4)).onFragment(
any(UnsafeBuffer.class), anyInt(), eq(PAYLOAD_LENGTH), any(Header.class));
any(DirectBuffer.class), anyInt(), eq(PAYLOAD_LENGTH), any(Header.class));
verify(mockSpyFragmentHandler, times(4)).onFragment(
any(UnsafeBuffer.class), anyInt(), eq(PAYLOAD_LENGTH), any(Header.class));
any(DirectBuffer.class), anyInt(), eq(PAYLOAD_LENGTH), any(Header.class));
}
finally
{
Expand Down

0 comments on commit 14a6093

Please sign in to comment.