Search in sources :

Example 11 with EndpointAdminServiceProxy

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);
}
Also used : RESTAPIAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy) EndpointAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.EndpointAdminServiceProxy) SequenceAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.SequenceAdminServiceProxy) Test(org.junit.Test)

Example 12 with EndpointAdminServiceProxy

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));
}
Also used : EndpointAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.EndpointAdminServiceProxy) Test(org.junit.Test)

Example 13 with EndpointAdminServiceProxy

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));
}
Also used : RESTAPIAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy) OMElement(org.apache.axiom.om.OMElement) EndpointAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.EndpointAdminServiceProxy) SequenceAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.SequenceAdminServiceProxy) Test(org.junit.Test)

Example 14 with EndpointAdminServiceProxy

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");
}
Also used : RESTAPIAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy) EndpointAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.EndpointAdminServiceProxy) SequenceAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.SequenceAdminServiceProxy) Test(org.junit.Test)

Example 15 with EndpointAdminServiceProxy

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));
}
Also used : RESTAPIAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy) EndpointAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.EndpointAdminServiceProxy) SequenceAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.SequenceAdminServiceProxy) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)17 EndpointAdminServiceProxy (org.wso2.carbon.apimgt.gateway.utils.EndpointAdminServiceProxy)14 RESTAPIAdminServiceProxy (org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy)10 SequenceAdminServiceProxy (org.wso2.carbon.apimgt.gateway.utils.SequenceAdminServiceProxy)10 AxisFault (org.apache.axis2.AxisFault)7 OMElement (org.apache.axiom.om.OMElement)4 EndpointAdmin (org.wso2.carbon.endpoint.service.EndpointAdmin)4 APIManagementException (org.wso2.carbon.apimgt.api.APIManagementException)3 OMFactory (org.apache.axiom.om.OMFactory)2 API (org.wso2.carbon.apimgt.api.model.API)2 APIIdentifier (org.wso2.carbon.apimgt.api.model.APIIdentifier)2 LocalEntryServiceProxy (org.wso2.carbon.apimgt.gateway.utils.LocalEntryServiceProxy)2 MediationSecurityAdminServiceProxy (org.wso2.carbon.apimgt.gateway.utils.MediationSecurityAdminServiceProxy)2 CertificateManager (org.wso2.carbon.apimgt.impl.certificatemgt.CertificateManager)2 ArrayList (java.util.ArrayList)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 CredentialDto (org.wso2.carbon.apimgt.api.gateway.CredentialDto)1 GatewayContentDTO (org.wso2.carbon.apimgt.api.gateway.GatewayContentDTO)1