use of org.wso2.carbon.apimgt.rest.api.common.exception.APIMgtSecurityException in project carbon-apimgt by wso2.
the class PoliciesApiServiceImplTest method getRequest.
private Request getRequest() throws APIMgtSecurityException {
HTTPCarbonMessage carbonMessage = Mockito.mock(HTTPCarbonMessage.class);
Request request = new Request(carbonMessage);
try {
PowerMockito.whenNew(Request.class).withArguments(carbonMessage).thenReturn(request);
} catch (Exception e) {
throw new APIMgtSecurityException("Error while mocking Request Object ", e);
}
return request;
}
use of org.wso2.carbon.apimgt.rest.api.common.exception.APIMgtSecurityException in project carbon-apimgt by wso2.
the class BlacklistApiServiceImplTest method getRequest.
private Request getRequest() throws APIMgtSecurityException {
HTTPCarbonMessage carbonMessage = Mockito.mock(HTTPCarbonMessage.class);
Request request = new Request(carbonMessage);
try {
PowerMockito.whenNew(Request.class).withArguments(carbonMessage).thenReturn(request);
} catch (Exception e) {
throw new APIMgtSecurityException("Error while mocking Request Object ", e);
}
return request;
}
use of org.wso2.carbon.apimgt.rest.api.common.exception.APIMgtSecurityException in project carbon-apimgt by wso2.
the class SdkGenApiServiceImplTestCase method getRequest.
// Sample request to be used by tests
private Request getRequest() throws APIMgtSecurityException {
HTTPCarbonMessage carbonMessage = Mockito.mock(HTTPCarbonMessage.class);
Mockito.when(carbonMessage.getProperty("LOGGED_IN_USER")).thenReturn(USER);
Request request = new Request(carbonMessage);
return request;
}
use of org.wso2.carbon.apimgt.rest.api.common.exception.APIMgtSecurityException in project carbon-apimgt by wso2.
the class TestUtil method getRequest.
// Sample request to be used by tests
protected static Request getRequest() throws APIMgtSecurityException {
HTTPCarbonMessage carbonMessage = Mockito.mock(HTTPCarbonMessage.class);
Mockito.when(carbonMessage.getProperty("LOGGED_IN_USER")).thenReturn(USER);
Request request = new Request(carbonMessage);
return request;
}
Aggregations