use of org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method addSequenceForTenant.
@Test
public void addSequenceForTenant() throws Exception {
String sequence = "<api></api>";
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
EndpointAdminServiceProxy endpointAdminServiceProxy = Mockito.mock(EndpointAdminServiceProxy.class);
SequenceAdminServiceProxy sequenceAdminServiceProxy = Mockito.mock(SequenceAdminServiceProxy.class);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, endpointAdminServiceProxy, sequenceAdminServiceProxy);
Assert.assertTrue(apiGatewayAdmin.addSequenceForTenant(sequence, tenantDomain));
}
use of org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method getSequenceForTenant.
@Test
public void getSequenceForTenant() 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);
}
use of org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method isExistingSequence.
@Test
public void isExistingSequence() throws Exception {
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
EndpointAdminServiceProxy endpointAdminServiceProxy = Mockito.mock(EndpointAdminServiceProxy.class);
SequenceAdminServiceProxy sequenceAdminServiceProxy = Mockito.mock(SequenceAdminServiceProxy.class);
Mockito.when(sequenceAdminServiceProxy.isExistingSequence(name)).thenReturn(true);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, endpointAdminServiceProxy, sequenceAdminServiceProxy);
Assert.assertEquals(apiGatewayAdmin.isExistingSequence(name), true);
}
use of org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method updateDefaultApi.
@Test
public void updateDefaultApi() throws Exception {
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
Mockito.when(restapiAdminServiceProxy.updateApi(apiDefaultName, config)).thenReturn(true);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
Assert.assertTrue(apiGatewayAdmin.updateDefaultApi(name, version, config));
}
use of org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method updateApiForTenant.
@Test
public void updateApiForTenant() throws Exception {
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
restapiAdminServiceProxy.setTenantDomain(tenantDomain);
Mockito.when(restapiAdminServiceProxy.updateApi(apiName, config)).thenReturn(true);
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
Assert.assertTrue(apiGatewayAdmin.updateApiForTenant(name, version, config, tenantDomain));
}
Aggregations