package io.sniffy;

import org.junit.Test;

public class SnifferExpectApiTest extends BaseTest {

    @Test(expected = WrongNumberOfQueriesError.class)
    public void testNotMoreThan() throws Exception {
        try (Spy $= Sniffer.expectAtMost(1)) {
            executeStatements(2);
        }
    }

    @Test
    public void testNotMoreThanOneInsert() throws Exception {
        try (Spy $= Sniffer.expectAtMost(1, Query.INSERT)) {
            executeStatement(Query.INSERT);
            executeStatement(Query.UPDATE);
        }
    }

    @Test
    public void testExactlyOneThreadLocalInsert() throws Exception {
        try (Spy $= Sniffer.expect(1, Threads.CURRENT, Query.INSERT)) {
            executeStatement(Query.INSERT);
            executeStatementInOtherThread(Query.INSERT);
            executeStatements(2, Query.UPDATE);
        }
    }

    @Test
    public void testNotMoreThanAllThreads() throws Exception {
        try (Spy $= Sniffer.expectAtMost(1, Threads.CURRENT)) {
            executeStatementInOtherThread();
            executeStatement();
        }
    }

    @Test
    public void testNotMoreThanOtherThreads() throws Exception {
        try (Spy eq = Sniffer.expectAtMost(1, Threads.OTHERS)) {
            executeStatementInOtherThread();
            executeStatements(2);
        }
    }

}
@@ -651,31 +651,524 @@
 pect(1, 
-Threads.CURRENT
+Query.INSERT)) %7B%0A            executeStatement(Query.INSERT);%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void testExactlyOneOtherThreadInsert() throws Exception %7B%0A        try (Spy $= Sniffer.expect(1, Threads.OTHERS, Query.INSERT)) %7B%0A            executeStatement(Query.INSERT);%0A            executeStatementInOtherThread(Query.INSERT);%0A            executeStatements(2, Query.UPDATE);%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void testExactlyTwoInsertsAnyThread() throws Exception %7B%0A        try (Spy $= Sniffer.expect(2
 , Query.
@@ -1165,32 +1165,45 @@
 (2, Query.INSERT
+, Threads.ANY
 )) %7B%0A           

Increase coverage