本文整理了Java中com.github.robozonky.cli.ZonkyPasswordFeature.<init>()
方法的一些代码示例,展示了ZonkyPasswordFeature.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZonkyPasswordFeature.<init>()
方法的具体详情如下:
包路径:com.github.robozonky.cli.ZonkyPasswordFeature
类名称:ZonkyPasswordFeature
方法名:<init>
暂无
代码示例来源:origin: RoboZonky/robozonky
private static void primeKeyStore(final char... keystorePassword) throws SetupFailedException, IOException {
final String username = Variables.ZONKY_USERNAME.getValue(DATA);
final char[] password = Variables.ZONKY_PASSWORD.getValue(DATA).toCharArray();
Files.deleteIfExists(KEYSTORE_FILE.toPath()); // re-install into the same directory otherwise fails
final Feature f = new ZonkyPasswordFeature(KEYSTORE_FILE, keystorePassword, username, password);
f.setup();
}
代码示例来源:origin: com.github.robozonky/robozonky-installer
private static void primeKeyStore(final char... keystorePassword) throws SetupFailedException, IOException {
final String username = Variables.ZONKY_USERNAME.getValue(DATA);
final char[] password = Variables.ZONKY_PASSWORD.getValue(DATA).toCharArray();
Files.deleteIfExists(KEYSTORE_FILE.toPath()); // re-install into the same directory otherwise fails
final Feature f = new ZonkyPasswordFeature(KEYSTORE_FILE, keystorePassword, username, password);
f.setup();
}
代码示例来源:origin: RoboZonky/robozonky
@Test
void standaloneTestFails() throws IOException {
final File f = newTempFile();
final String username = "someone@somewhere.cz";
final String pwd = UUID.randomUUID().toString();
final ApiProvider api = mockApi(username, pwd.toCharArray());
final Feature feature = new ZonkyPasswordFeature(api, f, KEYSTORE_PASSWORD.toCharArray(), username,
pwd.toCharArray());
assertThatThrownBy(feature::test).isInstanceOf(TestFailedException.class); // no keystore exists
}
}
代码示例来源:origin: RoboZonky/robozonky
@Test
void testFailsRemotely() throws IOException, SetupFailedException {
final File f = newTempFile();
final String username = "someone@somewhere.cz";
final String pwd = UUID.randomUUID().toString();
final ApiProvider api = mockFailingApi();
final Feature feature = new ZonkyPasswordFeature(api, f, KEYSTORE_PASSWORD.toCharArray(), username,
pwd.toCharArray());
feature.setup();
assertThatThrownBy(feature::test).isInstanceOf(TestFailedException.class); // remote failure caught
}
代码示例来源:origin: RoboZonky/robozonky
@SuppressWarnings("unchecked")
@Test
void testWorks() throws IOException, TestFailedException, SetupFailedException {
final File f = newTempFile();
final String username = "someone@somewhere.cz";
final String pwd = UUID.randomUUID().toString();
final ApiProvider api = mockApi(username, pwd.toCharArray());
final Feature feature = new ZonkyPasswordFeature(api, f, KEYSTORE_PASSWORD.toCharArray(), username,
pwd.toCharArray());
feature.setup();
feature.test();
verify(api).oauth(any());
verify(api).run(any(Consumer.class), any());
}
代码示例来源:origin: RoboZonky/robozonky
@Test
void createNew() throws IOException, SetupFailedException, KeyStoreException {
final File f = newTempFile();
final String username = "someone@somewhere.cz";
final String pwd = UUID.randomUUID().toString();
final Feature feature = new ZonkyPasswordFeature(f, KEYSTORE_PASSWORD.toCharArray(), username,
pwd.toCharArray());
feature.setup();
final SecretProvider s = SecretProvider.keyStoreBased(KeyStoreHandler.open(f, KEYSTORE_PASSWORD.toCharArray()));
assertSoftly(softly -> {
softly.assertThat(s.getUsername()).isEqualTo(username);
softly.assertThat(s.getPassword()).isEqualTo(pwd.toCharArray());
});
}
内容来源于网络,如有侵权,请联系作者删除!