use of org.wso2.carbon.apimgt.gateway.utils.EndpointAdminServiceProxy in project carbon-apimgt by wso2.
the class EndpointAdminServiceProxyTestCase method testDeleteEndpoint.
@Test
public void testDeleteEndpoint() {
EndpointAdminServiceProxy endpointAdminServiceProxy = null;
try {
endpointAdminServiceProxy = new EndpointAdminServiceProxy(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
EndpointAdmin endpointAdmin = Mockito.mock(EndpointAdmin.class);
Mockito.when(endpointAdmin.deleteEndpoint(Mockito.anyString())).thenReturn(true);
Mockito.when(endpointAdmin.getEndPointsNames()).thenReturn(null);
Mockito.when(endpointAdmin.getEndPointsNamesForTenant(Mockito.anyString())).thenReturn(null);
endpointAdminServiceProxy.setEndpointAdmin(endpointAdmin);
} catch (Exception e) {
Assert.fail("Exception while testing deleteEndpoint");
}
try {
endpointAdminServiceProxy.deleteEndpoint("PizzaShackAPI--v1.0.0_APIproductionEndpoint");
} catch (AxisFault e) {
Assert.fail("AxisFault while testing deleteEndpoint");
}
try {
endpointAdminServiceProxy.deleteEndpoint("PizzaShackAPI--v1.0.0_APIproductionEndpoint");
} catch (AxisFault e) {
Assert.fail("AxisFault while testing deleteEndpoint");
}
}
Aggregations