From 9b0c21b584e0548391314bfe24e2c0ba32ed8a8c Mon Sep 17 00:00:00 2001 From: fdai6352 Date: Thu, 17 Feb 2022 00:41:02 +0100 Subject: [PATCH] added credential menu item add credential --- src/main/java/Vault.java | 2 ++ src/test/java/VaultTest.java | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/src/main/java/Vault.java b/src/main/java/Vault.java index 06ea8de..8ac93c6 100644 --- a/src/main/java/Vault.java +++ b/src/main/java/Vault.java @@ -138,6 +138,8 @@ public class Vault implements VaultInterface { if (input.equals("e")) { credentialM = false; + } else if (input.equals("a")) { + println("Type username:"); } } } diff --git a/src/test/java/VaultTest.java b/src/test/java/VaultTest.java index 5400a53..0d61bf7 100644 --- a/src/test/java/VaultTest.java +++ b/src/test/java/VaultTest.java @@ -44,6 +44,15 @@ public class VaultTest { 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 void addCredentialTest() { vlt.addCredential();}