Browse Source

added credential menu item show credential

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

2
src/main/java/Vault.java

@ -140,6 +140,8 @@ public class Vault implements VaultInterface {
credentialM = false;
} else if (input.equals("a")) {
println("Type username:");
} else if (input.equals("c")) {
println("Type username or ID to show credential:");
}
}
}

9
src/test/java/VaultTest.java

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

Loading…
Cancel
Save