io.pedestal.test

Pedestal testing utilities to simplify working with pedestal apps.

parse-url

(parse-url url)

raw-response-for

(raw-response-for interceptor-service-fn verb url & options)

Return a ring response map for an HTTP request of type verb against url url, when applied to interceptor-service-fn. Useful for integration testing pedestal applications and getting all relevant middlewares invoked, including ones which integrate with the servlet infrastructure. The response body will be returned as a ByteArrayOutputStream. Options:

:body : An optional string that is the request body. :headers : An optional map that are the headers

response-for

(response-for interceptor-service-fn verb url & options)

Return a ring response map for an HTTP request of type verb against url url, when applied to interceptor-service-fn. Useful for integration testing pedestal applications and getting all relevant middlewares invoked, including ones which integrate with the servlet infrastructure. The response body will be converted to a UTF-8 string. Options:

:body : An optional string that is the request body. :headers : An optional map that are the headers

servlet-response-for

(servlet-response-for interceptor-service-fn verb url & args)

Return a ring response map for an HTTP request of type verb against url url, when applied to interceptor-service-fn. Useful for integration testing pedestal applications and getting all relevant middlewares invoked, including ones which integrate with the servlet infrastructure.

test-servlet-response

(test-servlet-response)

Returns a mock servlet response with a ServletOutputStream over a ByteArrayOutputStream. Captures the ByteArrayOutputStream in metadata. All headers set will swap a headers map held in an atom, also held in metadata.

test-servlet-response-body

(test-servlet-response-body test-servlet-response)

test-servlet-response-headers

(test-servlet-response-headers test-servlet-response)

test-servlet-response-status

(test-servlet-response-status test-servlet-response)

TestRequestBody

protocol

members

->servlet-input-stream

(->servlet-input-stream input)