diff --git a/core-java-modules/core-java-io-apis-2/src/test/java/com/baeldung/scanner/ScanACharacterUnitTest.java b/core-java-modules/core-java-io-apis-2/src/test/java/com/baeldung/scanner/ScanACharacterUnitTest.java index 49d6e78f14..1a70c6e3af 100644 --- a/core-java-modules/core-java-io-apis-2/src/test/java/com/baeldung/scanner/ScanACharacterUnitTest.java +++ b/core-java-modules/core-java-io-apis-2/src/test/java/com/baeldung/scanner/ScanACharacterUnitTest.java @@ -9,30 +9,30 @@ import org.junit.jupiter.api.Test; public class ScanACharacterUnitTest { // given - input scanner source, no need to scan from console - String Input = new StringBuilder().append("abc\n") + String input = new StringBuilder().append("abc\n") .append("mno\n") .append("xyz\n") .toString(); @Test public void givenInputSource_whenScanCharUsingNext_thenOneCharIsRead() { - Scanner sc = new Scanner(Input); + Scanner sc = new Scanner(input); char c = sc.next().charAt(0); assertEquals('a', c); } @Test public void givenInputSource_whenScanCharUsingFindInLine_thenOneCharIsRead() { - Scanner sc = new Scanner(Input); + Scanner sc = new Scanner(input); char c = sc.findInLine(".").charAt(0); assertEquals('a', c); } @Test public void givenInputSource_whenScanCharUsingUseDelimiter_thenOneCharIsRead() { - Scanner sc = new Scanner(Input); - String c = sc.useDelimiter("").next(); - assertEquals("a", c); + Scanner sc = new Scanner(input); + char c = sc.useDelimiter("").next().charAt(0); + assertEquals('a', c); } }