use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method addPrototypeApiScriptImpl.
@Test
public void addPrototypeApiScriptImpl() throws Exception {
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
Mockito.when(restapiAdminServiceProxy.addApi(config)).thenReturn(true);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
Assert.assertTrue(apiGatewayAdmin.addPrototypeApiScriptImpl(provider, name, version, config));
}
use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method addApi.
@Test
public void addApi() throws Exception {
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
Mockito.when(restapiAdminServiceProxy.addApi(config)).thenReturn(true);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
Assert.assertTrue(apiGatewayAdmin.addApi(provider, name, version, config));
}
use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method addDefaultAPI.
@Test
public void addDefaultAPI() throws Exception {
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
Mockito.when(restapiAdminServiceProxy.addApi(config)).thenReturn(true);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
Assert.assertTrue(apiGatewayAdmin.addDefaultAPI(provider, name, version, config));
}
use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method updateDefaultApiForTenant.
@Test
public void updateDefaultApiForTenant() throws Exception {
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
restapiAdminServiceProxy.setTenantDomain(tenantDomain);
Mockito.when(restapiAdminServiceProxy.updateApi(apiDefaultName, config)).thenReturn(true);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
Assert.assertTrue(apiGatewayAdmin.updateDefaultApiForTenant(name, version, config, tenantDomain));
}
use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method getSequence.
@Test
public void getSequence() throws Exception {
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
EndpointAdminServiceProxy endpointAdminServiceProxy = Mockito.mock(EndpointAdminServiceProxy.class);
SequenceAdminServiceProxy sequenceAdminServiceProxy = Mockito.mock(SequenceAdminServiceProxy.class);
OMFactory fac = OMAbstractFactory.getOMFactory();
OMElement test1 = fac.createOMElement("test1", "", "");
Mockito.when(sequenceAdminServiceProxy.getSequence(name)).thenReturn(test1);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, endpointAdminServiceProxy, sequenceAdminServiceProxy);
Assert.assertEquals(apiGatewayAdmin.getSequence(name), test1);
}
Aggregations