### Question:
AvatarController extends ImageUploadController { @RequestMapping(value = "/defaultAvatar", method = RequestMethod.GET) @ResponseBody public String getDefaultAvatar() throws ImageProcessException, IOException { Map<String, String> responseContent = new HashMap<>(); avatarControllerUtils.prepareNormalResponse(avatarControllerUtils.getDefaultImage(), responseContent); return avatarControllerUtils.getResponceJSONString(responseContent); } @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:
@SuppressWarnings("unchecked") @Test public void getDefaultAvatarShouldReturnDefaultAvatarInBase64String() throws Exception { String expectedJSON = "{\"team\": \"larks\"}"; when(imageControllerUtils.getDefaultImage()).thenReturn(validAvatar); when(imageControllerUtils.convertImageToIcoInString64(validAvatar)).thenReturn(IMAGE_BYTE_ARRAY_IN_BASE_64_STRING); when(imageControllerUtils.getResponceJSONString(Matchers.anyMap())).thenReturn(expectedJSON); String actualJSON = avatarController.getDefaultAvatar(); assertEquals(actualJSON, expectedJSON); }