PrivateKeyStorage { public boolean exists(String keyName) { return this.keyStorage.exists(keyName); } PrivateKeyStorage(VirgilPrivateKeyExporter keyExporter, KeyStorage keyStorage); void delete(String keyName); boolean exists(String keyName); Tuple<VirgilPrivateKey, Map<String, String>> load(String keyName); Set<String> names(); void store(VirgilPrivateKey privateKey, String name, Map<String, String> meta);  }
@Test public void exists() throws IOException, CryptoException { when(this.keyStorage.exists(this.keyName)).thenReturn(true); assertTrue(storage.exists(this.keyName)); }
@Test public void exists_nullAlias() { when(this.keyStorage.exists(null)).thenReturn(false); assertFalse(storage.exists(null)); }
@Test public void exists_randomName() { when(this.keyStorage.exists(Mockito.anyString())).thenReturn(false); assertFalse(storage.exists(UUID.randomUUID().toString())); }