use of io.apiman.gateway.engine.beans.util.QueryMap in project apiman-plugins by apiman.
the class JsonpPolicyTest method shouldSaveCallbackParamNameInContextWhenPresent.
@Test
public void shouldSaveCallbackParamNameInContextWhenPresent() throws Exception {
// given
JsonpConfigBean config = new JsonpConfigBean();
config.setCallbackParamName("testParam");
QueryMap queryParams = new QueryMap();
queryParams.put("testParam", "testFunction");
ApiRequest request = new ApiRequest();
request.setQueryParams(queryParams);
IPolicyChain<ApiRequest> chain = mock(IPolicyChain.class);
// when
jsonpPolicy.doApply(request, sContext, config, chain);
// then
assertEquals("testFunction", sContext.getAttribute("callbackFunctionName", null));
verify(chain).doApply(request);
}
Aggregations