Added checked exception to keychain api and reworked the way we attempt to access the gnome keyring.

(references #947)
This commit is contained in:
Sebastian Stenzel
2019-08-12 16:08:20 +02:00
parent 54c5f9b041
commit d4c14ffb74
13 changed files with 167 additions and 152 deletions
@@ -13,7 +13,7 @@ import java.util.Optional;
public class KeychainModuleTest {
@Test
public void testGetKeychain() {
public void testGetKeychain() throws KeychainAccessException {
Optional<KeychainAccess> keychainAccess = DaggerTestKeychainComponent.builder().keychainModule(new TestKeychainModule()).build().keychainAccess();
Assertions.assertTrue(keychainAccess.isPresent());
Assertions.assertTrue(keychainAccess.get() instanceof MapKeychainAccess);
@@ -10,7 +10,7 @@ import java.util.Set;
public class TestKeychainModule extends KeychainModule {
@Override
Set<KeychainAccessStrategy> provideKeychainAccessStrategies(MacSystemKeychainAccess macKeychain, WindowsProtectedKeychainAccess winKeychain, LinuxSecretServiceAccess linKeychain) {
Set<KeychainAccessStrategy> provideKeychainAccessStrategies(MacSystemKeychainAccess macKeychain, WindowsProtectedKeychainAccess winKeychain, LinuxSecretServiceKeychainAccess linKeychain) {
return Set.of(new MapKeychainAccess());
}