@@ -35,6 +35,7 @@ public class BaseEntityTest {
3535
3636 private static final Blob BLOB = Blob .copyFrom (new byte []{1 , 2 });
3737 private static final DateTime DATE_TIME = DateTime .now ();
38+ private static final LatLng LAT_LNG = new LatLng (37.422035 , -122.084124 );
3839 private static final Key KEY = Key .builder ("ds1" , "k1" , "n1" ).build ();
3940 private static final Entity ENTITY = Entity .builder (KEY ).set ("name" , "foo" ).build ();
4041 private static final IncompleteKey INCOMPLETE_KEY = IncompleteKey .builder ("ds1" , "k1" ).build ();
@@ -62,9 +63,9 @@ public void setUp() {
6263 builder = new Builder ();
6364 builder .set ("blob" , BLOB ).set ("boolean" , true ).set ("dateTime" , DATE_TIME );
6465 builder .set ("double" , 1.25 ).set ("key" , KEY ).set ("string" , "hello world" );
65- builder .set ("long" , 125 ).setNull ("null" ).set ("entity" , ENTITY );
66+ builder .set ("long" , 125 ).setNull ("null" ).set ("entity" , ENTITY ). set ( "latLng" , LAT_LNG ) ;
6667 builder .set ("partialEntity" , PARTIAL_ENTITY ).set ("stringValue" , StringValue .of ("bla" ));
67- builder .set ("list1" , NullValue .of (), StringValue .of ("foo" ));
68+ builder .set ("list1" , NullValue .of (), StringValue .of ("foo" ), LatLngValue . of ( LAT_LNG ) );
6869 builder .set ("list2" , ImmutableList .of (LongValue .of (10 ), DoubleValue .of (2 )));
6970 builder .set ("list3" , Collections .singletonList (BooleanValue .of (true )));
7071 }
@@ -149,6 +150,12 @@ public void testGetDateTime() throws Exception {
149150 assertEquals (dateTime , entity .getDateTime ("dateTime" ));
150151 }
151152
153+ @ Test
154+ public void testGetLatLng () throws Exception {
155+ BaseEntity <Key > entity = builder .build ();
156+ assertEquals (LAT_LNG , entity .getLatLng ("latLng" ));
157+ }
158+
152159 @ Test
153160 public void testGetKey () throws Exception {
154161 BaseEntity <Key > entity = builder .build ();
@@ -171,9 +178,10 @@ public void testGetEntity() throws Exception {
171178 public void testGetList () throws Exception {
172179 BaseEntity <Key > entity = builder .build ();
173180 List <? extends Value <?>> list = entity .getList ("list1" );
174- assertEquals (2 , list .size ());
181+ assertEquals (3 , list .size ());
175182 assertEquals (NullValue .of (), list .get (0 ));
176183 assertEquals ("foo" , list .get (1 ).get ());
184+ assertEquals (LAT_LNG , list .get (2 ).get ());
177185 list = entity .getList ("list2" );
178186 assertEquals (2 , list .size ());
179187 assertEquals (Long .valueOf (10 ), list .get (0 ).get ());
@@ -196,9 +204,10 @@ public void testGetBlob() throws Exception {
196204
197205 @ Test
198206 public void testNames () throws Exception {
199- Set <String > names = ImmutableSet .<String >builder ()
200- .add ("string" , "stringValue" , "boolean" , "double" , "long" , "list1" , "list2" , "list3" )
201- .add ("entity" , "partialEntity" , "null" , "dateTime" , "blob" , "key" )
207+ Set <String > names =
208+ ImmutableSet .<String >builder ()
209+ .add ("string" , "stringValue" , "boolean" , "double" , "long" , "list1" , "list2" , "list3" )
210+ .add ("entity" , "partialEntity" , "null" , "dateTime" , "latLng" , "blob" , "key" )
202211 .build ();
203212 BaseEntity <Key > entity = builder .build ();
204213 assertEquals (names , entity .names ());
0 commit comments