MenuService menuService = EasyMock.createMock(MenuService.class);
HttpServletRequest mockRequest = EasyMock.createMock(HttpServletRequest.class);
EasyMock.expect(mockRequest.isUserInRole(EasyMock.anyObject(String.class))).andReturn(true).times(3);
EasyMock.expect(menuService.listMenuItems()).andReturn(new HashMap<String, List<MenuItemDescription>>()).once();
restService.setMenuService(menuService);
SaveMenuItemDTO dto = new SaveMenuItemDTO();
List<String> allowedEvents = new ArrayList<String>();
allowedEvents.add("onclick");
allowedEvents.add("onfocus");
allowedEvents.add("onblur");
dto.setAllowedEvent(allowedEvents);
dto.setClone("{}");
dto.setGroupName("groupName");
dto.setName("myItem");
EasyMock.replay(mockRequest, menuService);
Response resp = restService.deleteMenuItem(dto, mockRequest);
EasyMock.verify(mockRequest, menuService);