File tree Expand file tree Collapse file tree
Flickr4Java/src/test/java/com/flickr4java/flickr/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 */
2323public class GroupsInterfaceTest extends Flickr4JavaTest {
2424
25+ public static final String TEST_JOIN_GROUP = "2173840@N20" ;
26+
2527 public void deprecatedBrowse () throws FlickrException {
2628 GroupsInterface iface = flickr .getGroupsInterface ();
2729 Category cat = iface .browse (null );
@@ -98,4 +100,21 @@ public void testSearchPage() throws FlickrException {
98100 assertTrue (groups .getTotal () > 0 );
99101 }
100102
103+ @ Test
104+ public void testJoinLeave () throws FlickrException {
105+
106+ GroupsInterface iface = flickr .getGroupsInterface ();
107+
108+ Group group = iface .getInfo (TEST_JOIN_GROUP );
109+ int cntBeforeJoin = group .getMembers ();
110+ iface .join (TEST_JOIN_GROUP , null );
111+ group = iface .getInfo (TEST_JOIN_GROUP );
112+ int cntAfterJoin = group .getMembers ();
113+ assertTrue ("Member count increased by 1" , cntBeforeJoin + 1 == cntAfterJoin );
114+
115+ iface .leave (TEST_JOIN_GROUP , false );
116+ group = iface .getInfo (TEST_JOIN_GROUP );
117+ int cntAfterLeave = group .getMembers ();
118+ assertTrue ("Member count decreasted by 1" , cntAfterLeave == cntBeforeJoin );
119+ }
101120}
You can’t perform that action at this time.
0 commit comments