use of com.amaze.filemanager.database.UtilitiesDatabase in project AmazeFileManager by TeamAmaze.
the class ShadowCryptUtilTest method testWithUtilsHandler.
@Test
public void testWithUtilsHandler() {
UtilitiesDatabase utilitiesDatabase = UtilitiesDatabase.initialize(ApplicationProvider.getApplicationContext());
UtilsHandler utilsHandler = new UtilsHandler(ApplicationProvider.getApplicationContext(), utilitiesDatabase);
String fingerprint = "00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff";
String url = "ssh://test:test@127.0.0.1:22";
utilsHandler.saveToDatabase(new OperationData(UtilsHandler.Operation.SFTP, SshClientUtils.encryptSshPathAsNecessary(url), "Test", fingerprint, null, null));
await().atMost(10, TimeUnit.SECONDS).until(() -> {
assertEquals(fingerprint, utilsHandler.getSshHostKey(SshClientUtils.encryptSshPathAsNecessary(url)));
utilitiesDatabase.close();
return true;
});
}
Aggregations