File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
main/java/uk/gov/companieshouse/orders/api/controller
test/java/uk/gov/companieshouse/orders/api/controller Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ public ResponseEntity<Item> getOrderItem(final @PathVariable("id") String orderI
102102 }
103103
104104 @ GetMapping (GET_CHECKOUT_ITEM_URI )
105- public ResponseEntity <Checkout > getCheckoutItem (final @ PathVariable ("id" ) String checkoutId ,
105+ public ResponseEntity <CheckoutData > getCheckoutItem (final @ PathVariable ("id" ) String checkoutId ,
106106 final @ PathVariable ("itemId" ) String itemId ,
107107 final @ RequestHeader (REQUEST_ID_HEADER_NAME ) String requestId ) {
108108 Map <String , Object > logMap = createLogMapWithRequestId (requestId );
@@ -113,7 +113,7 @@ public ResponseEntity<Checkout> getCheckoutItem(final @PathVariable("id") String
113113 .orElseThrow (ResourceNotFoundException ::new );
114114 logMap .put (LoggingUtils .STATUS , HttpStatus .OK );
115115 LOGGER .info ("Checkout with item found and returned" , logMap );
116- return ResponseEntity .ok ().body (checkout );
116+ return ResponseEntity .ok ().body (checkout . getData () );
117117 }
118118
119119 @ GetMapping (GET_CHECKOUT_URI )
Original file line number Diff line number Diff line change @@ -582,11 +582,8 @@ void getCheckoutItem() throws Exception {
582582 "12345678" )));
583583 checkoutRepository .save (preexistingCheckout );
584584
585- final Checkout expectedCheckout = new Checkout ();
586- expectedCheckout .setId (CHECKOUT_ID );
587585 final CheckoutData expectedCheckoutData = new CheckoutData ();
588586 expectedCheckoutData .setItems (Collections .singletonList (expectedItem ));
589- expectedCheckout .setData (expectedCheckoutData );
590587
591588 mockMvc .perform (get ("/checkouts/" +CHECKOUT_ID +"/items/CCD-123456-123456" )
592589 .header (REQUEST_ID_HEADER_NAME , TOKEN_REQUEST_ID_VALUE )
@@ -596,7 +593,7 @@ void getCheckoutItem() throws Exception {
596593 .header (ERIC_AUTHORISED_TOKEN_PERMISSIONS , String .format (TOKEN_PERMISSION_VALUE , Permission .Value .READ ))
597594 .contentType (MediaType .APPLICATION_JSON ))
598595 .andExpect (status ().isOk ())
599- .andExpect (content ().json (mapper .writeValueAsString (expectedCheckout )));
596+ .andExpect (content ().json (mapper .writeValueAsString (expectedCheckoutData )));
600597 }
601598
602599 @ DisplayName ("Get checkout item returns HTTP 404 Not Found if no matching item ID" )
You can’t perform that action at this time.
0 commit comments