@@ -104,7 +104,7 @@ public class Concepts {
104
104
@ BeforeClass
105
105
public static void beforeClass () throws IOException , InterruptedException {
106
106
if (!LocalGcdHelper .isActive (PROJECT_ID , PORT )) {
107
- gcdHelper = LocalGcdHelper .start (PROJECT_ID , PORT );
107
+ gcdHelper = LocalGcdHelper .start (PROJECT_ID , PORT , 1.0 );
108
108
}
109
109
}
110
110
@@ -232,8 +232,8 @@ public void testProperties() {
232
232
public void testArrayValue () {
233
233
// [START array_value]
234
234
Entity task = Entity .builder (taskKey )
235
- .set ("tags" , StringValue . of ( "fun" ), StringValue . of ( "programming" ) )
236
- .set ("collaborators" , StringValue . of ( "alice" ), StringValue . of ( "bob" ) )
235
+ .set ("tags" , "fun" , "programming" )
236
+ .set ("collaborators" , "alice" , "bob" )
237
237
.build ();
238
238
// [END array_value]
239
239
assertValidEntity (task );
@@ -374,7 +374,7 @@ private void setUpQueryTests() {
374
374
.set ("created" , includedDate )
375
375
.set ("percent_complete" , 10.0 )
376
376
.set ("description" , StringValue .builder ("Learn Cloud Datastore" ).indexed (false ).build ())
377
- .set ("tag" , StringValue . of ( "fun" ), StringValue . of ( "l" ), StringValue . of ( "programming" ) )
377
+ .set ("tag" , "fun" , "l" , "programming" )
378
378
.build ());
379
379
}
380
380
@@ -748,9 +748,8 @@ public void testUnindexedPropertyQuery() {
748
748
public void testExplodingProperties () {
749
749
// [START exploding_properties]
750
750
Entity task = Entity .builder (taskKey )
751
- .set ("tags" , StringValue .of ("fun" ), StringValue .of ("programming" ), StringValue .of ("learn" ))
752
- .set ("collaborators" , StringValue .of ("alice" ), StringValue .of ("bob" ),
753
- StringValue .of ("charlie" ))
751
+ .set ("tags" , "fun" , "programming" , "learn" )
752
+ .set ("collaborators" , "alice" , "bob" , "charlie" )
754
753
.set ("created" , DateTime .now ())
755
754
.build ();
756
755
// [END exploding_properties]
@@ -916,7 +915,7 @@ public void testPropertyRunQuery() {
916
915
Map <String , Collection <String >> propertiesByKind = new HashMap <>();
917
916
while (results .hasNext ()) {
918
917
Key property = results .next ();
919
- String kind = property .ancestors (). get ( property . ancestors (). size () - 1 ).name ();
918
+ String kind = property .parent ( ).name ();
920
919
String propertyName = property .name ();
921
920
Collection <String > properties = propertiesByKind .get (kind );
922
921
if (properties == null ) {
@@ -945,8 +944,7 @@ public void testPropertyByKindRunQuery() {
945
944
while (results .hasNext ()) {
946
945
Entity property = results .next ();
947
946
String propertyName = property .key ().name ();
948
- List <StringValue > representations =
949
- (List <StringValue >) property .getList ("property_representation" );
947
+ List <StringValue > representations = property .getList ("property_representation" );
950
948
Collection <String > currentRepresentations = representationsByProperty .get (propertyName );
951
949
if (currentRepresentations == null ) {
952
950
currentRepresentations = new HashSet <>();
@@ -985,7 +983,7 @@ public void testPropertyFilteringRunQuery() {
985
983
QueryResults <Key > results = datastore .run (query );
986
984
while (results .hasNext ()) {
987
985
Key property = results .next ();
988
- String kind = property .ancestors (). get ( property . ancestors (). size () - 1 ).name ();
986
+ String kind = property .parent ( ).name ();
989
987
String propertyName = property .name ();
990
988
Collection <String > properties = propertiesByKind .get (kind );
991
989
if (properties == null ) {
0 commit comments