2020-06-30 16:17:09 +02:00
|
|
|
|
|
|
|
package eu.dnetlib.dhp.broker.oa.matchers.simple;
|
|
|
|
|
2021-08-11 12:13:22 +02:00
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
2020-06-30 16:17:09 +02:00
|
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
|
|
import eu.dnetlib.broker.objects.OaBrokerMainEntity;
|
|
|
|
|
2021-11-19 09:54:22 +01:00
|
|
|
public class EnrichMissingPublicationDateTest {
|
2020-06-30 16:17:09 +02:00
|
|
|
|
|
|
|
final EnrichMissingPublicationDate matcher = new EnrichMissingPublicationDate();
|
|
|
|
|
|
|
|
@BeforeEach
|
|
|
|
void setUp() throws Exception {
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testFindDifferences_1() {
|
|
|
|
final OaBrokerMainEntity source = new OaBrokerMainEntity();
|
|
|
|
final OaBrokerMainEntity target = new OaBrokerMainEntity();
|
|
|
|
final List<String> list = matcher.findDifferences(source, target);
|
|
|
|
assertTrue(list.isEmpty());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testFindDifferences_2() {
|
|
|
|
final OaBrokerMainEntity source = new OaBrokerMainEntity();
|
|
|
|
final OaBrokerMainEntity target = new OaBrokerMainEntity();
|
|
|
|
source.setPublicationdate("2018");
|
|
|
|
final List<String> list = matcher.findDifferences(source, target);
|
2021-08-11 12:13:22 +02:00
|
|
|
assertEquals(1, list.size());
|
2020-06-30 16:17:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testFindDifferences_3() {
|
|
|
|
final OaBrokerMainEntity source = new OaBrokerMainEntity();
|
|
|
|
final OaBrokerMainEntity target = new OaBrokerMainEntity();
|
|
|
|
target.setPublicationdate("2018");
|
|
|
|
final List<String> list = matcher.findDifferences(source, target);
|
|
|
|
assertTrue(list.isEmpty());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testFindDifferences_4() {
|
|
|
|
final OaBrokerMainEntity source = new OaBrokerMainEntity();
|
|
|
|
final OaBrokerMainEntity target = new OaBrokerMainEntity();
|
|
|
|
source.setPublicationdate("2018");
|
|
|
|
target.setPublicationdate("2018");
|
|
|
|
final List<String> list = matcher.findDifferences(source, target);
|
|
|
|
assertTrue(list.isEmpty());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|