33import static org .junit .Assert .assertEquals ;
44import static org .junit .Assert .assertNotNull ;
55
6+ import com .google .gson .JsonElement ;
7+ import com .google .gson .JsonPrimitive ;
68import com .mapbox .core .TestUtils ;
79import org .junit .Test ;
810
911import java .util .ArrayList ;
1012import java .util .Arrays ;
13+ import java .util .HashMap ;
1114import java .util .List ;
15+ import java .util .Map ;
1216
1317public class LegAnnotationTest extends TestUtils {
1418
@@ -20,12 +24,15 @@ public void sanity() throws Exception {
2024 .distance (new ArrayList <Double >())
2125 .duration (new ArrayList <Double >())
2226 .speed (new ArrayList <Double >())
27+ .unrecognizedProperties (new HashMap <>())
2328 .build ();
2429 assertNotNull (annotation );
2530 }
2631
2732 @ Test
2833 public void testSerializable () throws Exception {
34+ Map <String , JsonElement > unrecognizedProperties = new HashMap <>();
35+ unrecognizedProperties .put ("aaa" , new JsonPrimitive ("bbb" ));
2936 List <Double > distance = new ArrayList <>();
3037 distance .add (20d );
3138 distance .add (40d );
@@ -36,13 +43,16 @@ public void testSerializable() throws Exception {
3643 .distance (distance )
3744 .duration (new ArrayList <Double >())
3845 .speed (new ArrayList <Double >())
46+ .unrecognizedProperties (unrecognizedProperties )
3947 .build ();
4048 byte [] serialized = TestUtils .serialize (annotation );
4149 assertEquals (annotation , deserialize (serialized , LegAnnotation .class ));
4250 }
4351
4452 @ Test
4553 public void testToFromJson1 () {
54+ Map <String , JsonElement > unrecognizedProperties = new HashMap <>();
55+ unrecognizedProperties .put ("aaa" , new JsonPrimitive ("bbb" ));
4656
4757 List <Double > distanceList = Arrays .asList (
4858 4.294596842089401 ,
@@ -101,6 +111,7 @@ public void testToFromJson1() {
101111 .duration (durationList )
102112 .speed (speedList )
103113 .congestion (congestionList )
114+ .unrecognizedProperties (unrecognizedProperties )
104115 .build ();
105116
106117
0 commit comments