use of org.wso2.carbon.apimgt.gateway.utils.SequenceAdminServiceProxy 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.SequenceAdminServiceProxy 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.SequenceAdminServiceProxy 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.SequenceAdminServiceProxy 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.SequenceAdminServiceProxy 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);
}
Aggregations