Browse Source

added vault configure menu wrong input message

feature-vault
fdai6352 3 years ago
parent
commit
6b1d22f773
  1. 2
      src/main/java/Vault.java
  2. 10
      src/test/java/VaultTest.java

2
src/main/java/Vault.java

@ -39,6 +39,8 @@ public class Vault implements VaultInterface {
if (input.equals("e")) {
config = false;
}else if (!input.equals("l")|!input.equals("l")|!input.equals("l")) {
println("Please enter valid key.");
}
}

10
src/test/java/VaultTest.java

@ -79,6 +79,16 @@ public class VaultTest {
assertTrue(outputStream.toString().startsWith("Configure:"));
}
@Test
void configureMenuWrongInputMessage() {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
vlt.inputS = new ByteArrayInputStream("__\n".getBytes(StandardCharsets.UTF_8));
vlt.outputS = outputStream;
vlt.configure();
assertTrue(outputStream.toString().contains("Please"));
}
@Test
void openSetPWLength() {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

Loading…
Cancel
Save