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 onlyTitle = "info:eu-repo/grantAgreement/EC/FP7/244909/EU/Making Capabilities Work";
|
20
|
|
21
|
@Test
|
22
|
public void testCalculateProjectInfoFull() {
|
23
|
final Map<String, String> project = utils.calculateProjectInfo(fullProject);
|
24
|
print(project);
|
25
|
}
|
26
|
|
27
|
@Test
|
28
|
public void testCalculateProjectInfoMinimalAcro() {
|
29
|
final Map<String, String> project = utils.calculateProjectInfo(minimalProject);
|
30
|
print(project);
|
31
|
}
|
32
|
|
33
|
@Test
|
34
|
public void testCalculateProjectInfoOnlyTitle() {
|
35
|
final Map<String, String> project = utils.calculateProjectInfo(onlyTitle);
|
36
|
print(project);
|
37
|
}
|
38
|
|
39
|
private void print(final Map<String, String> map) {
|
40
|
for (final Entry e : map.entrySet()) {
|
41
|
System.out.println(e.getKey() + " = " + e.getValue());
|
42
|
}
|
43
|
}
|
44
|
}
|