use of org.opencastproject.util.data.Predicate in project opencast by opencast.
the class StaticMetadataServiceDublinCoreImplTest method testExtractMetadata.
@Test
public void testExtractMetadata() throws Exception {
MediaPackage mp = newMediaPackage("/manifest-simple.xml");
StaticMetadataServiceDublinCoreImpl ms = newStaticMetadataService();
StaticMetadata md = ms.getMetadata(mp);
assertEquals("Land and Vegetation: Key players on the Climate Scene", find(md.getTitles(), new Predicate<MetadataValue<String>>() {
@Override
public Boolean apply(MetadataValue<String> v) {
return v.getLanguage().equals(MetadataValues.LANGUAGE_UNDEFINED);
}
}).map(new Function<MetadataValue<String>, String>() {
@Override
public String apply(MetadataValue<String> v) {
return v.getValue();
}
}).getOrElse(""));
assertEquals(createDate(2007, 12, 5, 0, 0, 0), md.getCreated().get());
}
Aggregations