From c3412b6beac11ba75abc1caed54993ab1ab86148 Mon Sep 17 00:00:00 2001 From: Nirothipan Date: Thu, 12 Oct 2017 14:16:44 +0530 Subject: [PATCH] removing blank lines --- .../publisher/APIPublisherServiceTest.java | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/test/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceTest.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/test/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceTest.java index 803b2736daa..5360caa68b5 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/test/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceTest.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/test/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceTest.java @@ -70,24 +70,19 @@ APIPublisherServiceTest extends BaseAPIPublisherTest { IllegalAccessException { APIConfig apiConfig = new APIConfig(); setApiConfigs(apiConfig, "testAPI-1"); - APIPublisherDataHolder apiPublisherDataHolder = Mockito.mock(APIPublisherDataHolder.getInstance(). getClass(), Mockito.CALLS_REAL_METHODS); IntegrationClientService integrationClientService = Mockito.mock(IntegrationClientServiceImpl. class, Mockito.CALLS_REAL_METHODS); doReturn(integrationClientService).when(apiPublisherDataHolder).getIntegrationClientService(); - PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService(). getPublisherClient(); doReturn(publisherClient).when(integrationClientService).getPublisherClient(); - APIsApi apIsApi = Mockito.mock(Api.class, Mockito.CALLS_REAL_METHODS); doReturn(apIsApi).when(publisherClient).getApi(); - API api = Mockito.mock(API.class, Mockito.CALLS_REAL_METHODS); api.setStatus("CREATED"); doReturn(api).when(apIsApi).apisPost(Mockito.any(), Mockito.anyString()); - apiPublisherService.publishAPI(apiConfig); } @@ -95,37 +90,28 @@ APIPublisherServiceTest extends BaseAPIPublisherTest { private void publishWithNoAPIListCreated() throws APIManagerPublisherException { APIConfig apiConfig = new APIConfig(); setApiConfigs(apiConfig, "testAPI-3"); - APIPublisherDataHolder apiPublisherDataHolder = Mockito.mock(APIPublisherDataHolder.getInstance(). getClass(), Mockito.CALLS_REAL_METHODS); IntegrationClientService integrationClientService = Mockito.mock(IntegrationClientServiceImpl. class, Mockito.CALLS_REAL_METHODS); doReturn(integrationClientService).when(apiPublisherDataHolder).getIntegrationClientService(); - PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService(). getPublisherClient(); doReturn(publisherClient).when(integrationClientService).getPublisherClient(); - APIsApi apIsApi = Mockito.mock(Api.class, Mockito.CALLS_REAL_METHODS); doReturn(apIsApi).when(publisherClient).getApi(); - API api = Mockito.mock(API.class, Mockito.CALLS_REAL_METHODS); api.setStatus("CREATED"); doReturn(api).when(apIsApi).apisPost(Mockito.any(), Mockito.anyString()); - APIList apiList = Mockito.mock(APIList.class, Mockito.CALLS_REAL_METHODS); APIInfo apiInfo = new APIInfo(); - List apiInfoList = new ArrayList<>(); apiInfoList.add(apiInfo); - apiList.list(apiInfoList); doReturn(apiList).when(apIsApi).apisGet(Mockito.anyInt(), Mockito.anyInt(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString()); - doReturn(api).when(apIsApi).apisApiIdPut(Mockito.anyString(), Mockito.any(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString()); - apiPublisherService.publishAPI(apiConfig); } @@ -133,30 +119,24 @@ APIPublisherServiceTest extends BaseAPIPublisherTest { private void publishWithAPIListCreated() throws APIManagerPublisherException { APIConfig apiConfig = new APIConfig(); setApiConfigs(apiConfig, "testAPI-2"); - APIPublisherDataHolder apiPublisherDataHolder = Mockito.mock(APIPublisherDataHolder.getInstance(). getClass(), Mockito.CALLS_REAL_METHODS); IntegrationClientService integrationClientService = Mockito.mock(IntegrationClientServiceImpl. class, Mockito.CALLS_REAL_METHODS); doReturn(integrationClientService).when(apiPublisherDataHolder).getIntegrationClientService(); - PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService(). getPublisherClient(); doReturn(publisherClient).when(integrationClientService).getPublisherClient(); - APIsApi apIsApi = Mockito.mock(Api.class, Mockito.CALLS_REAL_METHODS); doReturn(apIsApi).when(publisherClient).getApi(); - API api = Mockito.mock(API.class, Mockito.CALLS_REAL_METHODS); api.setStatus("CREATED"); doReturn(api).when(apIsApi).apisPost(Mockito.any(), Mockito.anyString()); - APIList apiList = Mockito.mock(APIList.class, Mockito.CALLS_REAL_METHODS); APIInfo apiInfo = new APIInfo(); apiInfo.setName("testAPI-2"); apiInfo.setVersion("1.0.0"); apiInfo.setId("test-one"); - List apiInfoList = new ArrayList<>(); apiInfoList.add(apiInfo); apiList.list(apiInfoList); @@ -164,7 +144,6 @@ APIPublisherServiceTest extends BaseAPIPublisherTest { Mockito.anyString(), Mockito.anyString(), Mockito.anyString()); doReturn(api).when(apIsApi).apisApiIdPut(Mockito.anyString(), Mockito.any(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString()); - apiConfig.setSharedWithAllTenants(false); apiPublisherService.publishAPI(apiConfig); }