|
|
@ -41,18 +41,15 @@ public class VaultTest { |
|
|
|
assertFalse(vlt.credentialM); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
/* @Test |
|
|
|
void openAddCredentialMenuItem() { |
|
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
|
vlt.inputS = new ByteArrayInputStream("a\npeter\npassword".getBytes(StandardCharsets.UTF_8)); |
|
|
|
vlt.inputS = new ByteArrayInputStream("a".getBytes(StandardCharsets.UTF_8)); |
|
|
|
vlt.outputS = outputStream; |
|
|
|
vlt.credentialMenu(); |
|
|
|
|
|
|
|
assertTrue(outputStream.toString().contains("username")); |
|
|
|
assertEquals("peter", vlt.userName); |
|
|
|
assertTrue(outputStream.toString().contains("password")); |
|
|
|
assertEquals("password",vlt.password); |
|
|
|
} |
|
|
|
assertTrue(outputStream.toString().contains("Add")); |
|
|
|
}*/ |
|
|
|
|
|
|
|
@Test |
|
|
|
void openShowCredentialMenuItem() { |
|
|
@ -80,7 +77,7 @@ public class VaultTest { |
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
/*@Test |
|
|
|
@Test |
|
|
|
void addCredentialTest() { |
|
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
|
vlt.outputS = outputStream; |
|
|
@ -93,12 +90,12 @@ public class VaultTest { |
|
|
|
assertEquals("password",vlt.password); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
/* @Test |
|
|
|
void showCredentialTest() { |
|
|
|
vlt.inputS = new ByteArrayInputStream("l\n1".getBytes(StandardCharsets.UTF_8)); |
|
|
|
vlt.credentialMenu(); |
|
|
|
vlt.showCredential();credential(); |
|
|
|
|
|
|
|
assertTrue(vlt.isInt); |
|
|
|
assertTrue(outputStream.toString().contains("username")); |
|
|
|
|
|
|
|
vlt.inputS = new ByteArrayInputStream("l\npeter".getBytes(StandardCharsets.UTF_8)); |
|
|
|
vlt.credentialMenu(); |
|
|
|