mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
CST-10635 solving conflicts to coar-notify-7
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* The contents of this file are subject to the license and copyright
|
||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||
* tree and available online at
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
package org.dspace.qaevent;
|
||||
|
||||
/**
|
||||
* Constants for Quality Assurance configurations to be used into cfg and xml spring.
|
||||
*
|
||||
* @author Francesco Bacchelli (francesco.bacchelli at 4science.it)
|
||||
*
|
||||
*/
|
||||
public class QANotifyPatterns {
|
||||
public static final String TOPIC_ENRICH_MORE_PROJECT = "ENRICH/MORE/PROJECT";
|
||||
public static final String TOPIC_ENRICH_MISSING_PROJECT = "ENRICH/MISSING/PROJECT";
|
||||
public static final String TOPIC_ENRICH_MISSING_ABSTRACT = "ENRICH/MISSING/ABSTRACT";
|
||||
public static final String TOPIC_ENRICH_MORE_REVIEW = "ENRICH/MORE/REVIEW";
|
||||
public static final String TOPIC_ENRICH_MORE_ENDORSEMENT = "ENRICH/MORE/ENDORSEMENT";
|
||||
public static final String TOPIC_ENRICH_MORE_PID = "ENRICH/MORE/PID";
|
||||
public static final String TOPIC_ENRICH_MISSING_PID = "ENRICH/MISSING/PID";
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
private QANotifyPatterns() { }
|
||||
}
|
@@ -48,6 +48,7 @@ import org.dspace.content.Item;
|
||||
import org.dspace.content.QAEvent;
|
||||
import org.dspace.matcher.QASourceMatcher;
|
||||
import org.dspace.matcher.QATopicMatcher;
|
||||
import org.dspace.qaevent.QANotifyPatterns;
|
||||
import org.dspace.qaevent.QATopic;
|
||||
import org.dspace.qaevent.service.BrokerClientFactory;
|
||||
import org.dspace.qaevent.service.QAEventService;
|
||||
@@ -59,6 +60,7 @@ import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Integration tests for {@link OpenaireEventsImport}.
|
||||
*
|
||||
@@ -173,11 +175,11 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
||||
);
|
||||
|
||||
List<QATopic> topicList = qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20);
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MORE/PROJECT", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MORE/PID", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MISSING/PID", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MISSING/PROJECT", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MISSING/ABSTRACT", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PROJECT, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1L)));
|
||||
|
||||
String projectMessage = "{\"projects[0].acronym\":\"PAThs\",\"projects[0].code\":\"687567\","
|
||||
+ "\"projects[0].funder\":\"EC\",\"projects[0].fundingProgram\":\"H2020\","
|
||||
@@ -185,18 +187,21 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
||||
+ "\"projects[0].openaireId\":\"40|corda__h2020::6e32f5eb912688f2424c68b851483ea4\","
|
||||
+ "\"projects[0].title\":\"Tracking Papyrus and Parchment Paths\"}";
|
||||
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE, "ENRICH/MORE/PROJECT", 0, 20),
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE,
|
||||
QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 0, 20),
|
||||
contains(
|
||||
pendingOpenaireEventWith("oai:www.openstarts.units.it:123456789/99998", firstItem,
|
||||
"Egypt, crossroad of translations and literary interweavings", projectMessage,
|
||||
"ENRICH/MORE/PROJECT", 1.00d)));
|
||||
QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 1.00d)));
|
||||
|
||||
String abstractMessage = "{\"abstracts[0]\":\"Missing Abstract\"}";
|
||||
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE, "ENRICH/MISSING/ABSTRACT", 0, 20),
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE,
|
||||
QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 0, 20),
|
||||
contains(
|
||||
pendingOpenaireEventWith("oai:www.openstarts.units.it:123456789/99999", secondItem, "Test Publication",
|
||||
abstractMessage, "ENRICH/MISSING/ABSTRACT", 1.00d)));
|
||||
pendingOpenaireEventWith("oai:www.openstarts.units.it:123456789/99999",
|
||||
secondItem, "Test Publication",
|
||||
abstractMessage, QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1.00d)));
|
||||
|
||||
verifyNoInteractions(mockBrokerClient);
|
||||
|
||||
@@ -231,16 +236,17 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
||||
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 3L)));
|
||||
|
||||
List<QATopic> topicList = qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20);
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MISSING/ABSTRACT", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MISSING/PROJECT", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MORE/PID", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PROJECT, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1L)));
|
||||
|
||||
String abstractMessage = "{\"abstracts[0]\":\"Missing Abstract\"}";
|
||||
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE, "ENRICH/MISSING/ABSTRACT", 0, 20),
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE,
|
||||
QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 0, 20),
|
||||
contains(
|
||||
pendingOpenaireEventWith("oai:www.openstarts.units.it:123456789/99999", item, "Test Publication",
|
||||
abstractMessage, "ENRICH/MISSING/ABSTRACT", 1.00d)));
|
||||
abstractMessage, QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1.00d)));
|
||||
|
||||
verifyNoInteractions(mockBrokerClient);
|
||||
|
||||
@@ -271,14 +277,15 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
||||
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 1L)));
|
||||
|
||||
assertThat(qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20),
|
||||
contains(QATopicMatcher.with("ENRICH/MISSING/ABSTRACT", 1L)));
|
||||
contains(QATopicMatcher.with(org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1L)));
|
||||
|
||||
String abstractMessage = "{\"abstracts[0]\":\"Missing Abstract\"}";
|
||||
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE, "ENRICH/MISSING/ABSTRACT", 0, 20),
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE,
|
||||
QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 0, 20),
|
||||
contains(
|
||||
pendingOpenaireEventWith("oai:www.openstarts.units.it:123456789/999991", secondItem, "Test Publication 2",
|
||||
abstractMessage, "ENRICH/MISSING/ABSTRACT", 1.00d)));
|
||||
abstractMessage, org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1.00d)));
|
||||
|
||||
verifyNoInteractions(mockBrokerClient);
|
||||
|
||||
@@ -347,11 +354,11 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
||||
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 6L)));
|
||||
|
||||
List<QATopic> topicList = qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20);
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MORE/PROJECT", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MORE/PID", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MISSING/PID", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MISSING/PROJECT", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MISSING/ABSTRACT", 2L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PROJECT, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 2L)));
|
||||
|
||||
String projectMessage = "{\"projects[0].acronym\":\"PAThs\",\"projects[0].code\":\"687567\","
|
||||
+ "\"projects[0].funder\":\"EC\",\"projects[0].fundingProgram\":\"H2020\","
|
||||
@@ -359,22 +366,23 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
||||
+ "\"projects[0].openaireId\":\"40|corda__h2020::6e32f5eb912688f2424c68b851483ea4\","
|
||||
+ "\"projects[0].title\":\"Tracking Papyrus and Parchment Paths\"}";
|
||||
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE, "ENRICH/MORE/PROJECT", 0, 20),
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE,
|
||||
QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 0, 20),
|
||||
contains(
|
||||
pendingOpenaireEventWith("oai:www.openstarts.units.it:123456789/99998", firstItem,
|
||||
"Egypt, crossroad of translations and literary interweavings", projectMessage,
|
||||
"ENRICH/MORE/PROJECT", 1.00d)));
|
||||
QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 1.00d)));
|
||||
|
||||
String abstractMessage = "{\"abstracts[0]\":\"Missing Abstract\"}";
|
||||
|
||||
List<QAEvent> eventList = qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE,
|
||||
"ENRICH/MISSING/ABSTRACT", 0, 20);
|
||||
QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 0, 20);
|
||||
assertThat(eventList, hasItem(
|
||||
pendingOpenaireEventWith("oai:www.openstarts.units.it:123456789/99999", secondItem, "Test Publication",
|
||||
abstractMessage, "ENRICH/MISSING/ABSTRACT", 1.00d)));
|
||||
abstractMessage, QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1.00d)));
|
||||
assertThat(eventList, hasItem(
|
||||
pendingOpenaireEventWith("oai:www.openstarts.units.it:123456789/999991", thirdItem, "Test Publication 2",
|
||||
abstractMessage, "ENRICH/MISSING/ABSTRACT", 1.00d)));
|
||||
abstractMessage, QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1.00d)));
|
||||
|
||||
verify(mockBrokerClient).listSubscriptions(openaireURL, "user@test.com");
|
||||
verify(mockBrokerClient).downloadEvents(eq(openaireURL), eq("sub1"), any());
|
||||
@@ -456,15 +464,17 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
||||
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 6L)));
|
||||
|
||||
List<QATopic> topicList = qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20);
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MORE/PROJECT", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MISSING/PID", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MORE/PID", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MISSING/PROJECT", 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with("ENRICH/MISSING/ABSTRACT", 2L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PROJECT, 1L)));
|
||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 2L)));
|
||||
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE, "ENRICH/MORE/PROJECT", 0, 20),
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE,
|
||||
QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 0, 20),
|
||||
hasSize(1));
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE, "ENRICH/MISSING/ABSTRACT", 0, 20),
|
||||
assertThat(qaEventService.findEventsByTopicAndPage(context, OPENAIRE_SOURCE,
|
||||
QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 0, 20),
|
||||
hasSize(2));
|
||||
|
||||
verify(mockBrokerClient).listSubscriptions(openaireURL, "user@test.com");
|
||||
@@ -496,7 +506,7 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
||||
ScriptLauncher.handleScript(args, ScriptLauncher.getConfig(kernelImpl), handler, kernelImpl);
|
||||
|
||||
assertThat(qaEventService.findAllTopicsBySource(context, COAR_NOTIFY_SOURCE, 0, 20), contains(
|
||||
QATopicMatcher.with("ENRICH/MORE/REVIEW", 1L)));
|
||||
QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW, 1L)));
|
||||
|
||||
assertThat(qaEventService.findAllSources(context, 0, 20),
|
||||
hasItem(QASourceMatcher.with(COAR_NOTIFY_SOURCE, 1L)));
|
||||
|
@@ -35,6 +35,7 @@ import org.dspace.content.Community;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.matcher.QASourceMatcher;
|
||||
import org.dspace.matcher.QATopicMatcher;
|
||||
import org.dspace.qaevent.QANotifyPatterns;
|
||||
import org.dspace.qaevent.service.QAEventService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
@@ -42,6 +43,12 @@ import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
||||
/**
|
||||
* LDN Controller test class. Simulate receiving external LDN messages
|
||||
* @author Francesco Bacchelli (francesco.bacchelli at 4science.it)
|
||||
*
|
||||
*/
|
||||
|
||||
public class LDNInboxControllerIT extends AbstractControllerIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
@@ -59,7 +66,6 @@ public class LDNInboxControllerIT extends AbstractControllerIntegrationTest {
|
||||
Collection collection = CollectionBuilder.createCollection(context, community).build();
|
||||
Item item = ItemBuilder.createItem(context, collection).build();
|
||||
String object = configurationService.getProperty("dspace.ui.url") + "/handle/" + item.getHandle();
|
||||
String object_handle = item.getHandle();
|
||||
NotifyServiceEntity notifyServiceEntity =
|
||||
NotifyServiceBuilder.createNotifyServiceBuilder(context)
|
||||
.withName("service name")
|
||||
@@ -95,7 +101,6 @@ public class LDNInboxControllerIT extends AbstractControllerIntegrationTest {
|
||||
Item item = ItemBuilder.createItem(context, collection).build();
|
||||
InputStream announceReviewStream = getClass().getResourceAsStream("ldn_announce_review.json");
|
||||
String object = configurationService.getProperty("dspace.ui.url") + "/handle/" + item.getHandle();
|
||||
String object_handle = item.getHandle();
|
||||
NotifyServiceEntity notifyServiceEntity = NotifyServiceBuilder.createNotifyServiceBuilder(context)
|
||||
.withName("service name")
|
||||
.withDescription("service description")
|
||||
@@ -122,7 +127,8 @@ public class LDNInboxControllerIT extends AbstractControllerIntegrationTest {
|
||||
hasItem(QASourceMatcher.with(COAR_NOTIFY_SOURCE, 1L)));
|
||||
|
||||
assertThat(qaEventService.findAllTopicsBySource(context, COAR_NOTIFY_SOURCE, 0, 20), hasItem(
|
||||
QATopicMatcher.with("ENRICH/MORE/REVIEW", 1L)));
|
||||
QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW, 1L)));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -54,6 +54,7 @@ import org.dspace.content.QAEvent;
|
||||
import org.dspace.content.QAEventProcessed;
|
||||
import org.dspace.content.service.ItemService;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.qaevent.QANotifyPatterns;
|
||||
import org.dspace.qaevent.action.ASimpleMetadataAction;
|
||||
import org.dspace.qaevent.dao.QAEventsDao;
|
||||
import org.hamcrest.Matchers;
|
||||
@@ -97,17 +98,17 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
parentCommunity = CommunityBuilder.createCommunity(context).withName("Parent Community").build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEvent event1 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEvent event2 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 4")
|
||||
.withTopic("ENRICH/MISSING/ABSTRACT")
|
||||
.withTopic(org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT)
|
||||
.withMessage("{\"abstracts[0]\": \"Descrizione delle caratteristiche...\"}").build();
|
||||
EPerson anotherSubmitter = EPersonBuilder.createEPerson(context).withEmail("another-submitter@example.com")
|
||||
.withPassword(password).build();
|
||||
context.setCurrentUser(anotherSubmitter);
|
||||
QAEvent event3 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withSource(COAR_NOTIFY_SOURCE)
|
||||
.withTopic("ENRICH/MORE/REVIEW")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW)
|
||||
.withMessage("{\"abstracts[0]\": \"Descrizione delle caratteristiche...\"}").build();
|
||||
context.restoreAuthSystemState();
|
||||
String authToken = getAuthToken(admin.getEmail(), password);
|
||||
@@ -133,10 +134,10 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
parentCommunity = CommunityBuilder.createCommunity(context).withName("Parent Community").build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEvent event1 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEvent event5 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 5")
|
||||
.withTopic("ENRICH/MISSING/PROJECT")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PROJECT)
|
||||
.withMessage(
|
||||
"{\"projects[0].acronym\":\"PAThs\","
|
||||
+ "\"projects[0].code\":\"687567\","
|
||||
@@ -167,7 +168,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
parentCommunity = CommunityBuilder.createCommunity(context).withName("Parent Community").build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEvent event1 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
context.restoreAuthSystemState();
|
||||
getClient().perform(get("/api/integration/qualityassuranceevents/" + event1.getEventId()))
|
||||
@@ -180,14 +181,14 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
parentCommunity = CommunityBuilder.createCommunity(context).withName("Parent Community").build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEvent event1 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
EPerson anotherSubmitter = EPersonBuilder.createEPerson(context).withEmail("another_submitter@example.com")
|
||||
.build();
|
||||
context.setCurrentUser(anotherSubmitter);
|
||||
QAEvent event2 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withSource(COAR_NOTIFY_SOURCE)
|
||||
.withTopic("ENRICH/MORE/REVIEW")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW)
|
||||
.withMessage("{\"href\":\"https://doi.org/10.2307/2144300\"}").build();
|
||||
context.restoreAuthSystemState();
|
||||
String authToken = getAuthToken(eperson.getEmail(), password);
|
||||
@@ -206,12 +207,12 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
Item item = ItemBuilder.createItem(context, col1).withTitle("Tracking Papyrus and Parchment Paths")
|
||||
.build();
|
||||
QAEvent event1 = QAEventBuilder.createTarget(context, item)
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}")
|
||||
.build();
|
||||
QAEvent event2 = QAEventBuilder.createTarget(context, item)
|
||||
.withSource(COAR_NOTIFY_SOURCE)
|
||||
.withTopic("ENRICH/MORE/REVIEW")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW)
|
||||
.withMessage("{\"href\":\"https://doi.org/10.2307/2144301\"}").build();
|
||||
EPerson anotherSubmitter = EPersonBuilder.createEPerson(context).withEmail("another-submitter@example.com")
|
||||
.withPassword(password).build();
|
||||
@@ -219,7 +220,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
// this event is related to a new item not submitted by eperson
|
||||
QAEvent event3 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withSource(COAR_NOTIFY_SOURCE)
|
||||
.withTopic("ENRICH/MORE/REVIEW")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW)
|
||||
.withMessage("{\"href\":\"https://doi.org/10.2307/2144300\"}").build();
|
||||
context.restoreAuthSystemState();
|
||||
String authToken = getAuthToken(admin.getEmail(), password);
|
||||
@@ -321,45 +322,45 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
parentCommunity = CommunityBuilder.createCommunity(context).withName("Parent Community").build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEvent event1 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEvent event2 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 2")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144301\"}").build();
|
||||
QAEvent event3 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 3")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144302\"}").build();
|
||||
QAEvent event4 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 4")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmc\",\"pids[0].value\":\"2144303\"}").build();
|
||||
QAEvent event5 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 5")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmid\",\"pids[0].value\":\"2144304\"}").build();
|
||||
QAEvent event6 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withSource(OPENAIRE_SOURCE)
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEvent event7 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 2")
|
||||
.withSource(OPENAIRE_SOURCE)
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144301\"}").build();
|
||||
QAEvent event8 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 3")
|
||||
.withSource(OPENAIRE_SOURCE)
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144302\"}").build();
|
||||
QAEvent event9 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 4")
|
||||
.withSource(OPENAIRE_SOURCE)
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmc\",\"pids[0].value\":\"2144303\"}").build();
|
||||
QAEvent event10 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 5")
|
||||
.withSource(OPENAIRE_SOURCE)
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmid\",\"pids[0].value\":\"2144304\"}").build();
|
||||
context.setCurrentUser(admin);
|
||||
// this event will be related to an item submitted by the admin
|
||||
QAEvent event11 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 5")
|
||||
.withSource(OPENAIRE_SOURCE)
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmid\",\"pids[0].value\":\"2144304\"}").build();
|
||||
|
||||
context.restoreAuthSystemState();
|
||||
@@ -509,16 +510,16 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
parentCommunity = CommunityBuilder.createCommunity(context).withName("Parent Community").build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEvent event1 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEvent event2 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 2")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144301\"}").build();
|
||||
QAEvent event3 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 3")
|
||||
.withTopic("ENRICH/MORE/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmid\",\"pids[0].value\":\"10.2307/2144302\"}").build();
|
||||
QAEvent event4 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 4")
|
||||
.withTopic("ENRICH/MISSING/ABSTRACT")
|
||||
.withTopic(org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT)
|
||||
.withMessage("{\"abstracts[0]\": \"Descrizione delle caratteristiche...\"}").build();
|
||||
context.restoreAuthSystemState();
|
||||
getClient()
|
||||
@@ -534,16 +535,16 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
parentCommunity = CommunityBuilder.createCommunity(context).withName("Parent Community").build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEvent event1 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEvent event2 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 2")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144301\"}").build();
|
||||
QAEvent event3 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 3")
|
||||
.withTopic("ENRICH/MORE/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmid\",\"pids[0].value\":\"10.2307/2144302\"}").build();
|
||||
QAEvent event4 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 4")
|
||||
.withTopic("ENRICH/MISSING/ABSTRACT")
|
||||
.withTopic(org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT)
|
||||
.withMessage("{\"abstracts[0]\": \"Descrizione delle caratteristiche...\"}").build();
|
||||
context.restoreAuthSystemState();
|
||||
String adminToken = getAuthToken(admin.getEmail(), password);
|
||||
@@ -569,7 +570,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
Item funding = ItemBuilder.createItem(context, colFunding).withTitle("Tracking Papyrus and Parchment Paths")
|
||||
.build();
|
||||
QAEvent eventProjectBound = QAEventBuilder.createTarget(context, col1, "Science and Freedom with project")
|
||||
.withTopic("ENRICH/MISSING/PROJECT")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PROJECT)
|
||||
.withMessage(
|
||||
"{\"projects[0].acronym\":\"PAThs\","
|
||||
+ "\"projects[0].code\":\"687567\","
|
||||
@@ -585,7 +586,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.build();
|
||||
QAEvent eventProjectNoBound = QAEventBuilder
|
||||
.createTarget(context, col1, "Science and Freedom with unrelated project")
|
||||
.withTopic("ENRICH/MISSING/PROJECT")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PROJECT)
|
||||
.withMessage(
|
||||
"{\"projects[0].acronym\":\"NEW\","
|
||||
+ "\"projects[0].code\":\"123456\","
|
||||
@@ -596,24 +597,24 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
+ "\"projects[0].title\":\"A new project\"}")
|
||||
.build();
|
||||
QAEvent eventMissingPID1 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEvent eventMissingPID2 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 2")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144301\"}").build();
|
||||
QAEvent eventMissingUnknownPID = QAEventBuilder.createTarget(context, col1, "Science and Freedom URN PID")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage(
|
||||
"{\"pids[0].type\":\"urn\",\"pids[0].value\":\"http://thesis2.sba.units.it/store/handle/item/12937\"}")
|
||||
.build();
|
||||
QAEvent eventMorePID = QAEventBuilder.createTarget(context, col1, "Science and Freedom 3")
|
||||
.withTopic("ENRICH/MORE/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmid\",\"pids[0].value\":\"2144302\"}").build();
|
||||
QAEvent eventAbstract = QAEventBuilder.createTarget(context, col1, "Science and Freedom 4")
|
||||
.withTopic("ENRICH/MISSING/ABSTRACT")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT)
|
||||
.withMessage("{\"abstracts[0]\": \"An abstract to add...\"}").build();
|
||||
QAEvent eventAbstractToDiscard = QAEventBuilder.createTarget(context, col1, "Science and Freedom 7")
|
||||
.withTopic("ENRICH/MISSING/ABSTRACT")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT)
|
||||
.withMessage("{\"abstracts[0]\": \"Abstract to discard...\"}").build();
|
||||
context.restoreAuthSystemState();
|
||||
// prepare the different patches for our decisions
|
||||
@@ -831,7 +832,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
Collection colFunding = CollectionBuilder.createCollection(context, parentCommunity)
|
||||
.withName("Collection Fundings").build();
|
||||
QAEvent event = QAEventBuilder.createTarget(context, col1, "Science and Freedom 5")
|
||||
.withTopic("ENRICH/MISSING/PROJECT")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PROJECT)
|
||||
.withMessage(
|
||||
"{\"projects[0].acronym\":\"PAThs\","
|
||||
+ "\"projects[0].code\":\"687567\","
|
||||
@@ -880,7 +881,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
Item funding = ItemBuilder.createItem(context, colFunding).withTitle("Tracking Papyrus and Parchment Paths")
|
||||
.build();
|
||||
QAEvent event = QAEventBuilder.createTarget(context, col1, "Science and Freedom 5")
|
||||
.withTopic("ENRICH/MISSING/PROJECT")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PROJECT)
|
||||
.withMessage(
|
||||
"{\"projects[0].acronym\":\"PAThs\","
|
||||
+ "\"projects[0].code\":\"687567\","
|
||||
@@ -923,7 +924,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
Collection colFunding = CollectionBuilder.createCollection(context, parentCommunity)
|
||||
.withName("Collection Fundings").build();
|
||||
QAEvent event = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
Item funding = ItemBuilder.createItem(context, colFunding).withTitle("Tracking Papyrus and Parchment Paths")
|
||||
.build();
|
||||
@@ -951,10 +952,10 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
parentCommunity = CommunityBuilder.createCommunity(context).withName("Parent Community").build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEvent event1 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEvent event2 = QAEventBuilder.createTarget(context, col1, "Science and Freedom 2")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144301\"}").build();
|
||||
context.restoreAuthSystemState();
|
||||
String authToken = getAuthToken(admin.getEmail(), password);
|
||||
@@ -997,7 +998,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.build();
|
||||
|
||||
QAEvent event = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}")
|
||||
.build();
|
||||
|
||||
@@ -1041,7 +1042,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
QAEventBuilder.createTarget(context, item)
|
||||
.withSource(COAR_NOTIFY_SOURCE)
|
||||
.withTrust(0.8)
|
||||
.withTopic("ENRICH/MORE/REVIEW")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW)
|
||||
.withMessage("{"
|
||||
+ "\"href\": \"https://doi.org/10.3214/987654\","
|
||||
+ "\"relationship\": \"some-rel\"}")
|
||||
@@ -1070,7 +1071,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
QAEventBuilder.createTarget(context, item)
|
||||
.withSource(COAR_NOTIFY_SOURCE)
|
||||
.withTrust(0.4)
|
||||
.withTopic("ENRICH/MORE/REVIEW")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW)
|
||||
.withMessage("{\"abstracts[0]\": \"https://doi.org/10.3214/987654\"}")
|
||||
.build();
|
||||
|
||||
@@ -1096,7 +1097,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
QAEventBuilder.createTarget(context, item)
|
||||
.withSource(COAR_NOTIFY_SOURCE)
|
||||
.withTrust(0.3)
|
||||
.withTopic("ENRICH/MORE/REVIEW")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW)
|
||||
.withMessage("{\"abstracts[0]\": \"https://doi.org/10.3214/987654\"}")
|
||||
.build();
|
||||
|
||||
@@ -1122,7 +1123,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
QAEventBuilder.createTarget(context, item)
|
||||
.withSource(COAR_NOTIFY_SOURCE)
|
||||
.withTrust(0.7)
|
||||
.withTopic("ENRICH/MORE/REVIEW")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW)
|
||||
.withMessage("{\"abstracts[0]\": \"https://doi.org/10.3214/987654\"}")
|
||||
.build();
|
||||
|
||||
@@ -1150,7 +1151,7 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
QAEventBuilder.createTarget(context, item)
|
||||
.withSource(COAR_NOTIFY_SOURCE)
|
||||
.withTrust(0.8)
|
||||
.withTopic("ENRICH/MORE/REVIEW")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW)
|
||||
.withMessage("{\"abstracts[0]\": \"https://doi.org/10.3214/987654\"}")
|
||||
.build();
|
||||
|
||||
|
@@ -97,17 +97,16 @@ public class QASourceRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
matchQASourceEntry("test-source-2", 0))))
|
||||
.andExpect(jsonPath("$.page.size", is(20)))
|
||||
.andExpect(jsonPath("$.page.totalElements", is(4)));
|
||||
|
||||
// check with our eperson submitter
|
||||
authToken = getAuthToken(eperson.getEmail(), password);
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancesources"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(contentType))
|
||||
.andExpect(jsonPath("$._embedded.qualityassurancesources", contains(
|
||||
matchQASourceEntry("coar-notify", 2),
|
||||
matchQASourceEntry("openaire", 0),
|
||||
matchQASourceEntry("test-source", 0),
|
||||
matchQASourceEntry("test-source-2", 0))))
|
||||
matchQASourceEntry("coar-notify", 3))))
|
||||
.andExpect(jsonPath("$.page.size", is(20)))
|
||||
.andExpect(jsonPath("$.page.totalElements", is(4)));
|
||||
|
||||
.andExpect(jsonPath("$.page.totalElements", is(1)));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -130,16 +129,16 @@ public class QASourceRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
createEvent("openaire", "TOPIC/OPENAIRE/1", "Title 1");
|
||||
createEvent("openaire", "TOPIC/OPENAIRE/2", "Title 2");
|
||||
createEvent("openaire", "TOPIC/OPENAIRE/2", "Title 3");
|
||||
createEvent(QAEvent.OPENAIRE_SOURCE, "TOPIC/OPENAIRE/1", "Title 1");
|
||||
createEvent(QAEvent.OPENAIRE_SOURCE, "TOPIC/OPENAIRE/2", "Title 2");
|
||||
createEvent(QAEvent.OPENAIRE_SOURCE, "TOPIC/OPENAIRE/2", "Title 3");
|
||||
|
||||
createEvent("test-source", "TOPIC/TEST/1", "Title 4");
|
||||
createEvent("test-source", "TOPIC/TEST/1", "Title 5");
|
||||
createEvent("coar-notify", "TOPIC", "Title 7");
|
||||
createEvent(QAEvent.COAR_NOTIFY_SOURCE, "TOPIC", "Title 7");
|
||||
context.setCurrentUser(eperson);
|
||||
createEvent("coar-notify", "TOPIC", "Title 8");
|
||||
createEvent("coar-notify", "TOPIC", "Title 9");
|
||||
createEvent(QAEvent.COAR_NOTIFY_SOURCE, "TOPIC", "Title 8");
|
||||
createEvent(QAEvent.COAR_NOTIFY_SOURCE, "TOPIC", "Title 9");
|
||||
context.setCurrentUser(null);
|
||||
context.restoreAuthSystemState();
|
||||
|
||||
@@ -172,8 +171,8 @@ public class QASourceRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancesources/openaire"))
|
||||
.andExpect(status().isForbidden());
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancesources/unknown-test-source"))
|
||||
.andExpect(status().isNotFound());
|
||||
// the eperson will see only 2 events in coar-notify as 1 is related ot an item was submitted by other
|
||||
.andExpect(status().isForbidden());
|
||||
// the eperson will see only 2 events in coar-notify as 1 is related to an item was submitted by other
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancesources/coar-notify"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(contentType))
|
||||
@@ -203,7 +202,7 @@ public class QASourceRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
createEvent("openaire", "TOPIC/OPENAIRE/1", "Title 1");
|
||||
createEvent(QAEvent.OPENAIRE_SOURCE, "TOPIC/OPENAIRE/1", "Title 1");
|
||||
createEvent("test-source", "TOPIC/TEST/1", "Title 4");
|
||||
|
||||
context.restoreAuthSystemState();
|
||||
@@ -221,17 +220,17 @@ public class QASourceRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
Collection col = CollectionBuilder.createCollection(context, com).withName("Test collection").build();
|
||||
Item target1 = ItemBuilder.createItem(context, col).withTitle("Test item1").build();
|
||||
Item target2 = ItemBuilder.createItem(context, col).withTitle("Test item2").build();
|
||||
createEvent("openaire", "TOPIC/OPENAIRE/1", target1);
|
||||
createEvent("openaire", "TOPIC/OPENAIRE/2", target1);
|
||||
createEvent(QAEvent.OPENAIRE_SOURCE, "TOPIC/OPENAIRE/1", target1);
|
||||
createEvent(QAEvent.OPENAIRE_SOURCE, "TOPIC/OPENAIRE/2", target1);
|
||||
createEvent("test-source", "TOPIC/TEST/1", target1);
|
||||
createEvent("test-source", "TOPIC/TEST/1", target2);
|
||||
|
||||
context.setCurrentUser(eperson);
|
||||
Item target3 = ItemBuilder.createItem(context, col).withTitle("Test item3").build();
|
||||
context.setCurrentUser(null);
|
||||
createEvent("coar-notify", "TOPIC", target3);
|
||||
createEvent("coar-notify", "TOPIC", target3);
|
||||
createEvent("coar-notify", "TOPIC", target2);
|
||||
createEvent(QAEvent.COAR_NOTIFY_SOURCE, "TOPIC", target3);
|
||||
createEvent(QAEvent.COAR_NOTIFY_SOURCE, "TOPIC2", target3);
|
||||
createEvent(QAEvent.COAR_NOTIFY_SOURCE, "TOPIC", target2);
|
||||
context.restoreAuthSystemState();
|
||||
|
||||
String authToken = getAuthToken(admin.getEmail(), password);
|
||||
@@ -240,7 +239,7 @@ public class QASourceRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
target1.getID().toString()))
|
||||
.andExpect(status().isOk()).andExpect(content().contentType(contentType))
|
||||
.andExpect(jsonPath("$._embedded.qualityassurancesources",
|
||||
contains(matchQASourceEntry("openaire:" + target1.getID().toString(), 2),
|
||||
contains(matchQASourceEntry(QAEvent.OPENAIRE_SOURCE + ":" + target1.getID().toString(), 2),
|
||||
matchQASourceEntry("test-source:" + target1.getID().toString(), 1))))
|
||||
.andExpect(jsonPath("$.page.size", is(20)))
|
||||
.andExpect(jsonPath("$.page.totalElements", is(2)));
|
||||
@@ -251,7 +250,7 @@ public class QASourceRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
.andExpect(status().isOk()).andExpect(content().contentType(contentType))
|
||||
.andExpect(jsonPath("$._embedded.qualityassurancesources",
|
||||
contains(
|
||||
matchQASourceEntry("coar-notify:" + target2.getID().toString(), 1),
|
||||
matchQASourceEntry(QAEvent.COAR_NOTIFY_SOURCE + ":" + target2.getID().toString(), 1),
|
||||
matchQASourceEntry("test-source:" + target2.getID().toString(), 1))))
|
||||
.andExpect(jsonPath("$.page.size", is(20)))
|
||||
.andExpect(jsonPath("$.page.totalElements", is(2)));
|
||||
@@ -260,7 +259,7 @@ public class QASourceRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
target3.getID().toString()))
|
||||
.andExpect(status().isOk()).andExpect(content().contentType(contentType))
|
||||
.andExpect(jsonPath("$._embedded.qualityassurancesources",
|
||||
contains(matchQASourceEntry("coar-notify:" + target3.getID().toString(), 2))))
|
||||
contains(matchQASourceEntry("coar-notify:" + target3.getID().toString(), 2))))
|
||||
.andExpect(jsonPath("$.page.size", is(20)))
|
||||
.andExpect(jsonPath("$.page.totalElements", is(1)));
|
||||
|
||||
@@ -277,7 +276,7 @@ public class QASourceRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
target2.getID().toString()))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$.page.size", is(20)))
|
||||
.andExpect(jsonPath("$.page.totalElements", is(0)));
|
||||
.andExpect(jsonPath("$.page.totalElements", is(1)));
|
||||
getClient(authToken)
|
||||
.perform(get("/api/integration/qualityassurancesources/search/byTarget").param("target",
|
||||
target3.getID().toString()))
|
||||
@@ -296,8 +295,8 @@ public class QASourceRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
Collection col = CollectionBuilder.createCollection(context, com).withName("Test collection").build();
|
||||
Item target1 = ItemBuilder.createItem(context, col).withTitle("Test item1").build();
|
||||
Item target2 = ItemBuilder.createItem(context, col).withTitle("Test item2").build();
|
||||
createEvent("openaire", "TOPIC/OPENAIRE/1", target1);
|
||||
createEvent("openaire", "TOPIC/OPENAIRE/2", target1);
|
||||
createEvent(QAEvent.OPENAIRE_SOURCE, "TOPIC/OPENAIRE/1", target1);
|
||||
createEvent(QAEvent.OPENAIRE_SOURCE, "TOPIC/OPENAIRE/2", target1);
|
||||
createEvent("test-source", "TOPIC/TEST/1", target1);
|
||||
createEvent("test-source", "TOPIC/TEST/1", target2);
|
||||
|
||||
@@ -318,8 +317,8 @@ public class QASourceRestRepositoryIT extends AbstractControllerIntegrationTest
|
||||
Collection col = CollectionBuilder.createCollection(context, com).withName("Test collection").build();
|
||||
Item target1 = ItemBuilder.createItem(context, col).withTitle("Test item1").build();
|
||||
Item target2 = ItemBuilder.createItem(context, col).withTitle("Test item2").build();
|
||||
createEvent("openaire", "TOPIC/OPENAIRE/1", target1);
|
||||
createEvent("openaire", "TOPIC/OPENAIRE/2", target1);
|
||||
createEvent(QAEvent.OPENAIRE_SOURCE, "TOPIC/OPENAIRE/1", target1);
|
||||
createEvent(QAEvent.OPENAIRE_SOURCE, "TOPIC/OPENAIRE/2", target1);
|
||||
createEvent("test-source", "TOPIC/TEST/1", target1);
|
||||
createEvent("test-source", "TOPIC/TEST/1", target2);
|
||||
|
||||
|
@@ -25,6 +25,7 @@ import org.dspace.builder.QAEventBuilder;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.QAEvent;
|
||||
import org.dspace.qaevent.QANotifyPatterns;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Test;
|
||||
@@ -49,16 +50,16 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom 2")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144301\"}").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom 3")
|
||||
.withTopic("ENRICH/MORE/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmid\",\"pids[0].value\":\"10.2307/2144302\"}").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom 4")
|
||||
.withTopic("ENRICH/MISSING/ABSTRACT")
|
||||
.withTopic(org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT)
|
||||
.withMessage(
|
||||
"{\"abstracts[0]\": \"Descrizione delle caratteristiche...\"}")
|
||||
.build();
|
||||
@@ -78,16 +79,16 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom 2")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144301\"}").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom 3")
|
||||
.withTopic("ENRICH/MORE/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmid\",\"pids[0].value\":\"10.2307/2144302\"}").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom 4")
|
||||
.withTopic("ENRICH/MISSING/ABSTRACT")
|
||||
.withTopic(org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT)
|
||||
.withMessage(
|
||||
"{\"test\": \"Test...\"}")
|
||||
.build();
|
||||
@@ -101,13 +102,16 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
String authToken = getAuthToken(admin.getEmail(), password);
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancetopics/openaire:ENRICH!MISSING!PID"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$", QATopicMatcher.matchQATopicEntry("ENRICH/MISSING/PID", 2)));
|
||||
.andExpect(jsonPath("$",
|
||||
QATopicMatcher.matchQATopicEntry(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID, 2)));
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancetopics/openaire:ENRICH!MISSING!ABSTRACT"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$", QATopicMatcher.matchQATopicEntry("ENRICH/MISSING/ABSTRACT", 1)));
|
||||
.andExpect(jsonPath("$",
|
||||
QATopicMatcher.matchQATopicEntry(QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1)));
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancetopics/test-source:TOPIC!TEST"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$", QATopicMatcher.matchQATopicEntry("test-source", "TOPIC/TEST", 1)));
|
||||
.andExpect(jsonPath("$",
|
||||
QATopicMatcher.matchQATopicEntry("test-source", "TOPIC/TEST", 1)));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -120,7 +124,7 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
context.restoreAuthSystemState();
|
||||
String authToken = getAuthToken(admin.getEmail(), password);
|
||||
@@ -144,7 +148,7 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID").build();
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID).build();
|
||||
context.restoreAuthSystemState();
|
||||
getClient().perform(get("/api/integration/qualityassurancetopics/openaire:ENRICH!MISSING!PID"))
|
||||
.andExpect(status().isUnauthorized());
|
||||
@@ -160,7 +164,7 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID").build();
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID).build();
|
||||
context.restoreAuthSystemState();
|
||||
String authToken = getAuthToken(eperson.getEmail(), password);
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancetopics/openaire:ENRICH!MISSING!PID"))
|
||||
@@ -179,16 +183,16 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom 2")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144301\"}").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom 3")
|
||||
.withTopic("ENRICH/MORE/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmid\",\"pids[0].value\":\"10.2307/2144302\"}").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom 4")
|
||||
.withTopic("ENRICH/MISSING/ABSTRACT")
|
||||
.withTopic(org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT)
|
||||
.withMessage(
|
||||
"{\"abstracts[0]\": \"Descrizione delle caratteristiche...\"}")
|
||||
.build();
|
||||
@@ -211,9 +215,10 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(contentType))
|
||||
.andExpect(jsonPath("$._embedded.qualityassurancetopics",
|
||||
Matchers.containsInAnyOrder(QATopicMatcher.matchQATopicEntry("ENRICH/MISSING/PID", 2),
|
||||
QATopicMatcher.matchQATopicEntry("ENRICH/MISSING/ABSTRACT", 1),
|
||||
QATopicMatcher.matchQATopicEntry("ENRICH/MORE/PID", 1))))
|
||||
Matchers.containsInAnyOrder(
|
||||
QATopicMatcher.matchQATopicEntry(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID, 2),
|
||||
QATopicMatcher.matchQATopicEntry(QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1),
|
||||
QATopicMatcher.matchQATopicEntry(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1))))
|
||||
.andExpect(jsonPath("$.page.size", is(20))).andExpect(jsonPath("$.page.totalElements", is(3)));
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancetopics/search/bySource")
|
||||
.param("source", "test-source"))
|
||||
@@ -242,16 +247,16 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
//create collection
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom 2")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144301\"}").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom 3")
|
||||
.withTopic("ENRICH/MORE/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MORE_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmid\",\"pids[0].value\":\"10.2307/2144302\"}").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom 4")
|
||||
.withTopic("ENRICH/MISSING/ABSTRACT")
|
||||
.withTopic(org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT)
|
||||
.withMessage(
|
||||
"{\"abstracts[0]\": \"Descrizione delle caratteristiche...\"}")
|
||||
.build();
|
||||
@@ -301,7 +306,7 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID").build();
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID).build();
|
||||
context.restoreAuthSystemState();
|
||||
getClient().perform(get("/api/integration/qualityassurancetopics/search/bySource")
|
||||
.param("source", "openaire"))
|
||||
@@ -316,7 +321,7 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.build();
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||
.withTopic("ENRICH/MISSING/PID").build();
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID).build();
|
||||
context.restoreAuthSystemState();
|
||||
String authToken = getAuthToken(eperson.getEmail(), password);
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancetopics/search/bySource")
|
||||
@@ -337,12 +342,12 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
Item item1 = ItemBuilder.createItem(context, col1).withTitle("Science and Freedom").build();
|
||||
Item item2 = ItemBuilder.createItem(context, col1).withTitle("Science and Freedom 2").build();
|
||||
QAEventBuilder.createTarget(context, item1)
|
||||
.withSource("openaire")
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withSource(QAEvent.OPENAIRE_SOURCE)
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}").build();
|
||||
QAEventBuilder.createTarget(context, item1)
|
||||
.withSource("openaire")
|
||||
.withTopic("ENRICH/MISSING/ABSTRACT")
|
||||
.withSource(QAEvent.OPENAIRE_SOURCE)
|
||||
.withTopic(org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT)
|
||||
.withMessage(
|
||||
"{\"abstracts[0]\": \"Descrizione delle caratteristiche...\"}")
|
||||
.build();
|
||||
@@ -355,24 +360,26 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.withSource("test-source")
|
||||
.build();
|
||||
QAEventBuilder.createTarget(context, item2)
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144301\"}").build();
|
||||
QAEventBuilder.createTarget(context, item2)
|
||||
.withTopic("ENRICH/MISSING/PID")
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID)
|
||||
.withMessage("{\"pids[0].type\":\"pmid\",\"pids[0].value\":\"2144301\"}").build();
|
||||
context.restoreAuthSystemState();
|
||||
String authToken = getAuthToken(admin.getEmail(), password);
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancetopics/search/byTarget")
|
||||
.param("target", item1.getID().toString())
|
||||
.param("source", "openaire"))
|
||||
.param("source", QAEvent.OPENAIRE_SOURCE))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(contentType))
|
||||
.andExpect(jsonPath("$._embedded.qualityassurancetopics",
|
||||
Matchers.containsInAnyOrder(
|
||||
QATopicMatcher.matchQATopicEntry("openaire", "ENRICH/MISSING/PID",
|
||||
QATopicMatcher.matchQATopicEntry(QAEvent.OPENAIRE_SOURCE,
|
||||
QANotifyPatterns.TOPIC_ENRICH_MISSING_PID,
|
||||
item1.getID().toString(), 1),
|
||||
QATopicMatcher.matchQATopicEntry("openaire", "ENRICH/MISSING/ABSTRACT",
|
||||
item1.getID().toString(), 1))))
|
||||
QATopicMatcher.matchQATopicEntry(QAEvent.OPENAIRE_SOURCE,
|
||||
QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT,
|
||||
item1.getID().toString(), 1))))
|
||||
.andExpect(jsonPath("$.page.size", is(20))).andExpect(jsonPath("$.page.totalElements", is(2)));
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancetopics/search/byTarget")
|
||||
.param("target", item2.getID().toString())
|
||||
@@ -381,12 +388,13 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.andExpect(content().contentType(contentType))
|
||||
.andExpect(jsonPath("$._embedded.qualityassurancetopics",
|
||||
Matchers.containsInAnyOrder(
|
||||
QATopicMatcher.matchQATopicEntry("openaire", "ENRICH/MISSING/PID",
|
||||
QATopicMatcher.matchQATopicEntry(QAEvent.OPENAIRE_SOURCE,
|
||||
QANotifyPatterns.TOPIC_ENRICH_MISSING_PID,
|
||||
item2.getID().toString(), 2))))
|
||||
.andExpect(jsonPath("$.page.size", is(20))).andExpect(jsonPath("$.page.totalElements", is(1)));
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancetopics/search/byTarget")
|
||||
.param("target", UUID.randomUUID().toString())
|
||||
.param("source", "openaire"))
|
||||
.param("source", QAEvent.OPENAIRE_SOURCE))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(contentType))
|
||||
.andExpect(jsonPath("$._embedded.qualityassurancetopics").doesNotExist())
|
||||
@@ -410,10 +418,10 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
Item item1 = ItemBuilder.createItem(context, col1).withTitle("Science and Freedom").build();
|
||||
QAEventBuilder.createTarget(context, item1)
|
||||
.withTopic("ENRICH/MISSING/PID").build();
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID).build();
|
||||
context.restoreAuthSystemState();
|
||||
getClient().perform(get("/api/integration/qualityassurancetopics/search/byTarget")
|
||||
.param("source", "openaire")
|
||||
.param("source", QAEvent.OPENAIRE_SOURCE)
|
||||
.param("target", item1.getID().toString()))
|
||||
.andExpect(status().isUnauthorized());
|
||||
}
|
||||
@@ -427,7 +435,7 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build();
|
||||
Item item1 = ItemBuilder.createItem(context, col1).withTitle("Science and Freedom").build();
|
||||
QAEventBuilder.createTarget(context, item1)
|
||||
.withTopic("ENRICH/MISSING/PID").build();
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID).build();
|
||||
context.restoreAuthSystemState();
|
||||
String authToken = getAuthToken(eperson.getEmail(), password);
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancetopics/search/byTarget")
|
||||
@@ -446,7 +454,7 @@ public class QATopicRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
Item item1 = ItemBuilder.createItem(context, col1).withTitle("Science and Freedom").build();
|
||||
QAEventBuilder.createTarget(context, item1)
|
||||
.withSource("test-source")
|
||||
.withTopic("ENRICH/MISSING/PID").build();
|
||||
.withTopic(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID).build();
|
||||
context.restoreAuthSystemState();
|
||||
String authToken = getAuthToken(eperson.getEmail(), password);
|
||||
getClient(authToken).perform(get("/api/integration/qualityassurancetopics/search/byTarget")
|
||||
|
@@ -23,14 +23,27 @@
|
||||
<map>
|
||||
<!--The key are the TOPIC, the value must be a valid implementation of the
|
||||
org.dspace.qaevent.QAEventAction interface -->
|
||||
<entry key="ENRICH/MORE/PROJECT" value-ref="ProjectLinkedEntityAction" />
|
||||
<entry key="ENRICH/MISSING/PROJECT" value-ref="ProjectLinkedEntityAction" />
|
||||
<entry key="ENRICH/MISSING/ABSTRACT" value-ref="AbstractMetadataAction" />
|
||||
<entry key="ENRICH/MORE/REVIEW" value-ref="AddReviewMetadataAction" />
|
||||
<entry key="ENRICH/MORE/ENDORSEMENT" value-ref="AddEndorsedMetadataAction"/>
|
||||
<entry key="ENRICH/MORE/PID" value-ref="PIDMetadataAction" />
|
||||
<entry key="ENRICH/MISSING/PID" value-ref="PIDMetadataAction" />
|
||||
<entry key="ENRICH/MORE/LINK" value-ref="RelationMetadataAction" />
|
||||
<entry value-ref="ProjectLinkedEntityAction">
|
||||
<key><util:constant static-field="org.dspace.qaevent.\.TOPIC_ENRICH_MORE_PROJECT"/></key>
|
||||
</entry>
|
||||
<entry value-ref="ProjectLinkedEntityAction">
|
||||
<key><util:constant static-field="org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_PROJECT"/></key>
|
||||
</entry>
|
||||
<entry value-ref="AbstractMetadataAction">
|
||||
<key><util:constant static-field="org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT"/></key>
|
||||
</entry>
|
||||
<entry value-ref="AddReviewMetadataAction">
|
||||
<key><util:constant static-field="org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW"/></key>
|
||||
</entry>
|
||||
<entry value-ref="AddEndorsedMetadataAction">
|
||||
<key><util:constant static-field="org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MORE_ENDORSEMENT"/></key>
|
||||
</entry>
|
||||
<entry value-ref="PIDMetadataAction">
|
||||
<key><util:constant static-field="org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MORE_PID"/></key>
|
||||
</entry>
|
||||
<entry value-ref="PIDMetadataAction">
|
||||
<key><util:constant static-field="org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_PID"/></key>
|
||||
</entry>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
@@ -123,5 +136,5 @@
|
||||
<property name="itemFilterToIgnore" ref="simple-demo_filter" />
|
||||
<property name="itemFilterToApprove" ref="simple-demo_filter" />
|
||||
</bean>
|
||||
-->
|
||||
-->
|
||||
</beans>
|
||||
|
Reference in New Issue
Block a user