|
@ -55,6 +55,20 @@ public class VaultTest { |
|
|
assertFalse(vlt.config); |
|
|
assertFalse(vlt.config); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void doNotExitConfigAfterWrongInput() { |
|
|
|
|
|
vlt.inputS = new ByteArrayInputStream("__\n".getBytes(StandardCharsets.UTF_8)); |
|
|
|
|
|
vlt.configure(); |
|
|
|
|
|
assertTrue(vlt.config); |
|
|
|
|
|
|
|
|
|
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
|
|
|
vlt.inputS = getEmptyStringInputStream(); |
|
|
|
|
|
vlt.outputS = outputStream; |
|
|
|
|
|
|
|
|
|
|
|
assertThrowsExactly(NoSuchElementException.class, () -> vlt.configure()); |
|
|
|
|
|
assertTrue(outputStream.toString().startsWith("Configure:")); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ByteArrayInputStream getEmptyStringInputStream() { |
|
|
private ByteArrayInputStream getEmptyStringInputStream() { |
|
|