Search in sources :

Example 6 with SliceSimple

use of com.artipie.http.slice.SliceSimple 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, "/")));
}
Also used : RequestLine(com.artipie.http.rq.RequestLine) SliceHasResponse(com.artipie.http.hm.SliceHasResponse) RsWithStatus(com.artipie.http.rs.RsWithStatus) RsHasStatus(com.artipie.http.hm.RsHasStatus) RsWithHeaders(com.artipie.http.rs.RsWithHeaders) RsHasHeaders(com.artipie.http.hm.RsHasHeaders) Headers(com.artipie.http.Headers) RsWithHeaders(com.artipie.http.rs.RsWithHeaders) RsStatus(com.artipie.http.rs.RsStatus) RsHasHeaders(com.artipie.http.hm.RsHasHeaders) SliceSimple(com.artipie.http.slice.SliceSimple) Test(org.junit.jupiter.api.Test)

Aggregations

SliceSimple (com.artipie.http.slice.SliceSimple)6 Test (org.junit.jupiter.api.Test)6 RsHasStatus (com.artipie.http.hm.RsHasStatus)5 RequestLine (com.artipie.http.rq.RequestLine)5 RsStatus (com.artipie.http.rs.RsStatus)5 RsWithStatus (com.artipie.http.rs.RsWithStatus)5 BasicAuthSlice (com.artipie.http.auth.BasicAuthSlice)4 Permission (com.artipie.http.auth.Permission)4 Authorization (com.artipie.http.headers.Authorization)3 Map (java.util.Map)3 ListOf (org.cactoos.list.ListOf)3 Base64Encoded (org.cactoos.text.Base64Encoded)3 PublisherAs (com.artipie.asto.ext.PublisherAs)1 Headers (com.artipie.http.Headers)1 RsHasHeaders (com.artipie.http.hm.RsHasHeaders)1 SliceHasResponse (com.artipie.http.hm.SliceHasResponse)1 RsWithHeaders (com.artipie.http.rs.RsWithHeaders)1