use of org.wso2.carbon.apimgt.rest.integration.tests.store.auth.ApiKeyAuth in project product-apim by wso2.
the class ApiClient method setApiKey.
/**
* Helper method to configure the first api key found
*
* @param apiKey API key
*/
public void setApiKey(String apiKey) {
for (RequestInterceptor apiAuthorization : apiAuthorizations.values()) {
if (apiAuthorization instanceof ApiKeyAuth) {
ApiKeyAuth keyAuth = (ApiKeyAuth) apiAuthorization;
keyAuth.setApiKey(apiKey);
return;
}
}
throw new RuntimeException("No API key authentication configured!");
}
Aggregations