@Test public void convertKeyPairWithNewlineOrSpace() { final DirectKeyPair keyPair = new DirectKeyPair("gybY1t9GOYiuN6QgwcrvM2+pQzIu4UrHwiMG7yKQnTg=\n", " yTjqANGAvPCy8AfhcIZ+e4O8CHZPbHkIeOmae5W3srY=\n\n\n"); Collection<KeyPair> result = converter.convert(Collections.singletonList(keyPair)); KeyPair expected = new KeyPair( PublicKey.from(decodeBase64("gybY1t9GOYiuN6QgwcrvM2+pQzIu4UrHwiMG7yKQnTg=")), PrivateKey.from(decodeBase64("yTjqANGAvPCy8AfhcIZ+e4O8CHZPbHkIeOmae5W3srY="))); 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);  }