@@ -1186,6 +1186,40 @@ public void testGetNodeSubscriptions() throws Exception {
11861186 CollectionUtils .isEqualCollection (expected , result ));
11871187 }
11881188
1189+
1190+ @ Test
1191+ public void testGetNodeSubscriptionsForOwnerModerator () throws Exception {
1192+ dbTester .loadData ("node_1" );
1193+
1194+ ResultSet <NodeSubscription > result = store
1195+ .getNodeSubscriptions (TEST_SERVER1_NODE1_ID , true );
1196+
1197+ HashSet <NodeSubscription > expected = new HashSet <NodeSubscription >() {
1198+ {
1199+ add (new NodeSubscriptionImpl (TEST_SERVER1_NODE1_ID ,
1200+ TEST_SERVER1_USER1_JID , TEST_SERVER1_USER1_JID ,
1201+ Subscriptions .subscribed ));
1202+ add (new NodeSubscriptionImpl (TEST_SERVER1_NODE1_ID ,
1203+ TEST_SERVER1_USER2_JID , TEST_SERVER1_USER2_JID ,
1204+ Subscriptions .subscribed ));
1205+ add (new NodeSubscriptionImpl (TEST_SERVER1_NODE1_ID ,
1206+ TEST_SERVER2_USER1_JID , TEST_SERVER2_CHANNELS_JID ,
1207+ Subscriptions .subscribed ));
1208+ add (new NodeSubscriptionImpl (TEST_SERVER1_NODE1_ID ,
1209+ TEST_SERVER2_USER3_JID , TEST_SERVER2_CHANNELS_JID ,
1210+ Subscriptions .subscribed ));
1211+ add (new NodeSubscriptionImpl (TEST_SERVER1_NODE1_ID ,
1212+ TEST_SERVER1_OUTCAST_JID , TEST_SERVER1_OUTCAST_JID ,
1213+ Subscriptions .subscribed ));
1214+ }
1215+ };
1216+
1217+ assertEquals ("Incorrect number of node subscriptions returned" ,
1218+ expected .size (), result .size ());
1219+ assertTrue ("Incorrect node subscriptions returned" ,
1220+ CollectionUtils .isEqualCollection (expected , result ));
1221+ }
1222+
11891223 @ Test
11901224 @ Ignore ("hsql doesn't like DISTINCT ON" )
11911225 public void testGetNodeSubscriptionListeners () throws Exception {
0 commit comments