// Path: clients/java/src/org/httpmock/matchers/WasCalled.java
// public static WasCalled wasCalled(String requestMethod, String endpoint) {
//     return new WasCalled(requestMethod, endpoint);
// }


import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.List;
import static junit.framework.Assert.assertEquals;
import static org.hamcrest.CoreMatchers.not;
import static org.httpmock.matchers.WasCalled.wasCalled;
import static org.junit.Assert.assertThat;

    @Before
    public void connectToServer() {
        stub = ControlServer.at(controlServerURL).setupPort(3001);
    }

    @After
    public void shutdownServer() {
        stub.close();
    }

    @Test
    public void shouldReturnAllRequestsToStub() {
        new HttpRequest("GET", "http://localhost:3001/first").send();
        new HttpRequest("POST", "http://localhost:3001/second?with=query").withBody("TEST").send();

        List<StubRequest> requests = stub.getRequests();

        assertEquals(2, requests.size());
        assertEquals("/first", requests.get(0).getPath());
        assertEquals("GET", requests.get(0).getRequestMethod());
        assertEquals("/second?with=query", requests.get(1).getPath());
        assertEquals("TEST", requests.get(1).getBody());
        assertEquals("POST", requests.get(1).getRequestMethod());
    }

    @Test
    public void wasCalledShouldMatchPath() {
        new HttpRequest("GET", "http://localhost:3001/first").send();

// Path: clients/java/src/org/httpmock/matchers/WasCalled.java
// public static WasCalled wasCalled(String requestMethod, String endpoint) {
//     return new WasCalled(requestMethod, endpoint);
// }


// Path: clients/java/functional-test/org/httpmock/WasCalledAtFunctionalTest.java
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.List;
import static junit.framework.Assert.assertEquals;
import static org.hamcrest.CoreMatchers.not;
import static org.httpmock.matchers.WasCalled.wasCalled;
import static org.junit.Assert.assertThat;


    @Before
    public void connectToServer() {
        stub = ControlServer.at(controlServerURL).setupPort(3001);
    }

    @After
    public void shutdownServer() {
        stub.close();
    }

    @Test
    public void shouldReturnAllRequestsToStub() {
        new HttpRequest("GET", "http://localhost:3001/first").send();
        new HttpRequest("POST", "http://localhost:3001/second?with=query").withBody("TEST").send();

        List<StubRequest> requests = stub.getRequests();

        assertEquals(2, requests.size());
        assertEquals("/first", requests.get(0).getPath());
        assertEquals("GET", requests.get(0).getRequestMethod());
        assertEquals("/second?with=query", requests.get(1).getPath());
        assertEquals("TEST", requests.get(1).getBody());
        assertEquals("POST", requests.get(1).getRequestMethod());
    }

    @Test
    public void wasCalledShouldMatchPath() {
        new HttpRequest("GET", "http://localhost:3001/first").send();

        assertThat(stub, wasCalled("GET", "/first"));