File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
core/src/test/java/org/neo4j/gds/core/utils/progress Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,22 @@ void shouldCountAcrossUsers() {
5959 assertThat (taskStore .taskCount ()).isEqualTo (3 );
6060 }
6161
62+ @ Test
63+ void shouldQueryByUser () {
64+ var taskStore = new GlobalTaskStore ();
65+ taskStore .store ("alice" , new JobId ("42" ), Tasks .leaf ("leaf" ));
66+ taskStore .store ("alice" , new JobId ("666" ), Tasks .leaf ("leaf" ));
67+ taskStore .store ("bob" , new JobId ("1337" ), Tasks .leaf ("other" ));
68+
69+ assertThat (taskStore .query ("alice" )).hasSize (2 )
70+ .allMatch (task -> task .username ().equals ("alice" ));
71+
72+ assertThat (taskStore .query ("alice" , new JobId ("42" ))).isPresent ()
73+ .get ()
74+ .matches (task -> task .jobId ().asString ().equals ("42" ))
75+ .matches (task -> task .username ().equals ("alice" ));
76+ }
77+
6278 @ Test
6379 void shouldQueryMultipleUsers () {
6480 var taskStore = new GlobalTaskStore ();
You can’t perform that action at this time.
0 commit comments