gpt4 book ai didi

com.github.robozonky.cli.ZonkyPasswordFeature.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 08:04:31 25 4
gpt4 key购买 nike

本文整理了Java中com.github.robozonky.cli.ZonkyPasswordFeature.<init>()方法的一些代码示例,展示了ZonkyPasswordFeature.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZonkyPasswordFeature.<init>()方法的具体详情如下:
包路径:com.github.robozonky.cli.ZonkyPasswordFeature
类名称:ZonkyPasswordFeature
方法名:<init>

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());
  });
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com