Browse Source

refactoring: removed redundant student variable in testPrintStudentInfo()

remotes/origin/fdai7600
fdai7600 11 months ago
parent
commit
51d09a0a4f
  1. 3
      src/test/java/org/example/StudentTest.java

3
src/test/java/org/example/StudentTest.java

@ -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();

Loading…
Cancel
Save