@Test public void testReadFromConsole() { ByteArrayInputStream in = new ByteArrayInputStream("password".getBytes()); System.setIn(in); assertThat(ConfigSecretReader.readSecretFromConsole()).isEqualTo("password".toCharArray()); System.setIn(System.in); assertThat(ConfigSecretReader.readSecretFromConsole()).isEqualTo("".toCharArray()); }
public static char[] readSecretFromConsole() { SystemAdapter.INSTANCE.out().println("Please enter the secret/password used to decrypt config value"); return PasswordReaderFactory.create().readPasswordFromConsole(); }
ConfigSecretReader { public static char[] readSecretFromConsole() { SystemAdapter.INSTANCE.out().println("Please enter the secret/password used to decrypt config value"); return PasswordReaderFactory.create().readPasswordFromConsole(); } }
ConfigSecretReader { public static char[] readSecretFromConsole() { SystemAdapter.INSTANCE.out().println("Please enter the secret/password used to decrypt config value"); return PasswordReaderFactory.create().readPasswordFromConsole(); } private  ConfigSecretReader(); }
ConfigSecretReader { public static char[] readSecretFromConsole() { SystemAdapter.INSTANCE.out().println("Please enter the secret/password used to decrypt config value"); return PasswordReaderFactory.create().readPasswordFromConsole(); } private  ConfigSecretReader(); static Optional<char[]> readSecretFromFile(); static char[] readSecretFromConsole(); }
ConfigSecretReader { public static char[] readSecretFromConsole() { SystemAdapter.INSTANCE.out().println("Please enter the secret/password used to decrypt config value"); return PasswordReaderFactory.create().readPasswordFromConsole(); } private  ConfigSecretReader(); static Optional<char[]> readSecretFromFile(); static char[] readSecretFromConsole();  }