1919import static com .github .tomakehurst .wiremock .client .WireMock .anyUrl ;
2020import static com .github .tomakehurst .wiremock .client .WireMock .head ;
2121import static com .github .tomakehurst .wiremock .client .WireMock .stubFor ;
22+ import static org .assertj .core .api .Assertions .assertThat ;
2223import static org .assertj .core .api .Assertions .assertThatThrownBy ;
2324
2425import com .github .tomakehurst .wiremock .junit .WireMockRule ;
@@ -54,9 +55,9 @@ public void headObject503SlowDown_shouldBeThrottlingException() {
5455
5556 assertThatThrownBy (() -> client .headObject (r -> r .bucket ("bucket" ).key ("key" )))
5657 .isInstanceOfSatisfying (S3Exception .class , e -> {
57- assert e .statusCode () == 503 ;
58- assert e .isThrottlingException ();
59- assert "SlowDown" . equals (e .awsErrorDetails ().errorCode ());
58+ assertThat ( e .statusCode ()). isEqualTo ( 503 ) ;
59+ assertThat ( e .isThrottlingException ()). isTrue ();
60+ assertThat (e .awsErrorDetails ().errorCode ()). isEqualTo ( "SlowDown" );
6061 });
6162 }
6263
@@ -66,9 +67,9 @@ public void headBucket503SlowDown_shouldBeThrottlingException() {
6667
6768 assertThatThrownBy (() -> client .headBucket (r -> r .bucket ("bucket" )))
6869 .isInstanceOfSatisfying (S3Exception .class , e -> {
69- assert e .statusCode () == 503 ;
70- assert e .isThrottlingException ();
71- assert "SlowDown" . equals (e .awsErrorDetails ().errorCode ());
70+ assertThat ( e .statusCode ()). isEqualTo ( 503 ) ;
71+ assertThat ( e .isThrottlingException ()). isTrue ();
72+ assertThat (e .awsErrorDetails ().errorCode ()). isEqualTo ( "SlowDown" );
7273 });
7374 }
7475
@@ -78,9 +79,9 @@ public void headObject503OtherException_shouldNotBeThrottlingException() {
7879
7980 assertThatThrownBy (() -> client .headObject (r -> r .bucket ("bucket" ).key ("key" )))
8081 .isInstanceOfSatisfying (S3Exception .class , e -> {
81- assert e .statusCode () == 503 ;
82- assert ! e .isThrottlingException ();
83- assert e .awsErrorDetails ().errorCode () == null ;
82+ assertThat ( e .statusCode ()). isEqualTo ( 503 ) ;
83+ assertThat ( e .isThrottlingException ()). isFalse ();
84+ assertThat ( e .awsErrorDetails ().errorCode ()). isNull () ;
8485 });
8586 }
8687}
0 commit comments