Skip to content

Commit ef9f687

Browse files
abhijoyfulKevinGilmore
authored andcommitted
rename variable and move underscore to front to simulate minus (eugenp#7010)
1 parent c15baec commit ef9f687

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core-java-modules/core-java-exceptions/src/test/java/com/baeldung/exception/numberformat/NumberFormatExceptionUnitTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void givenParseIntMethod_whenSpaceInInput_thenFail() {
3636

3737
@Test(expected = NumberFormatException.class)
3838
public void givenParseIntMethod_whenUnderscoreInInput_thenFail() {
39-
int bIntPrim = Integer.parseInt("6_000");
39+
int bIntPrim = Integer.parseInt("_6000");
4040
}
4141

4242
@Test(expected = NumberFormatException.class)
@@ -51,7 +51,7 @@ public void givenBigIntegerConstructor_whenDecimalInInput_thenFail() {
5151

5252
@Test(expected = NumberFormatException.class)
5353
public void givenDecodeMethod_whenAlphabetInInput_thenFail() {
54-
Long decodeInteger = Long.decode("64403L");
54+
Long decodedLong = Long.decode("64403L");
5555
}
5656

5757
/* ---INTEGER PASS CASES--- */
@@ -72,7 +72,7 @@ public void givenInvalidNumberInputs_whenOptimized_thenPass() {
7272
int aIntPrim = Integer.parseInt("6000 ".trim());
7373
assertEquals(6000, aIntPrim);
7474

75-
int bIntPrim = Integer.parseInt("6_000".replaceAll("_", ""));
75+
int bIntPrim = Integer.parseInt("_6000".replaceAll("_", ""));
7676
assertEquals(6000, bIntPrim);
7777

7878
int cIntPrim = Integer.parseInt("-6000");

0 commit comments

Comments
 (0)