Skip to content

Commit

Permalink
move unit test into JacksonParserTest
Browse files Browse the repository at this point in the history
  • Loading branch information
wanglingsong committed Nov 25, 2021
1 parent 4f2cb34 commit 85cf0f3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 56 deletions.
15 changes: 14 additions & 1 deletion jsurfer-all/src/test/java/org/jsfr/json/JacksonParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@
import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.math.BigInteger;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.*;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

/**
* Created by Leo on 2015/3/30.
Expand Down Expand Up @@ -135,4 +139,13 @@ public void testAvroParser() throws Exception {
verify(mockListener).onValue(eq(provider.primitive("foo")), any(ParsingContext.class));
}

@Test
public void testParsingLongIntegers() throws Exception {
Collector collector = surfer.collector(read("sample_big_integer.json"));
ValueBox<Object> box = collector.collectOne("$.value");
collector.exec();
BigInteger expected = new BigInteger("3452453534534534534543534543545");
assertEquals(expected, box.get());
}

}

This file was deleted.

1 change: 1 addition & 0 deletions jsurfer-all/src/test/resources/sample_big_integer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"value": 3452453534534534534543534543545}

0 comments on commit 85cf0f3

Please sign in to comment.