List<WidgetCatalog> list = new ArrayList<WidgetCatalog>();
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());
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";
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";
@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";
@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";
@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";
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";
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);