Project

General

Profile

« Previous | Next » 

Revision 59797

added test to verify if blanc community id could be because of api return. It was not the case

View differences:

modules/dnet-directindex-api/trunk/src/test/java/eu/dnetlib/msro/openaireplus/api/OpenAIRESubmitterUtilsTest.java
1 1
package eu.dnetlib.msro.openaireplus.api;
2 2

  
3
import java.util.ArrayList;
4
import java.util.List;
3 5
import java.util.Map;
4 6
import java.util.Map.Entry;
5 7

  
8
import org.junit.Assert;
6 9
import org.junit.Test;
7 10

  
8 11
import eu.dnetlib.openaire.directindex.api.OpenAIRESubmitterUtils;
......
59 62
			System.out.println(e.getKey() + " = " + e.getValue());
60 63
		}
61 64
	}
65

  
66
	@Test
67
	public void testContext(){
68
		List<String> contexts = new ArrayList<>();
69
		contexts.add("https://zenodo.org/communities/dimpo");
70
		contexts.add("https://zenodo.org/communities/aoo_beopen");
71
		List<OpenAIRESubmitterUtils.ContextInfo> tmp = utils.processContexts(contexts);
72

  
73
		Assert.assertEquals(2, tmp.size());
74

  
75
		Assert.assertTrue(tmp.get(0).getId().equals("dh-ch") || tmp.get(1).getId().equalsIgnoreCase("dh-ch"));
76
		Assert.assertTrue(tmp.get(0).getId().equals("dariah") || tmp.get(1).getId().equalsIgnoreCase("dariah"));
77
	}
62 78
}

Also available in: Unified diff