Skip to content

Commit

Permalink
Remove 304 from statuses list.
Browse files Browse the repository at this point in the history
  • Loading branch information
nstdio committed Dec 25, 2022
1 parent aa6b2f7 commit 9497fe9
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import io.kotest.property.arbitrary.string
import mockwebserver3.MockResponse
import mockwebserver3.MockWebServer
import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.ThrowingConsumer
import org.awaitility.core.ThrowingRunnable
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -148,7 +147,7 @@ interface ExtendedHttpClientContract {
}

@ParameterizedTest
@ValueSource(ints = [201, 202, 205, 207, 226, 302, 303, 304, 305, 306, 307, 308, 400, 401, 402, 403, 406, 407, 408, 409, 411, 412, 413, 415, 416, 417, 418, 421, 422, 423, 424, 425, 426, 428, 429, 431, 451, 500, 502, 503, 504, 505, 506, 507, 508, 510, 511])
@ValueSource(ints = [201, 202, 205, 207, 226, 302, 303, 305, 306, 307, 308, 400, 401, 402, 403, 406, 407, 408, 409, 411, 412, 413, 415, 416, 417, 418, 421, 422, 423, 424, 425, 426, 428, 429, 431, 451, 500, 502, 503, 504, 505, 506, 507, 508, 510, 511])
fun shouldNotCacheStatusCodesOtherThen(statusCode: Int) {
//given
val body = "abc"
Expand All @@ -165,10 +164,9 @@ interface ExtendedHttpClientContract {
val r2 = send(requestBuilder().build())

//then
assertThat(listOf(r1, r2)).allSatisfy(
ThrowingConsumer { r: HttpResponse<String> ->
assertThat(r).isNotCached.hasStatusCode(statusCode)
})
assertThat(listOf(r1, r2)).allSatisfy {
assertThat(it).isNotCached.hasStatusCode(statusCode)
}
}

@Test
Expand Down

0 comments on commit 9497fe9

Please sign in to comment.