use of io.vertx.reactivex.core.MultiMap in project knotx by Cognifide.
the class SampleApplicationHeadersTest method testGetRequest.
private void testGetRequest(TestContext context, String url) {
HttpClient client = Vertx.newInstance(vertx.vertx()).createHttpClient();
Async async = context.async();
client.getNow(KNOTX_SERVER_PORT, KNOTX_SERVER_ADDRESS, url, resp -> {
MultiMap headers = resp.headers();
headers.names().forEach(name -> {
context.assertEquals(resp.statusCode(), 200, "Wrong status code received.");
context.assertTrue(expectedHeaders.contains(name), "Header " + name + " is not expected.");
context.assertEquals(expectedHeaders.get(name), headers.get(name), "Wrong value of " + name + " header.");
});
async.complete();
});
}
use of io.vertx.reactivex.core.MultiMap in project knotx by Cognifide.
the class HttpClientFacade method updateRequestHeaders.
private void updateRequestHeaders(HttpRequest<Buffer> request, ClientRequest serviceRequest, ServiceMetadata serviceMetadata) {
MultiMap filteredHeaders = getFilteredHeaders(serviceRequest.getHeaders(), serviceMetadata.getAllowedRequestHeaderPatterns());
filteredHeaders.names().forEach(headerName -> filteredHeaders.getAll(headerName).forEach(value -> request.headers().add(headerName, value)));
if (customRequestHeader.containsKey("name") && customRequestHeader.containsKey("value")) {
request.headers().set(customRequestHeader.getString("name"), customRequestHeader.getString("value"));
}
}
use of io.vertx.reactivex.core.MultiMap in project knotx by Cognifide.
the class UriTransformerReplaceTest method getParamsMultiMap.
private static MultiMap getParamsMultiMap() {
MultiMap map = MultiMap.caseInsensitiveMultiMap();
map.add("q", "knot & x");
map.add("action", "/some/action/path");
return map;
}
use of io.vertx.reactivex.core.MultiMap in project knotx by Cognifide.
the class UriTransformerReplaceTest method getHeadersMultiMap.
private static MultiMap getHeadersMultiMap() {
MultiMap map = MultiMap.caseInsensitiveMultiMap();
map.add("authorizationId", "486434684345");
return map;
}
Aggregations