use of com.quorum.tessera.config.keypairs.FilesystemKeyPair in project tessera by ConsenSys.
the class FileKeyGeneratorTest method providingNoPathSavesToFileInSameDirectory.
@Test
public void providingNoPathSavesToFileInSameDirectory() throws IOException {
Files.deleteIfExists(Paths.get(".pub"));
Files.deleteIfExists(Paths.get(".key"));
doReturn(keyPair).when(encryptor).generateNewKeys();
final FilesystemKeyPair generated = generator.generate("", null, null);
assertThat(Files.exists(Paths.get(".pub"))).isTrue();
assertThat(Files.exists(Paths.get(".key"))).isTrue();
verify(encryptor).generateNewKeys();
Files.deleteIfExists(Paths.get(".pub"));
Files.deleteIfExists(Paths.get(".key"));
}
Aggregations