@@ -109,41 +109,6 @@ void testFileDownloadFromS3() {
109109
110110 @ Test
111111 @ Order (3 )
112- void testFileDownloadFromS3FailsOnWrongId () {
113-
114- var shipmentId = "3317ac4f-1f9b-4bab-a974-4aa987wrong" ;
115- // build the URL with the id as a path variable
116- var url = "/api/shipment/" + shipmentId + "/image/download" ;
117- ResponseEntity <byte []> responseEntity = restTemplate .exchange (BASE_URL + url ,
118- HttpMethod .GET , null , byte [].class );
119- assertEquals (HttpStatus .INTERNAL_SERVER_ERROR , responseEntity .getStatusCode ());
120- }
121-
122- @ Test
123- @ Order (4 )
124- void testGetShipmentFromDynamoDB () throws IOException {
125-
126- var url = "/api/shipment" ;
127- // set the request headers
128- ResponseEntity <List <Shipment >> responseEntity = restTemplate .exchange (BASE_URL + url ,
129- HttpMethod .GET , null , new ParameterizedTypeReference <>() {
130- });
131-
132- assertEquals (HttpStatus .OK , responseEntity .getStatusCode ());
133- assertNotNull (responseEntity .getBody ());
134-
135- if (responseEntity .getStatusCode ().is2xxSuccessful ()) {
136- var json = new File ("src/test/java/resources/shipment.json" );
137- var shipment = objectMapper .readValue (json , Shipment .class );
138- List <Shipment > shipmentList = responseEntity .getBody ();
139- var shipmentWithoutLink = shipmentList .get (0 );
140- shipmentWithoutLink .setImageLink (null );
141- assertEquals (shipment , shipmentWithoutLink );
142- }
143- }
144-
145- @ Test
146- @ Order (5 )
147112 void testAddShipmentToDynamoDB () throws IOException {
148113
149114 var url = "/api/shipment" ;
@@ -166,7 +131,7 @@ void testAddShipmentToDynamoDB() throws IOException {
166131 }
167132
168133 @ Test
169- @ Order (6 )
134+ @ Order (4 )
170135 void testGetTwoShipmentsFromDynamoDB () {
171136
172137 var url = "/api/shipment" ;
@@ -182,7 +147,7 @@ void testGetTwoShipmentsFromDynamoDB() {
182147 }
183148
184149 @ Test
185- @ Order (7 )
150+ @ Order (5 )
186151 void testDeleteShipmentFromDynamoDB () {
187152
188153 var url = "/api/shipment" ;
0 commit comments