Browse Source

added credential menu

feature-vault
fdai6352 3 years ago
parent
commit
317d500f50
  1. 11
      src/main/java/Vault.java
  2. 8
      src/test/java/VaultTest.java

11
src/main/java/Vault.java

@ -120,4 +120,15 @@ public class Vault implements VaultInterface {
println("Your PWs don´t have numbers anymore.");
}
}
public void credentialMenu() {
StringBuilder sbcm = new StringBuilder();
sbcm.append("Configure credentials:\n");
sbcm.append("- add credential: a\n");
sbcm.append("- show credential: c\n");
sbcm.append("- exit: e\n");
println(sbcm.toString());
}
}

8
src/test/java/VaultTest.java

@ -27,6 +27,14 @@ public class VaultTest {
vlt.inputS = System.in;
}
@Test
void openCredentialMenu() {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
vlt.outputS = outputStream;
vlt.credentialMenu();
assertTrue(outputStream.toString().startsWith("Configure"));
}
@Test
void addCredentialTest() { vlt.addCredential();}

Loading…
Cancel
Save