Skip to content

Commit 860ce7e

Browse files
author
boncey
committed
Make test more robust
1 parent 335eab2 commit 860ce7e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Flickr4Java/src/test/java/com/flickr4java/flickr/test/InterestingnessInterfaceTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
import static org.junit.Assert.assertTrue;
66
import static org.junit.Assert.fail;
77

8-
import org.junit.Test;
9-
108
import com.flickr4java.flickr.FlickrException;
119
import com.flickr4java.flickr.interestingness.InterestingnessInterface;
1210
import com.flickr4java.flickr.photos.Extras;
1311
import com.flickr4java.flickr.photos.Photo;
1412
import com.flickr4java.flickr.photos.PhotoList;
1513

14+
import org.junit.Test;
15+
1616
/**
1717
*
1818
* @version $Id: InterestingnessInterfaceTest.java,v 1.5 2008/01/28 23:01:45 x-mago Exp $
@@ -34,7 +34,7 @@ public void testGetListStringSetIntInt() throws FlickrException {
3434
assertEquals(7, list.getPerPage());
3535
assertEquals(500, list.getTotal());
3636
assertTrue(list.get(0) instanceof Photo);
37-
Photo photo = (Photo) list.get(1);
37+
Photo photo = list.get(1);
3838
assertNotNull(photo.getId());
3939
assertNotNull(photo.getLicense());
4040
assertNotNull(photo.getOwner());
@@ -45,10 +45,10 @@ public void testGetListStringSetIntInt() throws FlickrException {
4545

4646
list = ii.getList((String) null, Extras.ALL_EXTRAS, 100, 1);
4747
assertNotNull(list);
48-
assertEquals(100, list.size());
49-
photo = (Photo) list.get(0);
48+
assertTrue(list.size() > 1);
49+
photo = list.get(0);
5050
for (int i = list.size() - 1; i >= 0; --i) {
51-
photo = (Photo) list.get(i);
51+
photo = list.get(i);
5252
if (photo.hasGeoData()) {
5353
// System.out.println(photo.getId() + " " + photo.getGeoData() + " " + photo.getUrl());
5454
}

0 commit comments

Comments
 (0)