Project

General

Profile

1
/**
2
 * 
3
 */
4
package eu.dnetlib.data.collector.plugins.rest;
5

    
6
import org.junit.Ignore;
7
import org.junit.Test;
8

    
9
/**
10
 * @author js
11
 *
12
 */
13
public class RestIteratorTest {
14

    
15
	private String baseUrl = "https://share.osf.io/api/v2/search/creativeworks/_search";
16
	private String resumptionType = "count";
17
	private String resumptionParam = "from";
18
	private String resumptionXpath = "";
19
	private String resultTotalXpath = "//hits/total";
20
	private String entityXpath = "//hits/hits";
21
	private String resultFormatParam = "format";
22
	private String resultFormatValue = "json";
23
	private String resultSizeParam = "size";
24
	private String query = "q=%28sources%3ASocArXiv+AND+type%3Apreprint%29";
25

    
26

    
27
	@Ignore
28
	@Test
29
	public void test(){
30
		final RestIterator iterator = new RestIterator(baseUrl, resumptionType, resumptionParam, resumptionXpath, resultTotalXpath, resultFormatParam, resultFormatValue, resultSizeParam, query, entityXpath);
31
		int i =20;
32
		while (iterator.hasNext() && i > 0) {
33
			String result = iterator.next();
34
			
35
			i--;
36
		}
37
	}
38
}
39

    
(2-2/2)