Created
August 23, 2022 15:34
-
-
Save aqua30/a52110e252ee64814a3bbd231d8f8698 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun `for user id not available, api must return with http code 404 and null user object`() = runTest { | |
val expectedResponse = MockResponse() | |
.setResponseCode(HttpURLConnection.HTTP_NOT_FOUND) | |
mockWebServer.enqueue(expectedResponse) | |
val actualResponse = repository.getUserById(1) | |
assertThat(actualResponse.httpCode).isEqualTo(HttpURLConnection.HTTP_NOT_FOUND) | |
assertThat(actualResponse.body).isNull() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment