From c85e6ff506526c475db0f837b042f9d31fa69cff Mon Sep 17 00:00:00 2001 From: Kumar Prabhash Anand Date: Fri, 23 Sep 2022 18:45:58 +0200 Subject: [PATCH] BAEL-5765 - Updating scan a char unit tests (#12751) * BAEL-5765 Adding scan a char unit tests * BAEL-5765 updated class name as per the convention * BAEL-5765 updated test cases naming strategy * BAEL-5765 updated variable name --- .../com/baeldung/scanner/ScanACharacterUnitTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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); } }