use of org.wso2.carbon.apimgt.gateway.utils.EndpointAdminServiceProxy in project carbon-apimgt by wso2.
the class APIGatewayAdminTest method isExistingSequenceForTenant.
@Test
public void isExistingSequenceForTenant() 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.isExistingSequenceForTenant(name, tenantDomain), true);
}
use of org.wso2.carbon.apimgt.gateway.utils.EndpointAdminServiceProxy 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.utils.EndpointAdminServiceProxy 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.utils.EndpointAdminServiceProxy 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.utils.EndpointAdminServiceProxy 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