X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-widget-ms%2Fwidget-ms%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fportalapp%2Fwidget%2Ftest%2Fcontroller%2FWidgetsCatalogControllerTest.java;h=0d01ee5002356f52588dca0493fc2ee10f700abe;hb=cb4ff59b1ac8b137bd1453ddec400679ba83b225;hp=d3dc1cbf4f9c6d1ec0d4028a2bdb55799f871873;hpb=328da2e4cf0c4155a4d29718cb5f57628d7a5277;p=portal.git diff --git a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java index d3dc1cbf..0d01ee50 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java +++ b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java @@ -134,7 +134,7 @@ public class WidgetsCatalogControllerTest { List list = new ArrayList(); WidgetCatalog widget = new WidgetCatalog(); list.add(widget); - Mockito.when(widgetService.getWidgetCatalog()).thenReturn(list); + Mockito.lenient().when(widgetService.getWidgetCatalog()).thenReturn(list); mockMvc.perform(get("/microservices/widgetCatalog/")) .andExpect(status().isBadRequest()); @@ -148,7 +148,7 @@ public class WidgetsCatalogControllerTest { widget.setId(1); widget.setName("junit"); list.add(widget); - Mockito.when(widgetService.getUserWidgetCatalog("test")).thenReturn(list); + Mockito.lenient().when(widgetService.getUserWidgetCatalog("test")).thenReturn(list); String security_user = "user"; String security_pass = "password"; @@ -170,7 +170,7 @@ public class WidgetsCatalogControllerTest { widget.setId(1); widget.setName("junit"); list.add(widget); - Mockito.when(widgetService.getUserWidgetCatalog("test")).thenReturn(list); + Mockito.lenient().when(widgetService.getUserWidgetCatalog("test")).thenReturn(list); String security_user = "user"; String security_pass = "password"; @@ -190,7 +190,7 @@ public class WidgetsCatalogControllerTest { @Test public void saveWidgetCatalog_ValidAuthorization_NoError() throws Exception { ValidationRespond respond = new ValidationRespond(true, null); - Mockito.when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond); + Mockito.lenient().when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond); String security_user = "user"; String security_pass = "password"; @@ -211,7 +211,7 @@ public class WidgetsCatalogControllerTest { @Test public void saveWidgetCatalog_Authorization_Error() throws Exception { ValidationRespond respond = new ValidationRespond(true, null); - Mockito.when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond); + Mockito.lenient().when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond); String security_user = "user"; String security_pass = "password"; @@ -270,7 +270,7 @@ public class WidgetsCatalogControllerTest { @Test public void updateWidgetCatalogwithFiles_ValidAuthorization_NoError() throws Exception { ValidationRespond respond = new ValidationRespond(true, null); - Mockito.when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond); + Mockito.lenient().when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond); String security_user = "user"; String security_pass = "password"; @@ -420,7 +420,7 @@ public class WidgetsCatalogControllerTest { widget.setId(1); widget.setName("junit"); list.add(widget); - Mockito.when(widgetService.getWidgetsByServiceId(serviceId)).thenReturn(list); + Mockito.lenient().when(widgetService.getWidgetsByServiceId(serviceId)).thenReturn(list); String security_user = "user"; String security_pass = "password"; @@ -462,7 +462,7 @@ public class WidgetsCatalogControllerTest { String wrong_pass = "wrong"; Long widgetId = new Long(1); byte[] bytes="Test".getBytes(); - Mockito.when(storageService.getWidgetCatalogContent(widgetId)).thenReturn(bytes); + Mockito.lenient().when(storageService.getWidgetCatalogContent(widgetId)).thenReturn(bytes); ReflectionTestUtils.setField(controller, "security_user", security_user, String.class); ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);