forked from D-Net/dnet-hadoop
added assertions to verify doi normalization
This commit is contained in:
parent
86f47afcc7
commit
bc34347643
|
@ -20,16 +20,26 @@ class UnpayWallMappingTest {
|
||||||
|
|
||||||
val Ilist = Source.fromInputStream(getClass.getResourceAsStream("input.json")).mkString
|
val Ilist = Source.fromInputStream(getClass.getResourceAsStream("input.json")).mkString
|
||||||
|
|
||||||
|
var i:Int = 0
|
||||||
for (line <-Ilist.lines) {
|
for (line <-Ilist.lines) {
|
||||||
val p = UnpayWallToOAF.convertToOAF(line)
|
val p = UnpayWallToOAF.convertToOAF(line)
|
||||||
|
|
||||||
if(p!= null) {
|
if(p!= null) {
|
||||||
assertTrue(p.getInstance().size()==1)
|
assertTrue(p.getInstance().size()==1)
|
||||||
|
if (i== 0){
|
||||||
|
assertTrue(p.getPid.get(0).getValue.equals("10.1038/2211089b0"))
|
||||||
|
}
|
||||||
|
if (i== 1){
|
||||||
|
assertTrue(p.getPid.get(0).getValue.equals("10.1021/acs.bioconjchem.8b00058.s001"))
|
||||||
|
}
|
||||||
|
if (i== 2){
|
||||||
|
assertTrue(p.getPid.get(0).getValue.equals("10.1021/acs.bioconjchem.8b00086.s001"))
|
||||||
|
}
|
||||||
logger.info(s"ID : ${p.getId}")
|
logger.info(s"ID : ${p.getId}")
|
||||||
}
|
}
|
||||||
assertNotNull(line)
|
assertNotNull(line)
|
||||||
assertTrue(line.nonEmpty)
|
assertTrue(line.nonEmpty)
|
||||||
|
i = i+1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,7 +49,9 @@ class UnpayWallMappingTest {
|
||||||
val item = UnpayWallToOAF.convertToOAF(l)
|
val item = UnpayWallToOAF.convertToOAF(l)
|
||||||
|
|
||||||
assertEquals(item.getInstance().get(0).getAccessright.getOpenAccessRoute, OpenAccessRoute.bronze)
|
assertEquals(item.getInstance().get(0).getAccessright.getOpenAccessRoute, OpenAccessRoute.bronze)
|
||||||
|
|
||||||
logger.info(mapper.writeValueAsString(item))
|
logger.info(mapper.writeValueAsString(item))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue