public static void checkAssertions() { if (responses.get() != null) { for (MockResponse mockResponse : responses.get()) { mockResponse.checkAssertion(); } } if (listeners.get() != null) { for (MockListener<Object> mockListener : listeners.get()) { mockListener.checkAssertion(); } } }
public static void checkExecutions() { if (responses.get() != null) { for (MockResponse entry : responses.get()) { if (!entry.wasExecuted()) { String uri = mockResponses.inverse().get(entry); throw new AssertionError("Mock for '" + uri + "' was never executed"); } } } if (listeners.get() != null) { for (MockListener<Object> entry : listeners.get()) { if (!entry.wasExecuted()) { String uri = mockListeneres.inverse().get(entry); throw new AssertionError("Listener for '" + uri + "' was never executed"); } } } }