|
@ -72,12 +72,11 @@ class StudentTest { |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void testPrintStudentInfo() { |
|
|
void testPrintStudentInfo() { |
|
|
Student student = sampleStudent; |
|
|
|
|
|
|
|
|
|
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
System.setOut(new PrintStream(outputStream)); |
|
|
System.setOut(new PrintStream(outputStream)); |
|
|
|
|
|
|
|
|
student.printStudentInfo(); |
|
|
|
|
|
|
|
|
sampleStudent.printStudentInfo(); |
|
|
|
|
|
|
|
|
String printedOutput = outputStream.toString().trim(); |
|
|
String printedOutput = outputStream.toString().trim(); |
|
|
|
|
|
|
|
|