use of io.servicetalk.http.api.StreamingHttpRequest in project servicetalk by apple.
the class BasicAuthHttpServiceFilterTest method emptyBasicTokenInAuthorizationHeaderForProxy.
@Test
void emptyBasicTokenInAuthorizationHeaderForProxy() throws Exception {
StreamingHttpRequest request = reqRespFactory.get("/path");
request.headers().set(PROXY_AUTHORIZATION, "OtherScheme qwe, Basic ");
testProxyAuthenticationRequired(request);
}
use of io.servicetalk.http.api.StreamingHttpRequest in project servicetalk by apple.
the class BasicAuthHttpServiceFilterTest method wrongPassword.
@Test
void wrongPassword() throws Exception {
StreamingHttpRequest request = reqRespFactory.get("/path");
request.headers().set(AUTHORIZATION, "Basic " + base64("userId:wrong-password"));
testUnauthorized(request);
}
use of io.servicetalk.http.api.StreamingHttpRequest in project servicetalk by apple.
the class BasicAuthHttpServiceFilterTest method authenticatedAndHasOtherScheme.
@Test
void authenticatedAndHasOtherScheme() throws Exception {
StreamingHttpRequest request = reqRespFactory.get("/path");
request.headers().set(AUTHORIZATION, "Other token, Basic " + base64("userId:password"));
testAuthenticated(request);
}
use of io.servicetalk.http.api.StreamingHttpRequest in project servicetalk by apple.
the class EnforceSequentialModeRequesterFilterTest method responseCompletesAfterRequestPayloadBodyCompletes.
@Test
void responseCompletesAfterRequestPayloadBodyCompletes() {
TestPublisher<Buffer> payloadBody = new TestPublisher<>();
StreamingHttpRequest request = REQ_RES_FACTORY.post("/").payloadBody(payloadBody);
FilterableStreamingHttpClient client = EnforceSequentialModeRequesterFilter.INSTANCE.create(this.client);
StepVerifiers.create(client.request(request)).expectCancellable().then(payloadBody::onComplete).expectSuccess().verify();
}
use of io.servicetalk.http.api.StreamingHttpRequest in project servicetalk by apple.
the class EnforceSequentialModeRequesterFilterTest method withoutFilterResponseCompletesIndependently.
@Test
void withoutFilterResponseCompletesIndependently() {
StreamingHttpRequest request = REQ_RES_FACTORY.post("/").payloadBody(never());
StepVerifiers.create(this.client.request(request)).expectCancellable().expectSuccess().verify();
}
Aggregations