mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix test credentials with empty username - KeePass
This commit is contained in:
@@ -64,7 +64,7 @@ class PasswordSafeImpl @JvmOverloads constructor(val settings: PasswordSafeSetti
|
||||
|
||||
override fun set(attributes: CredentialAttributes, credentials: Credentials?) {
|
||||
currentProvider.set(attributes, credentials)
|
||||
if (attributes.isPasswordMemoryOnly && credentials.isFulfilled()) {
|
||||
if (attributes.isPasswordMemoryOnly && !credentials?.password.isNullOrEmpty()) {
|
||||
// we must store because otherwise on get will be no password
|
||||
memoryHelperProvider.value.set(attributes.toPasswordStoreable(), credentials)
|
||||
}
|
||||
|
||||
@@ -19,5 +19,5 @@ import org.junit.runner.RunWith
|
||||
import org.junit.runners.Suite
|
||||
|
||||
@RunWith(Suite::class)
|
||||
@Suite.SuiteClasses(FileCredentialStoreTest::class, CredentialSerializeTest::class, CredentialStoreTest::class, MasterPasswordMigrationTest::class)
|
||||
@Suite.SuiteClasses(FileCredentialStoreTest::class, CredentialSerializeTest::class, CredentialStoreTest::class, PasswordSafeTest::class, MasterPasswordMigrationTest::class)
|
||||
internal class CredentialStoreTestSuite
|
||||
@@ -150,8 +150,7 @@ class PasswordSafeTest {
|
||||
val ps = PasswordSafeImpl(settings, KeePassCredentialStore(baseDirectory = tempDirManager.newPath()))
|
||||
|
||||
val id = "test PasswordSafeTest.credentials with empty username"
|
||||
val attributes = CredentialAttributes(id, null, null, true)
|
||||
|
||||
val attributes = CredentialAttributes(id, isPasswordMemoryOnly = true)
|
||||
try {
|
||||
val credentials = Credentials(null, "passphrase")
|
||||
ps.set(attributes, credentials)
|
||||
|
||||
Reference in New Issue
Block a user