Skip to content

Commit e37a10c

Browse files
committed
Fix assertions
1 parent 4dfe282 commit e37a10c

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/HeadOperationsThrottlingTest.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static com.github.tomakehurst.wiremock.client.WireMock.anyUrl;
2020
import static com.github.tomakehurst.wiremock.client.WireMock.head;
2121
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
22+
import static org.assertj.core.api.Assertions.assertThat;
2223
import static org.assertj.core.api.Assertions.assertThatThrownBy;
2324

2425
import 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

Comments
 (0)