Search in sources :

Example 6 with RESTAPIAdminServiceProxy

use of org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy in project carbon-apimgt by wso2.

the class APIGatewayAdminTest method getDefaultApi.

@Test
public void getDefaultApi() throws Exception {
    APIData apiData = new APIData();
    apiData.setContext("/abc");
    apiData.setName(name);
    apiData.setFileName(name);
    RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
    Mockito.when(restapiAdminServiceProxy.getApi(apiDefaultName)).thenReturn(apiData);
    APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
    Assert.assertNotNull(apiGatewayAdmin.getDefaultApi(name, version));
}
Also used : RESTAPIAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy) APIData(org.wso2.carbon.rest.api.APIData) Test(org.junit.Test)

Example 7 with RESTAPIAdminServiceProxy

use of org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy in project carbon-apimgt by wso2.

the class APIGatewayAdminTest method deleteDefaultApi.

@Test
public void deleteDefaultApi() throws Exception {
    RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
    Mockito.when(restapiAdminServiceProxy.deleteApi(apiDefaultName)).thenReturn(true);
    APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
    Assert.assertTrue(apiGatewayAdmin.deleteDefaultApi(name, version));
}
Also used : RESTAPIAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy) Test(org.junit.Test)

Example 8 with RESTAPIAdminServiceProxy

use of org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy in project carbon-apimgt by wso2.

the class APIGatewayAdminTest method deleteSequenceForTenant.

@Test
public void deleteSequenceForTenant() 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.deleteSequenceForTenant("name", 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)

Example 9 with RESTAPIAdminServiceProxy

use of org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy in project carbon-apimgt by wso2.

the class APIGatewayAdminTest method addPrototypeApiScriptImpl.

@Test
public void addPrototypeApiScriptImpl() throws Exception {
    RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
    Mockito.when(restapiAdminServiceProxy.addApi(config)).thenReturn(true);
    APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
    Assert.assertTrue(apiGatewayAdmin.addPrototypeApiScriptImpl(provider, name, version, config));
}
Also used : RESTAPIAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy) Test(org.junit.Test)

Example 10 with RESTAPIAdminServiceProxy

use of org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy in project carbon-apimgt by wso2.

the class APIGatewayAdminTest method addApi.

@Test
public void addApi() throws Exception {
    RESTAPIAdminServiceProxy restapiAdminServiceProxy = Mockito.mock(RESTAPIAdminServiceProxy.class);
    Mockito.when(restapiAdminServiceProxy.addApi(config)).thenReturn(true);
    APIGatewayAdmin apiGatewayAdmin = new APIGatewayAdminWrapper(restapiAdminServiceProxy, null, null);
    Assert.assertTrue(apiGatewayAdmin.addApi(provider, name, version, config));
}
Also used : RESTAPIAdminServiceProxy(org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy) Test(org.junit.Test)

Aggregations

RESTAPIAdminServiceProxy (org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy)44 Test (org.junit.Test)28 EndpointAdminServiceProxy (org.wso2.carbon.apimgt.gateway.utils.EndpointAdminServiceProxy)10 SequenceAdminServiceProxy (org.wso2.carbon.apimgt.gateway.utils.SequenceAdminServiceProxy)10 APIData (org.wso2.carbon.rest.api.APIData)8 OMElement (org.apache.axiom.om.OMElement)5 AxisFault (org.apache.axis2.AxisFault)3 APIManagementException (org.wso2.carbon.apimgt.api.APIManagementException)3 OMFactory (org.apache.axiom.om.OMFactory)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 XMLStreamException (javax.xml.stream.XMLStreamException)1 CredentialDto (org.wso2.carbon.apimgt.api.gateway.CredentialDto)1 GatewayContentDTO (org.wso2.carbon.apimgt.api.gateway.GatewayContentDTO)1 ResourceData (org.wso2.carbon.rest.api.ResourceData)1