@Test(expected = WrongNumberOfQueriesError.class) public void testAtMostOnceUpdateNegative() throws Exception { Spy spy = Sniffy.spy(); executeStatements(2, Query.UPDATE); spy.verifyAtMostOnce(Query.UPDATE); }
@Test public void testBetweenOtherPositive() throws Exception { Spy spy = Sniffy.spy(); executeStatements(3, Query.OTHER); spy.verifyBetween(2, 4, Query.OTHER); }
@Test(expected = WrongNumberOfQueriesError.class) public void testBetweenOtherNegative() throws Exception { Spy spy = Sniffy.spy(); executeStatements(5, Query.OTHER); spy.verifyBetween(2, 4, Query.OTHER); }
@Test(expected = WrongNumberOfQueriesError.class) public void testAtMostMergeNegative() throws Exception { Spy spy = Sniffy.spy(); executeStatements(3, Query.MERGE); spy.verifyAtMost(2, Query.MERGE); }
@Test public void testAtLeastDeletePositive() throws Exception { Spy spy = Sniffy.spy(); executeStatements(3, Query.DELETE); spy.verifyAtLeast(2, Query.DELETE); }
@Test(expected = WrongNumberOfQueriesError.class) public void testBetweenOtherOtherThreadNegative() throws Exception { Spy spy = Sniffy.spy(); executeStatementInOtherThread(Query.OTHER); executeStatements(2, Query.OTHER); spy.verifyBetween(2, 4, Query.OTHER, Threads.OTHERS); }
@Test public void testAtMostMergeOtherThreadPositive() throws Exception { Spy spy = Sniffy.spy(); executeStatementInOtherThread(Query.SELECT); executeStatementInOtherThread(Query.MERGE); executeStatements(5, Query.MERGE); spy.verifyAtMost(2, Threads.OTHERS, Query.MERGE); }
@Test public void testAtMostOnceUpdateOtherThreadPositive() throws Exception { Spy spy = Sniffy.spy(); executeStatementInOtherThread(Query.SELECT); executeStatementInOtherThread(Query.UPDATE); executeStatements(5, Query.UPDATE); spy.verifyAtMostOnce(Threads.OTHERS, Query.UPDATE); }
@Test public void testAtMostMergePositive() throws Exception { Spy spy = Sniffy.spy(); executeStatement(Query.MERGE); spy.verifyAtMost(2, Query.MERGE); spy = Sniffy.spy(); executeStatement(Query.DELETE); executeStatements(2, Query.MERGE); spy.verifyAtMost(2, Query.MERGE); }