Skip to content

Commit a18a482

Browse files
committed
Tiny test refactoring
1 parent 577fe9c commit a18a482

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/test/java/com/fasterxml/jackson/databind/deser/jdk/BigNumbersDeserTest.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,27 +104,24 @@ public void testBigIntegerUnlimited() throws Exception
104104

105105
// [databind#4435]
106106
@Test
107-
public void testNumberStartingWithDot() throws Exception
108-
{
109-
String num = ".555555555555555555555555555555";
110-
BigDecimalWrapper w = MAPPER.readValue("{\"number\":\"" + num + "\"}", BigDecimalWrapper.class);
111-
assertEquals(new BigDecimal(num), w.number);
107+
public void testNumberStartingWithDot() throws Exception {
108+
_testNumberWith(".555555555555555555555555555555");
112109
}
113110

114111
// [databind#4435]
115112
@Test
116-
public void testNumberStartingWithMinusDot() throws Exception
117-
{
118-
String num = "-.555555555555555555555555555555";
119-
BigDecimalWrapper w = MAPPER.readValue("{\"number\":\"" + num + "\"}", BigDecimalWrapper.class);
120-
assertEquals(new BigDecimal(num), w.number);
113+
public void testNumberStartingWithMinusDot() throws Exception {
114+
_testNumberWith("-.555555555555555555555555555555");
121115
}
122116

123117
// [databind#4435]
124118
@Test
125-
public void testNumberStartingWithPlusDot() throws Exception
119+
public void testNumberStartingWithPlusDot() throws Exception {
120+
_testNumberWith("+.555555555555555555555555555555");
121+
}
122+
123+
private void _testNumberWith(String num) throws Exception
126124
{
127-
String num = "+.555555555555555555555555555555";
128125
BigDecimalWrapper w = MAPPER.readValue("{\"number\":\"" + num + "\"}", BigDecimalWrapper.class);
129126
assertEquals(new BigDecimal(num), w.number);
130127
}

0 commit comments

Comments
 (0)