use of io.gravitee.common.util.LinkedMultiValueMap in project gravitee-gateway by gravitee-io.
the class VertxHttpServerRequest method parameters.
@Override
public MultiValueMap<String, String> parameters() {
if (queryParameters == null) {
MultiMap parameters = httpServerRequest.params();
queryParameters = new LinkedMultiValueMap<>(parameters.size());
for (Map.Entry<String, String> param : httpServerRequest.params()) {
queryParameters.put(param.getKey(), parameters.getAll(param.getKey()));
}
}
return queryParameters;
}
use of io.gravitee.common.util.LinkedMultiValueMap in project gravitee-gateway by gravitee-io.
the class ApiKeyAuthenticationHandlerTest method shouldHandleRequestUsingQueryParameters.
@Test
public void shouldHandleRequestUsingQueryParameters() {
Request request = mock(Request.class);
MultiValueMap<String, String> parameters = new LinkedMultiValueMap<>();
parameters.put("api-key", Collections.singletonList("xxxxx-xxxx-xxxxx"));
when(request.parameters()).thenReturn(parameters);
HttpHeaders headers = new HttpHeaders();
when(request.headers()).thenReturn(headers);
boolean handle = authenticationHandler.canHandle(request);
Assert.assertTrue(handle);
}
Aggregations