@ -38,6 +38,9 @@ public class PasswordManager implements PasswordManagerInterface {
@Override
public void listVaults() {
println("Vaults:");
for (int i = 0; i < vaults.size(); i++) {
println("- vault id: " + i);
}
public void createNewVault() {
@ -46,7 +46,8 @@ class PasswordManagerTest {
pm.inputStream = new ByteArrayInputStream("l\n".getBytes(StandardCharsets.UTF_8));
pm.outputStream = outputStream;
pm.showMenu();
assertTrue(outputStream.toString().endsWith("Vaults:\n"));
pm.createNewVault();
assertTrue(outputStream.toString().contains("Vaults:\n- vault id: 0\n"));
@Test