Browse Source

implemented show credential via name functionality

feature-vault
fdai6352 3 years ago
parent
commit
18f4cc93f9
  1. 3
      src/main/java/Vault.java
  2. 7
      src/test/java/VaultTest.java

3
src/main/java/Vault.java

@ -94,6 +94,9 @@ public class Vault implements VaultInterface {
if(str.matches("[0-9]+")) {
isInt = true;
//getCredentialsViaId(Integer.parseInt(str));
} else {
isInt = false;
//getCredentialsViaName(str);
}
}

7
src/test/java/VaultTest.java

@ -93,6 +93,13 @@ public class VaultTest {
assertTrue(outputStream.toString().contains("Type"));
assertTrue(vlt.isInt);
vlt.outputS = outputStream;
vlt.inputS = new ByteArrayInputStream("peter".getBytes(StandardCharsets.UTF_8));
vlt.showCredential();
assertTrue(outputStream.toString().contains("Type"));
assertFalse(vlt.isInt);
}
@Test

Loading…
Cancel
Save