Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
430 B
3
Indexable
Never
	@Test
	void test4() {
		String exceptString = "Wrong input format!\n";
		ByteArrayOutputStream stream = new ByteArrayOutputStream();
		PrintStream ps = new PrintStream(stream);
		PrintStream originalPrintStream = System.out;
		
		System.setOut(ps);
		mytest.transform("-2022");
		System.setOut(originalPrintStream);
		
		String output = new String(stream.toByteArray());
		assertEquals(exceptString, output);
	}

}