Issue#30 Add additional Test for missing field and exact copy of how the CodeKataLoginRemoteSourceTest should look
This commit is contained in:
parent
49d1fb822f
commit
7544c6b784
7 changed files with 206 additions and 12 deletions
|
|
@ -38,6 +38,7 @@ internal class ScenarioToRequestScenario {
|
|||
is AuthScenario.Success -> CreateAuthSuccessResponse()
|
||||
is AuthScenario.MalformedJsonAsSuccessResponse -> CreateMalformedJsonSuccessResponse()
|
||||
is AuthScenario.UnexpectedJsonAsSuccessResponse -> CreateGenericSuccessResponseByJson("[]")
|
||||
is AuthScenario.MissingFieldJson -> CreateGenericSuccessResponseByJson("{}")
|
||||
}
|
||||
val requestMatchingChecker = AuthRequestMatchingChecker(authScenario, validateArguments)
|
||||
return SpecificRequestScenario(requestMatchingChecker, createResponse)
|
||||
|
|
|
|||
|
|
@ -12,4 +12,5 @@ sealed class AuthScenario : GenericScenario<AuthScenario>() {
|
|||
class GenericError(override val username: String, override val password: String) : AuthScenario()
|
||||
class UnexpectedJsonAsSuccessResponse(override val username: String, override val password: String) : AuthScenario()
|
||||
class MalformedJsonAsSuccessResponse(override val username: String, override val password: String) : AuthScenario()
|
||||
class MissingFieldJson(override val username: String, override val password: String) : AuthScenario()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ package org.fnives.test.showcase.network.mockserver.scenario.createresponse
|
|||
import okhttp3.mockwebserver.MockResponse
|
||||
|
||||
internal class CreateMalformedJsonSuccessResponse : CreateResponse {
|
||||
override fun getResponse(): MockResponse = MockResponse().setResponseCode(200).setBody("[")
|
||||
override fun getResponse(): MockResponse = MockResponse().setResponseCode(200).setBody("{")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue