Revision 52956
Added by Sandro La Bruzzo about 6 years ago
modules/dnet-mapreduce-jobs/branches/beta/src/test/java/eu/dnetlib/data/mapreduce/actions/CrossRefToActionTest.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
@Test |
31 | 31 |
public void testSingleScholixAction2() throws IOException { |
32 |
doTestSingleCrossRefAction("/eu/dnetlib/data/mapreduce/actions/part-06036");
|
|
32 |
doTestSingleCrossRefAction("/eu/dnetlib/data/mapreduce/actions/broken");
|
|
33 | 33 |
} |
34 | 34 |
|
35 | 35 |
@Test |
modules/dnet-mapreduce-jobs/branches/beta/src/test/resources/eu/dnetlib/data/mapreduce/actions/broken | ||
---|---|---|
1 |
{"best_oa_location_url": "", "issued": "2012-3-10", "abstract": [], "objIdentifier": "8201506ef2275362065a6b228c560e51", "pissn": "1220-1766", "subject": ["Electrical and Electronic Engineering", "Computer Science(all)"], "eissn": "1841-429X", "author": [{"affiliation": [], "given": "Diego", "family": "Soto"}, {"affiliation": [], "given": "Jaime", "family": "Borquez"}], "dateOfCollection": "2018-08-07 12:23:27Z", "type": {"cobj": "0001", "value": "Article"}, "is_oa": false, "published-online": "2012-3-10", "link": null, "published-print": "2012-3-10", "accepted": null, "publisher": null, "doi": "10.24846/v21i1y201210", "license": null, "url": "http://dx.doi.org/10.24846/v21i1y201210", "issn": [{"type": "print", "value": "1220-1766"}, {"type": "electronic", "value": "1841-429X"}], "collectedFrom": [{"name": "UnpayWall", "id": "openaire____::unpaywall"}, {"name": "CrossRef", "id": "openaire____::crossref"}], "title": ["Control of a Modular Multilevel Matrix Converter for High Power Applications"], "funder": null, "datasourcePrefix": "crossref____"} |
modules/dnet-mapreduce-jobs/branches/beta/src/main/java/eu/dnetlib/data/mapreduce/hbase/dataimport/ScholixToActions.java | ||
---|---|---|
343 | 343 |
} |
344 | 344 |
|
345 | 345 |
public static String getStringValue(final JsonObject root, final String key) { |
346 |
if (root.has(key)) |
|
346 |
if (root.has(key) && !root.get(key).isJsonNull())
|
|
347 | 347 |
return root.get(key).getAsString(); |
348 | 348 |
return null; |
349 | 349 |
} |
Also available in: Unified diff
fixed null element