Revision 52953
Added by Miriam Baglioni over 5 years ago
modules/dnet-mapreduce-jobs/trunk/src/test/java/eu/dnetlib/data/mapreduce/hbase/bulktag/ResultTaggerTest.java | ||
---|---|---|
162 | 162 |
assertTrue(ids.contains("aginfra")); |
163 | 163 |
assertTrue(ids.contains("ni")); |
164 | 164 |
assertTrue(ids.contains("mes")); |
165 |
assertTrue(countContext(oaf)==3); |
|
165 | 166 |
} |
166 | 167 |
|
167 | 168 |
@Test |
... | ... | |
181 | 182 |
provenance.addAll(dataInfoList.stream().map(d->d.getInferenceprovenance()).collect(Collectors.toList())); |
182 | 183 |
assertTrue(provenance.size()==2); |
183 | 184 |
assertTrue(provenance.contains("bulktagging::community")); |
185 |
assertTrue(countContext(oaf)==1); |
|
184 | 186 |
|
185 | 187 |
} |
186 | 188 |
|
... | ... | |
192 | 194 |
|
193 | 195 |
return oaf.build(); |
194 | 196 |
} |
197 |
|
|
198 |
private long countContext(OafProtos.Oaf oaf){ |
|
199 |
return oaf.getEntity().getResult().getMetadata().getContextList().stream() |
|
200 |
.flatMap(c -> c.getDataInfoList().stream()) |
|
201 |
.map(FieldTypeProtos.DataInfo::getInferenceprovenance) |
|
202 |
.filter(infProv -> "bulktagging::community".equals(infProv)) |
|
203 |
.count(); |
|
204 |
} |
|
195 | 205 |
} |
Also available in: Unified diff
modified according to the new implementation of resulttagger