use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method addSequence.
@Test
public void addSequence() throws Exception {
String sequence = "<api></api>";
RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
EndpointAdminServiceProxy endpointAdminServiceProxy = Mockito.mock(EndpointAdminServiceProxy.class);
SequenceAdminServiceProxy sequenceAdminServiceProxy = Mockito.mock(SequenceAdminServiceProxy.class);
Mockito.doNothing().when(sequenceAdminServiceProxy).addSequence(Mockito.any(OMElement.class));
APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, endpointAdminServiceProxy, sequenceAdminServiceProxy);
Assert.assertTrue(apiGatewayAdmin.addSequence(sequence));
}
use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method updateApiForInlineScriptForTenant.
@Test
public void updateApiForInlineScriptForTenant() 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.updateApiForInlineScriptForTenant(name, version, config, tenantDomain));
}
use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method deleteSequence.
@Test
public void deleteSequence() throws Exception {
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);
apiGatewayAdmin.deleteSequence("name");
}
use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method updateApiForInlineScript.
@Test
public void updateApiForInlineScript() 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.updateApiForInlineScript(name, version, config));
}
use of org.wso2.carbon.apimgt.gateway.service.APIGatewayAdmin 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));
}
Aggregations