DemandResponseController { @RequestMapping(value = "/{id}/venResponse", method = RequestMethod.GET) @ResponseBody public List<VenDemandResponseEventDto> readVenDemandResponseEvent(@PathVariable(value = "id") Long id, HttpServletResponse response) { try { List<VenDemandResponseEvent> venDemandResponseEvent = demandResponseEventService .getVenDemandResponseEvent(id); return dtoMapper.mapList(venDemandResponseEvent, VenDemandResponseEventDto.class); } catch (OadrElementNotFoundException e) { response.setStatus(HttpStatus.NOT_FOUND_404); return null; } }  @RequestMapping(value = "/search", method = RequestMethod.POST) @ResponseBody List<DemandResponseEventReadDto> search(@RequestBody List<DemandResponseEventFilter> filters,
			@RequestParam(value = "start", required = false) Long start,
			@RequestParam(value = "end", required = false) Long end,
			@RequestParam(value = "page", required = false) Integer page,
			@RequestParam(value = "size", required = false) Integer size, HttpServletResponse response); @RequestMapping(value = "/", method = RequestMethod.POST) @ResponseBody DemandResponseEventReadDto create(@Valid @RequestBody DemandResponseEventCreateDto event,
			HttpServletResponse response, BindingResult result); @RequestMapping(value = "/{id}", method = RequestMethod.PUT) @ResponseBody DemandResponseEventReadDto update(@PathVariable(value = "id") Long id,
			@Valid @RequestBody DemandResponseEventUpdateDto event, HttpServletResponse response,
			BindingResult result); @RequestMapping(value = "/{id}/publish", method = RequestMethod.POST) @ResponseBody DemandResponseEventReadDto publish(@PathVariable(value = "id") Long id, HttpServletResponse response); @RequestMapping(value = "/{id}/active", method = RequestMethod.POST) @ResponseBody DemandResponseEventReadDto active(@PathVariable(value = "id") Long id, HttpServletResponse response); @RequestMapping(value = "/{id}/cancel", method = RequestMethod.POST) @ResponseBody DemandResponseEventReadDto cancel(@PathVariable(value = "id") Long id, HttpServletResponse response); @RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseBody DemandResponseEventReadDto read(@PathVariable(value = "id") Long id, HttpServletResponse response); @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseBody void delete(@PathVariable(value = "id") Long id, HttpServletResponse response); @RequestMapping(value = "/{id}/venResponse", method = RequestMethod.GET) @ResponseBody List<VenDemandResponseEventDto> readVenDemandResponseEvent(@PathVariable(value = "id") Long id,
			HttpServletResponse response); @RequestMapping(value = "/{id}/venResponse/{username}", method = RequestMethod.GET) @ResponseBody VenDemandResponseEventDto readVenDemandResponseEvent(@PathVariable(value = "id") Long id,
			@PathVariable(value = "username") String username, HttpServletResponse response);  }
@Test public void readVenDemandResponseEventTest() throws Exception { this.mockMvc.perform( MockMvcRequestBuilders.get(DEMAND_RESPONSE_EVENT_URL + "mouaiccool/venResponse").with(adminSession)) .andExpect(MockMvcResultMatchers.status().is(HttpStatus.BAD_REQUEST_400)); this.mockMvc .perform(MockMvcRequestBuilders.get(DEMAND_RESPONSE_EVENT_URL + "12/venResponse").with(adminSession)) .andExpect(MockMvcResultMatchers.status().is(HttpStatus.NOT_FOUND_404)); MvcResult andReturn = this.mockMvc .perform(MockMvcRequestBuilders.get(DEMAND_RESPONSE_EVENT_URL + event1.getId() + "/venResponse") .with(adminSession)) .andExpect(MockMvcResultMatchers.status().is(HttpStatus.OK_200)).andReturn(); List<VenDemandResponseEventDto> convertMvcResultToVenDemandResponseEventDtoList = convertMvcResultToVenDemandResponseEventDtoList( andReturn); assertEquals(2, convertMvcResultToVenDemandResponseEventDtoList.size()); }