From 1d4ec73c193a16e72140617b12d1bd0e558671ac Mon Sep 17 00:00:00 2001 From: fdai6352 Date: Thu, 17 Feb 2022 00:23:09 +0100 Subject: [PATCH] added credential menu exit --- src/main/java/Vault.java | 1 + src/test/java/VaultTest.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/Vault.java b/src/main/java/Vault.java index c983547..463ea5d 100644 --- a/src/main/java/Vault.java +++ b/src/main/java/Vault.java @@ -12,6 +12,7 @@ public class Vault implements VaultInterface { public boolean hasSpecialChars; public boolean hasNumbers; public String userName; + public boolean credentialM; InputStream inputS = System.in; OutputStream outputS = System.out; diff --git a/src/test/java/VaultTest.java b/src/test/java/VaultTest.java index 37be30d..738afef 100644 --- a/src/test/java/VaultTest.java +++ b/src/test/java/VaultTest.java @@ -35,6 +35,13 @@ public class VaultTest { assertTrue(outputStream.toString().startsWith("Configure")); } + @Test + void exitConfigureMenu(){ + vlt.inputS = new ByteArrayInputStream("e".getBytes(StandardCharsets.UTF_8)); + vlt.credentialMenu(); + assertFalse(vlt.credentialM); + } + @Test void addCredentialTest() { vlt.addCredential();}