### Question:
AvatarController extends ImageUploadController { @RequestMapping(value = "/users/IFrameAvatarpreview", method = RequestMethod.POST) @ResponseBody public ResponseEntity<String> uploadAvatar( @RequestParam(value = "qqfile") MultipartFile file) throws IOException, ImageProcessException { return createPreviewOfImage(file, avatarControllerUtils); } @Autowired  AvatarController(
            UserService userService,
            @Qualifier("avatarControllerUtils")
            ImageControllerUtils avatarControllerUtils,
            MessageSource messageSource); @RequestMapping(value = "/users/IFrameAvatarpreview", method = RequestMethod.POST) @ResponseBody ResponseEntity<String> uploadAvatar(
            @RequestParam(value = "qqfile") MultipartFile file); @RequestMapping(value = "/users/XHRavatarpreview", method = RequestMethod.POST) @ResponseBody Map<String, String> uploadAvatar(@RequestBody byte[] bytes,
                                            HttpServletResponse response); @RequestMapping(value = "/users/{id}/avatar", method = RequestMethod.GET) void renderAvatar(
            HttpServletRequest request,
            HttpServletResponse response,
            @PathVariable Long id); @RequestMapping(value = "/defaultAvatar", method = RequestMethod.GET) @ResponseBody String getDefaultAvatar();  }### Answer:
@Test @SuppressWarnings("unchecked") public void uploadAvatarForOperaAndIe_mustReturnPreviewInResponse() throws Exception { MultipartFile file = new MockMultipartFile("qqfile", validAvatar); avatarController.uploadAvatar(file); verify(imageControllerUtils).prepareResponse(eq(file), any(HttpHeaders.class), any(HashMap.class)); }
@Test @SuppressWarnings("unchecked") public void uploadAvatarForChromeAndFf_mustReturnPreviewInResponse() throws ImageProcessException { MockHttpServletResponse response = new MockHttpServletResponse(); avatarController.uploadAvatar(validAvatar, response); verify(imageControllerUtils).prepareResponse(eq(validAvatar), eq(response), any(Map.class)); }