1
|
package eu.dnetlib.msro.openaireplus.api;
|
2
|
|
3
|
import java.util.Map;
|
4
|
import java.util.Map.Entry;
|
5
|
|
6
|
import org.junit.Test;
|
7
|
|
8
|
/**
|
9
|
* Created by Alessia Bardi on 26/05/2017.
|
10
|
*
|
11
|
* @author Alessia Bardi
|
12
|
*/
|
13
|
public class OpenAIRESubmitterUtilsTest {
|
14
|
|
15
|
private OpenAIRESubmitterUtils utils = new OpenAIRESubmitterUtils();
|
16
|
|
17
|
final String fullProject = "info:eu-repo/grantAgreement/EC/FP7/244909/EU/Making Capabilities Work/WorkAble";
|
18
|
final String minimalProject = "info:eu-repo/grantAgreement/EC/FP7/244909///WorkAble";
|
19
|
final String onlyId = "info:eu-repo/grantAgreement/EC/FP7/244909/";
|
20
|
final String onlyTitle = "info:eu-repo/grantAgreement/EC/FP7/244909/EU/Making Capabilities Work";
|
21
|
|
22
|
@Test
|
23
|
public void testCalculateProjectInfoFull() {
|
24
|
final Map<String, String> project = utils.calculateProjectInfo(fullProject);
|
25
|
print(project);
|
26
|
}
|
27
|
|
28
|
@Test
|
29
|
public void testCalculateProjectInfoOnlyId() {
|
30
|
final Map<String, String> project = utils.calculateProjectInfo(onlyId);
|
31
|
print(project);
|
32
|
}
|
33
|
|
34
|
@Test
|
35
|
public void testCalculateProjectInfoMinimalAcro() {
|
36
|
final Map<String, String> project = utils.calculateProjectInfo(minimalProject);
|
37
|
print(project);
|
38
|
}
|
39
|
|
40
|
@Test
|
41
|
public void testCalculateProjectInfoOnlyTitle() {
|
42
|
final Map<String, String> project = utils.calculateProjectInfo(onlyTitle);
|
43
|
print(project);
|
44
|
}
|
45
|
|
46
|
private void print(final Map<String, String> map) {
|
47
|
for (final Entry e : map.entrySet()) {
|
48
|
System.out.println(e.getKey() + " = " + e.getValue());
|
49
|
}
|
50
|
}
|
51
|
}
|