1
|
package eu.dnetlib.data.utils;
|
2
|
|
3
|
import java.net.URISyntaxException;
|
4
|
|
5
|
import org.junit.Before;
|
6
|
import org.junit.Ignore;
|
7
|
import org.junit.Test;
|
8
|
|
9
|
public class OpenAIREAuthenticationProviderTest {
|
10
|
|
11
|
private OpenAIREAuthenticationProvider auth;
|
12
|
|
13
|
@Before
|
14
|
public void setUp() throws Exception {
|
15
|
auth = new OpenAIREAuthenticationProvider();
|
16
|
auth.setAuthUrl("https://aai.openaire.eu/oidc/token");
|
17
|
auth.setClientId("");
|
18
|
auth.setSecret("");
|
19
|
|
20
|
}
|
21
|
|
22
|
@Test
|
23
|
@Ignore
|
24
|
public void test() throws URISyntaxException {
|
25
|
final String token = auth.obtainAccessToken();
|
26
|
System.out.println("Token: " + token);
|
27
|
System.out.println(HttpFetcher.fetch("https://api.openaire.eu/search/publications?doi=10.1007/978-3-030-13463-1_11", token));
|
28
|
}
|
29
|
}
|