Ejemplo n.º 1
0
  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();
      }
    }
  }
Ejemplo n.º 2
0
  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");
        }
      }
    }
  }