Search in sources :

Example 1 with RequestListener

use of com.github.tomakehurst.wiremock.http.RequestListener in project opennms by OpenNMS.

the class AbstractMeasurementQueryExecutorTest method before.

@Before
public void before() throws IOException {
    requestList.clear();
    // we listen to all requests and verify that the POST data can be parsed as a Query Request
    wireMockRule.addMockServiceRequestListener(new RequestListener() {

        @Override
        public void requestReceived(Request request, Response response) {
            requestList.add(LoggedRequest.createFrom(request));
        }
    });
    new File("target/reports").mkdirs();
}
Also used : Response(com.github.tomakehurst.wiremock.http.Response) RequestListener(com.github.tomakehurst.wiremock.http.RequestListener) QueryRequest(org.opennms.netmgt.measurements.model.QueryRequest) Request(com.github.tomakehurst.wiremock.http.Request) LoggedRequest(com.github.tomakehurst.wiremock.verification.LoggedRequest) File(java.io.File) Before(org.junit.Before)

Aggregations

Request (com.github.tomakehurst.wiremock.http.Request)1 RequestListener (com.github.tomakehurst.wiremock.http.RequestListener)1 Response (com.github.tomakehurst.wiremock.http.Response)1 LoggedRequest (com.github.tomakehurst.wiremock.verification.LoggedRequest)1 File (java.io.File)1 Before (org.junit.Before)1 QueryRequest (org.opennms.netmgt.measurements.model.QueryRequest)1