11package com .fasterxml .jackson .dataformat .protobuf ;
22
3- import java .io .IOException ;
4-
53import org .junit .jupiter .api .Test ;
64
75import com .fasterxml .jackson .databind .ObjectMapper ;
86import com .fasterxml .jackson .dataformat .protobuf .schema .ProtobufSchema ;
97import com .fasterxml .jackson .dataformat .protobuf .schema .ProtobufSchemaLoader ;
108
11- /**
12- * Created by miz on 8/10/16.
13- */
14- public class SerDeserLongTest {
9+ import static org .junit .jupiter .api .Assertions .assertEquals ;
10+
11+ public class SerDeserLongTest extends ProtobufTestBase
12+ {
13+ public static class BigNumPair {
14+ public static final String protobuf_str =
15+ "message BigNumPair {\n "
16+ + " required int64 long1 = 1;\n "
17+ + " required int64 long2 = 2;\n "
18+ + "}\n " ;
19+
20+ public long long1 ;
21+ public long long2 ;
22+ }
23+
1524 @ Test
16- public void testWeirdLongSerDeser () throws IOException {
17- ObjectMapper mapper = new ObjectMapper ( new ProtobufFactory () );
25+ public void testWeirdLongSerDeser () throws Exception {
26+ ObjectMapper mapper = newObjectMapper ( );
1827 ProtobufSchema schema = ProtobufSchemaLoader .std .parse (BigNumPair .protobuf_str );
1928
2029 BigNumPair bnp = new BigNumPair ();
@@ -25,7 +34,7 @@ public void testWeirdLongSerDeser() throws IOException {
2534
2635 BigNumPair parsed = mapper .readerFor (BigNumPair .class ).with (schema ).readValue (encoded );
2736
28- assert parsed .long1 == bnp .long1 ;
29- assert parsed .long2 == bnp .long2 ;
37+ assertEquals ( bnp .long1 , parsed .long1 ) ;
38+ assertEquals ( bnp .long2 , parsed .long2 ) ;
3039 }
3140}
0 commit comments