### Question:
TierController { @GetMapping(value = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseStatus(HttpStatus.OK) @ResponseBody public ResponseEntity<List<SaleTierResponse>> getAllTiers() { List<SaleTierResponse> saleTiers = new ArrayList<>(); saleTierService.getAllSaleTiersOrderByStartDate().forEach( t -> saleTiers.add(fromEntityToResponse(t))); return ResponseEntity.ok(saleTiers); }  @GetMapping(value = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseStatus(HttpStatus.OK) @ResponseBody ResponseEntity<List<SaleTierResponse>> getAllTiers(); @PostMapping(value = "/create", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) ResponseEntity<List<SaleTierResponse>> createTiers(
            @RequestBody List<SaleTierRequest> tiersRequest);  }### Answer:
@Test public void getAllTiers() throws Exception { tiers = createFiveTiers(); when(saleTierService.getAllSaleTiersOrderByStartDate()) .thenReturn(tiers); MvcResult result = this.mockMvc.perform(get(TIERS_ENDPOINT) .contentType(APPLICATION_JSON)) .andExpect(status().isOk()) .andDo(print()) .andReturn(); List<SaleTierResponse> responses = tiers.stream() .map(t -> tierController.fromEntityToResponse(t)) .collect(Collectors.toList()); assertThat(result.getResponse().getContentAsString()).isEqualTo( jsonSaleTierResponse.write(responses).getJson()); }