use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method addDefaultAPIForTenant.
@Test
public void addDefaultAPIForTenant() throws Exception {
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
restapiAdminServiceProxy.setTenantDomain(tenantDomain);
Mockito.when(restapiAdminServiceProxy.addApi(config)).thenReturn(true);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
Assert.assertTrue(apiGatewayAdmin.addDefaultAPIForTenant(provider, name, version, config, tenantDomain));
}
use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method getApiForTenant.
@Test
public void getApiForTenant() throws Exception {
APIData apiData = new APIData();
apiData.setContext("/abc");
apiData.setName(name);
apiData.setFileName(name);
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
restapiAdminServiceProxy.setTenantDomain(tenantDomain);
Mockito.when(restapiAdminServiceProxy.getApi(apiName)).thenReturn(apiData);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
Assert.assertNotNull(apiGatewayAdmin.getApiForTenant(name, version, tenantDomain));
}
use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method removeEndpointsToUpdate.
@Test
public void removeEndpointsToUpdate() throws Exception {
EndpointAdminServiceProxy endpointAdminServiceProxy = Mockito.mock(EndpointAdminServiceProxy.class);
Mockito.when(endpointAdminServiceProxy.removeEndpointsToUpdate(Mockito.anyString(), Mockito.anyString())).thenReturn(true);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(null, endpointAdminServiceProxy, null);
Assert.assertTrue(apiGatewayAdmin.removeEndpointsToUpdate(name, version, tenantDomain));
}
use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method updateApi.
@Test
public void updateApi() throws Exception {
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
Mockito.when(restapiAdminServiceProxy.updateApi(apiName, config)).thenReturn(true);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
Assert.assertTrue(apiGatewayAdmin.updateApi(name, version, config));
}
use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method getDefaultApiForTenant.
@Test
public void getDefaultApiForTenant() throws Exception {
APIData apiData = new APIData();
apiData.setContext("/abc");
apiData.setName(name);
apiData.setFileName(name);
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
restapiAdminServiceProxy.setTenantDomain(tenantDomain);
Mockito.when(restapiAdminServiceProxy.getApi(apiDefaultName)).thenReturn(apiData);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
Assert.assertNotNull(apiGatewayAdmin.getDefaultApiForTenant(name, version, tenantDomain));
}
Aggregations