From 51d09a0a4f995dabe399d02a44dbe7c8e9d370cf Mon Sep 17 00:00:00 2001 From: fdai7600 Date: Fri, 9 Feb 2024 00:16:59 +0100 Subject: [PATCH] refactoring: removed redundant student variable in testPrintStudentInfo() --- src/test/java/org/example/StudentTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/java/org/example/StudentTest.java b/src/test/java/org/example/StudentTest.java index 28b48b6..034f426 100644 --- a/src/test/java/org/example/StudentTest.java +++ b/src/test/java/org/example/StudentTest.java @@ -72,12 +72,11 @@ class StudentTest { @Test void testPrintStudentInfo() { - Student student = sampleStudent; ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); System.setOut(new PrintStream(outputStream)); - student.printStudentInfo(); + sampleStudent.printStudentInfo(); String printedOutput = outputStream.toString().trim();