Skip to content

Commit 6184b25

Browse files
committed
chore: fix up deprecated method
1 parent 1c43a27 commit 6184b25

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ In `consumer/src/test/java/au/com/dius/pactworkshop/consumer/ProductConsumerPact
545545

546546
HttpClientErrorException e = assertThrows(HttpClientErrorException.class,
547547
() -> new ProductService(restTemplate).getProduct("11"));
548-
assertEquals(404, e.getRawStatusCode());
548+
assertEquals(404, e.getStatusCode().value());
549549
}
550550
```
551551

@@ -818,7 +818,7 @@ public class ProductConsumerPactTest {
818818

819819
HttpClientErrorException e = assertThrows(HttpClientErrorException.class,
820820
() -> new ProductService(restTemplate).getAllProducts());
821-
assertEquals(401, e.getRawStatusCode());
821+
assertEquals(401, e.getStatusCode().value());
822822
}
823823

824824
@Test
@@ -846,7 +846,7 @@ public class ProductConsumerPactTest {
846846

847847
HttpClientErrorException e = assertThrows(HttpClientErrorException.class,
848848
() -> new ProductService(restTemplate).getProduct("11"));
849-
assertEquals(404, e.getRawStatusCode());
849+
assertEquals(404, e.getStatusCode().value());
850850
}
851851

852852
@Test
@@ -858,7 +858,7 @@ public class ProductConsumerPactTest {
858858

859859
HttpClientErrorException e = assertThrows(HttpClientErrorException.class,
860860
() -> new ProductService(restTemplate).getProduct("10"));
861-
assertEquals(401, e.getRawStatusCode());
861+
assertEquals(401, e.getStatusCode().value());
862862
}
863863

864864
private Map<String, String> headers() {

consumer/src/test/java/au/com/dius/pactworkshop/consumer/ProductConsumerPactTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void getAllProducts_whenNoAuth(MockServer mockServer) {
149149

150150
HttpClientErrorException e = assertThrows(HttpClientErrorException.class,
151151
() -> new ProductService(restTemplate).getAllProducts());
152-
assertEquals(401, e.getRawStatusCode());
152+
assertEquals(401, e.getStatusCode().value());
153153
}
154154

155155
@Test
@@ -177,7 +177,7 @@ void getProductById_whenProductWithId11DoesNotExist(MockServer mockServer) {
177177

178178
HttpClientErrorException e = assertThrows(HttpClientErrorException.class,
179179
() -> new ProductService(restTemplate).getProduct("11"));
180-
assertEquals(404, e.getRawStatusCode());
180+
assertEquals(404, e.getStatusCode().value());
181181
}
182182

183183
@Test
@@ -189,7 +189,7 @@ void getProductById_whenNoAuth(MockServer mockServer) {
189189

190190
HttpClientErrorException e = assertThrows(HttpClientErrorException.class,
191191
() -> new ProductService(restTemplate).getProduct("10"));
192-
assertEquals(401, e.getRawStatusCode());
192+
assertEquals(401, e.getStatusCode().value());
193193
}
194194

195195
private Map<String, String> headers() {

0 commit comments

Comments
 (0)