File tree 1 file changed +2
-2
lines changed
appengine/datastore/src/test/java/com/example/appengine
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -67,22 +67,22 @@ public void projectionQuery_grouping_filtersDuplicates() {
67
67
putTestData ("some duplicate" , 0L );
68
68
putTestData ("too big" , 1L );
69
69
70
+ // [START grouping]
70
71
Query q = new Query ("TestKind" );
71
72
q .addProjection (new PropertyProjection ("A" , String .class ));
72
73
q .addProjection (new PropertyProjection ("B" , Long .class ));
73
74
q .setDistinct (true );
74
75
q .setFilter (Query .FilterOperator .LESS_THAN .of ("B" , 1L ));
75
76
q .addSort ("B" , Query .SortDirection .DESCENDING );
76
77
q .addSort ("A" );
78
+ // [END grouping]
77
79
78
80
List <Entity > entities =
79
81
datastore .prepare (q ).asList (FetchOptions .Builder .withLimit (5 ));
80
82
assertThat (entities ).hasSize (1 );
81
- // [START_EXCLUDE silent]
82
83
Entity entity = entities .get (0 );
83
84
assertThat ((String ) entity .getProperty ("A" )).named ("entity.A" ).isEqualTo ("some duplicate" );
84
85
assertThat ((long ) entity .getProperty ("B" )).named ("entity.B" ).isEqualTo (0L );
85
- // [END_EXCLUDE]
86
86
}
87
87
88
88
private void putTestData (String a , long b ) {
You can’t perform that action at this time.
0 commit comments