Browse Source

added credential menu item add credential

feature-vault
fdai6352 3 years ago
parent
commit
9b0c21b584
  1. 2
      src/main/java/Vault.java
  2. 9
      src/test/java/VaultTest.java

2
src/main/java/Vault.java

@ -138,6 +138,8 @@ public class Vault implements VaultInterface {
if (input.equals("e")) { if (input.equals("e")) {
credentialM = false; credentialM = false;
} else if (input.equals("a")) {
println("Type username:");
} }
} }
} }

9
src/test/java/VaultTest.java

@ -44,6 +44,15 @@ public class VaultTest {
assertFalse(vlt.credentialM); assertFalse(vlt.credentialM);
} }
@Test
void openAddCredentialMenuItem() {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
vlt.inputS = new ByteArrayInputStream("a".getBytes(StandardCharsets.UTF_8));
vlt.outputS = outputStream;
vlt.credentialMenu();
assertTrue(outputStream.toString().contains("Type"));
}
@Test @Test
void addCredentialTest() { vlt.addCredential();} void addCredentialTest() { vlt.addCredential();}

Loading…
Cancel
Save