Test for WI-33778 Save passphrase checkbox doesn't reflect the actual state

This commit is contained in:
Shaverdova Elena
2016-11-02 16:25:58 +01:00
parent 7ef3dca04a
commit b5299dbddb
@@ -140,5 +140,25 @@ class PasswordSafeTest {
assertThat.isEqualTo(newCredentials.password)
}
}
@Test
fun `credentials with empty username`() {
if (UsefulTestCase.IS_UNDER_TEAMCITY) {
return
}
val settings = PasswordSafeSettings()
settings.providerType = ProviderType.KEYCHAIN
val ps = PasswordSafeImpl(settings, KeyChainCredentialStore())
val id = "test PasswordSafeTest.credentials with empty username"
val attributes = CredentialAttributes(id, null, null, true)
val credentials = Credentials(null, "passphrase")
ps.set(attributes, credentials)
val saved = ps.get(attributes)!!
assertThat(saved.password).isEqualTo(credentials.password)
assertThat(saved.userName).isNullOrEmpty()
}
}