OrientKeyStoreStorage extends ComponentSupport implements KeyStoreStorage { @Override public boolean exists() { return storageManager.load(keyStoreName) != null; } OrientKeyStoreStorage(final OrientKeyStoreStorageManager storageManager, final String keyStoreName); @VisibleForTesting String getKeyStoreName(); @Override boolean exists(); @Override boolean modified(); @Subscribe void onKeyStoreDataUpdated(final KeyStoreDataEvent event); @Override void load(final KeyStore keyStore, final char[] password); @Override void save(final KeyStore keyStore, final char[] password); @Override String toString();  }
@Test public void testExists() { assertThat(storage.exists(), is(false)); when(storageManager.load(KEY_STORE_NAME)).thenReturn(new OrientKeyStoreData()); assertThat(storage.exists(), is(true)); }