Fixing missing code snippet and wrong DisplayName

This commit is contained in:
Gergely Hegedus 2022-04-10 14:20:51 +03:00
parent 8866ac8477
commit 3ec4d8147b
3 changed files with 15 additions and 2 deletions

View file

@ -249,6 +249,18 @@ fun networkInputError(authScenario: AuthScenario) = runTest {
Assertions.assertEquals(null, fakeUserDataLocalStorage.session) Assertions.assertEquals(null, fakeUserDataLocalStorage.session)
verifyZeroInteractions(mockSessionExpirationListener) verifyZeroInteractions(mockSessionExpirationListener)
} }
//...
companion object {
//...
@JvmStatic
fun networkErrorArguments() = Stream.of(
Arguments.of(AuthScenario.GenericError(username = "a", password = "b")),
Arguments.of(AuthScenario.UnexpectedJsonAsSuccessResponse(username = "a", password = "b")),
Arguments.of(AuthScenario.MalformedJsonAsSuccessResponse(username = "a", password = "b")),
Arguments.of(AuthScenario.MissingFieldJson(username = "a", password = "b"))
)
}
``` ```
### 5. `loginInvalidCredentials` ### 5. `loginInvalidCredentials`

View file

@ -130,7 +130,7 @@ class AuthIntegrationTest : KoinTest {
verifyZeroInteractions(mockSessionExpirationListener) verifyZeroInteractions(mockSessionExpirationListener)
} }
@DisplayName("GIVEN no session WHEN user is logging in THEN they get session") @DisplayName("GIVEN invalid credentials response WHEN user is logging in THEN they get proper error")
@Test @Test
fun loginInvalidCredentials() = runTest { fun loginInvalidCredentials() = runTest {
mockServerScenarioSetup.setScenario(AuthScenario.InvalidCredentials(username = "usr", password = "sEc"), validateArguments = true) mockServerScenarioSetup.setScenario(AuthScenario.InvalidCredentials(username = "usr", password = "sEc"), validateArguments = true)

View file

@ -85,7 +85,7 @@ class CodeKataAuthIntegrationTest : KoinTest {
fun networkInputError(authScenario: AuthScenario) = runTest { fun networkInputError(authScenario: AuthScenario) = runTest {
} }
@DisplayName("GIVEN no session WHEN user is logging in THEN they get session") @DisplayName("GIVEN invalid credentials response WHEN user is logging in THEN they get proper error")
@Test @Test
fun loginInvalidCredentials() = runTest { fun loginInvalidCredentials() = runTest {
} }
@ -94,6 +94,7 @@ class CodeKataAuthIntegrationTest : KoinTest {
@Test @Test
fun logout() = runTest { fun logout() = runTest {
} }
@DisplayName("GIVEN logged in user WHEN user is login out THEN content is cleared") @DisplayName("GIVEN logged in user WHEN user is login out THEN content is cleared")
@Test @Test
fun logoutReleasesContent() = runTest { fun logoutReleasesContent() = runTest {