http-client-tck
Provides a standardized way of verifying the expected behavior of an HttpClient implementation.
To use the TCK simply create a test that calls the verify function:
package myhttpclient
import io.v47.tmdb.http.tck.HttpClientTck
import io.v47.tmdb.http.tck.TckResult
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class MyHttpClientTckTest {
@Test
fun executeTckTest() {
val result = HttpClientTck().verify(MyAwesomeHttpClientFactoryImpl())
if (result is TckResult.Failure)
result.failedTests.forEach { failedTest ->
Assertions.assertEquals(
failedTest.expectedValue,
failedTest.actualValue,
"Test ${failedTest.name} failed"
)
}
}
}
Content copied to clipboard
Please keep in mind you need to provide a valid TMDb API key using the system property tmdb.apiKey
or the environment variable API_KEY
.