use of com.artipie.http.rs.RsStatus in project artipie by artipie.
the class ResponseMetricsSliceTest method shouldForwardResponseUnmodified.
@Test
void shouldForwardResponseUnmodified() {
final Header rsheader = new Header("header2", "value2");
final byte[] body = "piece of code".getBytes();
final RsStatus rsstatus = RsStatus.CREATED;
final Response response = new ResponseMetricsSlice((rsline, rsheaders, rsbody) -> new RsFull(rsstatus, new Headers.From(rsheader), Flowable.just(ByteBuffer.wrap(body))), this.metrics).response(new RequestLine(RqMethod.PUT, "/").toString(), Headers.EMPTY, Flowable.empty());
MatcherAssert.assertThat(response, new ResponseMatcher(rsstatus, body, rsheader));
}
use of com.artipie.http.rs.RsStatus in project maven-adapter by artipie.
the class HeadProxySliceTest method passesStatusAndHeadersFromResponse.
@Test
void passesStatusAndHeadersFromResponse() {
final RsStatus status = RsStatus.CREATED;
final Headers.From headers = new Headers.From("abc", "123");
MatcherAssert.assertThat(new HeadProxySlice(new SliceSimple(new RsWithHeaders(new RsWithStatus(status), headers))), new SliceHasResponse(Matchers.allOf(new RsHasStatus(status), new RsHasHeaders(headers)), new RequestLine(RqMethod.HEAD, "/")));
}
Aggregations