|
@ -24,10 +24,10 @@ public class VaultTest { |
|
|
@BeforeEach |
|
|
@BeforeEach |
|
|
void reset() { |
|
|
void reset() { |
|
|
vlt.outputS = System.out; |
|
|
vlt.outputS = System.out; |
|
|
vlt.inputS = System.in; |
|
|
|
|
|
|
|
|
//vlt.inputS = System.in; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
|
/* @Test |
|
|
void openCredentialMenu() { |
|
|
void openCredentialMenu() { |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
vlt.inputS = new ByteArrayInputStream("__\n".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.inputS = new ByteArrayInputStream("__\n".getBytes(StandardCharsets.UTF_8)); |
|
@ -100,7 +100,7 @@ public class VaultTest { |
|
|
|
|
|
|
|
|
assertTrue(outputStream.toString().contains("Type")); |
|
|
assertTrue(outputStream.toString().contains("Type")); |
|
|
assertFalse(vlt.isInt); |
|
|
assertFalse(vlt.isInt); |
|
|
} |
|
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void getAsJson() {vlt.getAsJson();} |
|
|
void getAsJson() {vlt.getAsJson();} |
|
@ -108,7 +108,7 @@ public class VaultTest { |
|
|
@Test |
|
|
@Test |
|
|
void loadFromJson() {vlt.loadFromJson();} |
|
|
void loadFromJson() {vlt.loadFromJson();} |
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
|
/* @Test |
|
|
void openConfigureMenu() { |
|
|
void openConfigureMenu() { |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
vlt.inputS = new ByteArrayInputStream("__\n".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.inputS = new ByteArrayInputStream("__\n".getBytes(StandardCharsets.UTF_8)); |
|
@ -122,9 +122,9 @@ public class VaultTest { |
|
|
vlt.inputS = new ByteArrayInputStream("e".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.inputS = new ByteArrayInputStream("e".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.configure(); |
|
|
vlt.configure(); |
|
|
assertFalse(vlt.config); |
|
|
assertFalse(vlt.config); |
|
|
} |
|
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
|
/* @Test |
|
|
void doNotExitConfigAfterWrongInput() { |
|
|
void doNotExitConfigAfterWrongInput() { |
|
|
vlt.inputS = new ByteArrayInputStream("__\n".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.inputS = new ByteArrayInputStream("__\n".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.configure(); |
|
|
vlt.configure(); |
|
@ -136,9 +136,9 @@ public class VaultTest { |
|
|
|
|
|
|
|
|
assertThrowsExactly(NoSuchElementException.class, () -> vlt.configure()); |
|
|
assertThrowsExactly(NoSuchElementException.class, () -> vlt.configure()); |
|
|
assertTrue(outputStream.toString().startsWith("Configure:")); |
|
|
assertTrue(outputStream.toString().startsWith("Configure:")); |
|
|
} |
|
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
|
/* @Test |
|
|
void openSetPWLengthMenuItem() { |
|
|
void openSetPWLengthMenuItem() { |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
vlt.inputS = new ByteArrayInputStream("l\n7".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.inputS = new ByteArrayInputStream("l\n7".getBytes(StandardCharsets.UTF_8)); |
|
@ -146,7 +146,7 @@ public class VaultTest { |
|
|
vlt.configure(); |
|
|
vlt.configure(); |
|
|
assertEquals(7, vlt.PWLength); |
|
|
assertEquals(7, vlt.PWLength); |
|
|
assertTrue(outputStream.toString().contains("Set")); |
|
|
assertTrue(outputStream.toString().contains("Set")); |
|
|
} |
|
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void setPWLength() { |
|
|
void setPWLength() { |
|
@ -158,14 +158,14 @@ public class VaultTest { |
|
|
assertTrue(outputStream.toString().contains("now:")); |
|
|
assertTrue(outputStream.toString().contains("now:")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
|
/*@Test |
|
|
void openSetCapitalsMenuItem() { |
|
|
void openSetCapitalsMenuItem() { |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
vlt.inputS = new ByteArrayInputStream("h\nyes".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.inputS = new ByteArrayInputStream("h\nyes".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.outputS = outputStream; |
|
|
vlt.outputS = outputStream; |
|
|
vlt.configure(); |
|
|
vlt.configure(); |
|
|
assertTrue(vlt.haveCapitals = true); |
|
|
assertTrue(vlt.haveCapitals = true); |
|
|
} |
|
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void setCapitals() { |
|
|
void setCapitals() { |
|
@ -183,14 +183,14 @@ public class VaultTest { |
|
|
assertTrue(outputStream.toString().contains("don´t")); |
|
|
assertTrue(outputStream.toString().contains("don´t")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
|
/*@Test |
|
|
void openSetSpecialCharsMenuItem() { |
|
|
void openSetSpecialCharsMenuItem() { |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
vlt.inputS = new ByteArrayInputStream("h\nyes".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.inputS = new ByteArrayInputStream("h\nyes".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.outputS = outputStream; |
|
|
vlt.outputS = outputStream; |
|
|
vlt.configure(); |
|
|
vlt.configure(); |
|
|
assertTrue(vlt.hasSpecialChars = true); |
|
|
assertTrue(vlt.hasSpecialChars = true); |
|
|
} |
|
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void setSpecialCharTest() { |
|
|
void setSpecialCharTest() { |
|
@ -207,14 +207,14 @@ public class VaultTest { |
|
|
assertTrue(outputStream.toString().contains("don´t")); |
|
|
assertTrue(outputStream.toString().contains("don´t")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
|
/*@Test |
|
|
void openSetNumbersMenuItem() { |
|
|
void openSetNumbersMenuItem() { |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
vlt.inputS = new ByteArrayInputStream("h\nyes".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.inputS = new ByteArrayInputStream("h\nyes".getBytes(StandardCharsets.UTF_8)); |
|
|
vlt.outputS = outputStream; |
|
|
vlt.outputS = outputStream; |
|
|
vlt.configure(); |
|
|
vlt.configure(); |
|
|
assertTrue(vlt.hasNumbers = true); |
|
|
assertTrue(vlt.hasNumbers = true); |
|
|
} |
|
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void setNumbersTest() { |
|
|
void setNumbersTest() { |
|
|