title: Spring Controller sending image to client results in 406
body: <p>I'm trying to send an image to the front end upon request, it works if i put it in the request body as part JSON, but i want to use image/png, makes more sense, but i get a 406 when i try that.</p>
  
  <p>Controller:</p>
  
  <pre><code>@RequestMapping(value = RESTPaths.EQUIPMENT_FILE_GET_IMAGE + "/{equipmentId}", method = RequestMethod.GET,
          produces = MediaType.IMAGE_PNG_VALUE)
  public @ResponseBody byte[] insertDataFile(@PathVariable("equipmentId") final Long equipmentId)
          throws InternalServerError {
      return equipmentFileService.getImage(equipmentId);
  }
  </code></pre>
  
  <p>Test (client):</p>
  
  <pre><code>mockMvc.perform(
              get(RESTPaths.EQUIPMENT_FILE_CONTROLLER + RESTPaths.EQUIPMENT_FILE_GET_IMAGE + "/" + equipment.getId())
                      .with(httpBasic("user", "password")).accept(MediaType.IMAGE_PNG)
                      .contentType(TestUtil.APPLICATION_JSON_UTF8)).andDo(MockMvcResultHandlers.print()).andExpect(status().isOk());
  }
  </code></pre>
  
  <p>What am i missing?</p>