All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.tomjankes.wiremock.http.NewMappingHandler.groovy Maven / Gradle / Ivy

The newest version!
package com.github.tomjankes.wiremock.http

import org.apache.http.HttpResponse
import org.apache.http.client.ClientProtocolException
import org.apache.http.client.ResponseHandler


class NewMappingHandler implements ResponseHandler {
    @Override
    Void handleResponse(HttpResponse response) throws ClientProtocolException, IOException {
        def code = response.statusLine.statusCode
        if (code != 201) {
            throw new RuntimeException(
                    "Wiremock error while stubbing: [$code] $response.statusLine.reasonPhrase")
        }
        null
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy