@Test public void convertSingleFilesystemKeyPair() { final FilesystemKeyPair keyPair = mock(FilesystemKeyPair.class); when(keyPair.getPublicKey()).thenReturn("public"); when(keyPair.getPrivateKey()).thenReturn("private"); Collection<KeyPair> result = converter.convert(Collections.singletonList(keyPair)); assertThat(result).hasSize(1); KeyPair expected = new KeyPair(PublicKey.from(decodeBase64("public")), PrivateKey.from(decodeBase64("private"))); KeyPair resultKeyPair = result.iterator().next(); assertThat(resultKeyPair).isEqualToComparingFieldByField(expected); }
public Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs) { return configKeyPairs .stream() .map(this::convert) .collect(Collectors.toList()); }
KeyPairConverter { public Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs) { return configKeyPairs .stream() .map(this::convert) .collect(Collectors.toList()); } }
KeyPairConverter { public Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs) { return configKeyPairs .stream() .map(this::convert) .collect(Collectors.toList()); } KeyPairConverter(Config config, EnvironmentVariableProvider envProvider); }
KeyPairConverter { public Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs) { return configKeyPairs .stream() .map(this::convert) .collect(Collectors.toList()); } KeyPairConverter(Config config, EnvironmentVariableProvider envProvider); Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs); List<PublicKey> convert(List<String> values); }
KeyPairConverter { public Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs) { return configKeyPairs .stream() .map(this::convert) .collect(Collectors.toList()); } KeyPairConverter(Config config, EnvironmentVariableProvider envProvider); Collection<KeyPair> convert(Collection<ConfigKeyPair> configKeyPairs); List<PublicKey> convert(List<String> values);  }