@Test public void create() throws Exception { BookingServiceRequestDTO bookingRequestDTO = new BookingServiceRequestDTO(); bookingRequestDTO.setCustomerDTO(createCustomerDTO()); bookingRequestDTO.setReceiverAddress(createAddress()); bookingRequestDTO.setSenderAddress(createAddress()); BookingServiceResponseDTO bookingResponseDTO = new BookingServiceResponseDTO(); ConnoteDTO connoteDTO = new ConnoteDTO(); connoteDTO.setConnote(123L); bookingResponseDTO.setConnoteDTO(connoteDTO); bookingResponseDTO.setStatus("OK"); when(bookingServiceMock.createBooking(bookingRequestDTO)).thenReturn(bookingResponseDTO); mockMvc.perform(post("/rest/booking/create") .contentType(MediaType.APPLICATION_JSON_UTF8) .content(jsonStringFromObject(bookingRequestDTO)) ) .andExpect(status().isOk()); }
@RequestMapping(value = "create", method = RequestMethod.POST) @ResponseBody public ResponseEntity<BookingServiceResponseDTO> create(@RequestBody BookingServiceRequestDTO bookingRequestDTO, HttpServletRequest request) { LOGGER.debug(LOGGER.isDebugEnabled() ? "BookingRequest: " + bookingRequestDTO.toString() : null); BookingServiceResponseDTO booking = bookingService.createBooking(bookingRequestDTO); appendSpan(booking == null || booking.getStatus() == null ? "ERROR" : booking.getStatus(),"booking-status"); return new ResponseEntity<>(booking, HttpStatus.OK); }
BookingController { @RequestMapping(value = "create", method = RequestMethod.POST) @ResponseBody public ResponseEntity<BookingServiceResponseDTO> create(@RequestBody BookingServiceRequestDTO bookingRequestDTO, HttpServletRequest request) { LOGGER.debug(LOGGER.isDebugEnabled() ? "BookingRequest: " + bookingRequestDTO.toString() : null); BookingServiceResponseDTO booking = bookingService.createBooking(bookingRequestDTO); appendSpan(booking == null || booking.getStatus() == null ? "ERROR" : booking.getStatus(),"booking-status"); return new ResponseEntity<>(booking, HttpStatus.OK); } }
BookingController { @RequestMapping(value = "create", method = RequestMethod.POST) @ResponseBody public ResponseEntity<BookingServiceResponseDTO> create(@RequestBody BookingServiceRequestDTO bookingRequestDTO, HttpServletRequest request) { LOGGER.debug(LOGGER.isDebugEnabled() ? "BookingRequest: " + bookingRequestDTO.toString() : null); BookingServiceResponseDTO booking = bookingService.createBooking(bookingRequestDTO); appendSpan(booking == null || booking.getStatus() == null ? "ERROR" : booking.getStatus(),"booking-status"); return new ResponseEntity<>(booking, HttpStatus.OK); } @Autowired  BookingController(BookingService bookingService, Tracer tracer); }
BookingController { @RequestMapping(value = "create", method = RequestMethod.POST) @ResponseBody public ResponseEntity<BookingServiceResponseDTO> create(@RequestBody BookingServiceRequestDTO bookingRequestDTO, HttpServletRequest request) { LOGGER.debug(LOGGER.isDebugEnabled() ? "BookingRequest: " + bookingRequestDTO.toString() : null); BookingServiceResponseDTO booking = bookingService.createBooking(bookingRequestDTO); appendSpan(booking == null || booking.getStatus() == null ? "ERROR" : booking.getStatus(),"booking-status"); return new ResponseEntity<>(booking, HttpStatus.OK); } @Autowired  BookingController(BookingService bookingService, Tracer tracer); @RequestMapping(value = "create", method = RequestMethod.POST) @ResponseBody ResponseEntity<BookingServiceResponseDTO> create(@RequestBody BookingServiceRequestDTO bookingRequestDTO,
                                                            HttpServletRequest request); }
BookingController { @RequestMapping(value = "create", method = RequestMethod.POST) @ResponseBody public ResponseEntity<BookingServiceResponseDTO> create(@RequestBody BookingServiceRequestDTO bookingRequestDTO, HttpServletRequest request) { LOGGER.debug(LOGGER.isDebugEnabled() ? "BookingRequest: " + bookingRequestDTO.toString() : null); BookingServiceResponseDTO booking = bookingService.createBooking(bookingRequestDTO); appendSpan(booking == null || booking.getStatus() == null ? "ERROR" : booking.getStatus(),"booking-status"); return new ResponseEntity<>(booking, HttpStatus.OK); } @Autowired  BookingController(BookingService bookingService, Tracer tracer); @RequestMapping(value = "create", method = RequestMethod.POST) @ResponseBody ResponseEntity<BookingServiceResponseDTO> create(@RequestBody BookingServiceRequestDTO bookingRequestDTO,
                                                            HttpServletRequest request);  }