Added a missing dependency

This commit is contained in:
Michele Artini 2020-02-20 11:43:32 +01:00
parent d49cd2fdc6
commit 4c94e74a84
3 changed files with 62 additions and 58 deletions

View File

@ -31,6 +31,12 @@
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dhp-common</artifactId>

View File

@ -1,12 +1,12 @@
package eu.dnetlib.dhp.schema.oaf;
import org.junit.Assert;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.junit.Assert;
public class Relation extends Oaf {
private String relType;
@ -25,7 +25,7 @@ public class Relation extends Oaf {
return relType;
}
public void setRelType(String relType) {
public void setRelType(final String relType) {
this.relType = relType;
}
@ -33,7 +33,7 @@ public class Relation extends Oaf {
return subRelType;
}
public void setSubRelType(String subRelType) {
public void setSubRelType(final String subRelType) {
this.subRelType = subRelType;
}
@ -41,7 +41,7 @@ public class Relation extends Oaf {
return relClass;
}
public void setRelClass(String relClass) {
public void setRelClass(final String relClass) {
this.relClass = relClass;
}
@ -49,7 +49,7 @@ public class Relation extends Oaf {
return source;
}
public void setSource(String source) {
public void setSource(final String source) {
this.source = source;
}
@ -57,7 +57,7 @@ public class Relation extends Oaf {
return target;
}
public void setTarget(String target) {
public void setTarget(final String target) {
this.target = target;
}
@ -65,7 +65,7 @@ public class Relation extends Oaf {
return collectedFrom;
}
public void setCollectedFrom(List<KeyValue> collectedFrom) {
public void setCollectedFrom(final List<KeyValue> collectedFrom) {
this.collectedFrom = collectedFrom;
}
@ -75,10 +75,7 @@ public class Relation extends Oaf {
Assert.assertEquals("relType(s) must be equal", getRelType(), r.getRelType());
Assert.assertEquals("subRelType(s) must be equal", getSubRelType(), r.getSubRelType());
Assert.assertEquals("relClass(es) must be equal", getRelClass(), r.getRelClass());
setCollectedFrom(
Stream.concat(
getCollectedFrom().stream(),
r.getCollectedFrom().stream())
setCollectedFrom(Stream.concat(getCollectedFrom().stream(), r.getCollectedFrom().stream())
.distinct() // relies on KeyValue.equals
.collect(Collectors.toList()));
}

View File

@ -76,7 +76,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
@ -481,6 +481,7 @@
<dhp.jackson.version>2.9.6</dhp.jackson.version>
<dhp.commons.lang.version>3.5</dhp.commons.lang.version>
<scala.version>2.11.12</scala.version>
<junit.version>4.12</junit.version>
<mongodb.driver.version>3.4.2</mongodb.driver.version>
</properties>
</project>