use of org.folio.ActionProfile in project mod-inventory by folio-org.
the class DeleteAuthorityEventHandlerTest method isEligibleShouldReturnFalseIfActionIsNotDelete.
@Test
public void isEligibleShouldReturnFalseIfActionIsNotDelete() {
ActionProfile actionProfile = new ActionProfile().withId(UUID.randomUUID().toString()).withName("Update Marc Authorities").withAction(UPDATE).withFolioRecord(MARC_AUTHORITY);
ProfileSnapshotWrapper profileSnapshotWrapper = new ProfileSnapshotWrapper().withId(UUID.randomUUID().toString()).withProfileId(actionProfile.getId()).withContentType(ACTION_PROFILE).withContent(actionProfile);
DataImportEventPayload dataImportEventPayload = new DataImportEventPayload().withEventType(DI_SRS_MARC_AUTHORITY_RECORD_DELETED.value()).withContext(context).withCurrentNode(profileSnapshotWrapper);
assertFalse(eventHandler.isEligible(dataImportEventPayload));
}
use of org.folio.ActionProfile in project mod-inventory by folio-org.
the class MarcBibModifiedPostProcessingEventHandlerTest method shouldReturnFalseWhenHandlerIsNotEligibleForProfile.
@Test
public void shouldReturnFalseWhenHandlerIsNotEligibleForProfile() {
// given
ActionProfile actionProfile = new ActionProfile().withId(UUID.randomUUID().toString()).withName("Create instance").withAction(ActionProfile.Action.CREATE).withFolioRecord(ActionProfile.FolioRecord.INSTANCE);
ProfileSnapshotWrapper profileSnapshotWrapper = new ProfileSnapshotWrapper().withContentType(ACTION_PROFILE).withContent(actionProfile);
DataImportEventPayload dataImportEventPayload = new DataImportEventPayload().withEventType(DI_SRS_MARC_BIB_RECORD_CREATED.value()).withCurrentNode(profileSnapshotWrapper);
// when
boolean isEligible = marcBibModifiedEventHandler.isEligible(dataImportEventPayload);
// then
Assert.assertFalse(isEligible);
}
use of org.folio.ActionProfile in project mod-inventory by folio-org.
the class UpdateAuthorityEventHandlerTest method isEligibleShouldReturnFalseIfRecordIsNotAuthority.
@Test
public void isEligibleShouldReturnFalseIfRecordIsNotAuthority() {
ActionProfile actionProfile = new ActionProfile().withId(UUID.randomUUID().toString()).withName("Create preliminary Item").withAction(ActionProfile.Action.CREATE).withFolioRecord(ITEM);
ProfileSnapshotWrapper profileSnapshotWrapper = new ProfileSnapshotWrapper().withId(UUID.randomUUID().toString()).withProfileId(actionProfile.getId()).withContentType(JOB_PROFILE).withContent(actionProfile);
DataImportEventPayload dataImportEventPayload = new DataImportEventPayload().withEventType(DI_INVENTORY_AUTHORITY_MATCHED.value()).withContext(new HashMap<>()).withProfileSnapshot(profileSnapshotWrapper);
assertFalse(eventHandler.isEligible(dataImportEventPayload));
}
use of org.folio.ActionProfile in project mod-inventory by folio-org.
the class UpdateHoldingEventHandlerTest method isEligibleShouldReturnFalseIfRecordIsNotHoldings.
@Test
public void isEligibleShouldReturnFalseIfRecordIsNotHoldings() {
ActionProfile actionProfile = new ActionProfile().withId(UUID.randomUUID().toString()).withName("Update preliminary Item").withAction(ActionProfile.Action.UPDATE).withFolioRecord(ActionProfile.FolioRecord.INSTANCE);
ProfileSnapshotWrapper profileSnapshotWrapper = new ProfileSnapshotWrapper().withId(UUID.randomUUID().toString()).withProfileId(actionProfile.getId()).withContentType(JOB_PROFILE).withContent(actionProfile);
DataImportEventPayload dataImportEventPayload = new DataImportEventPayload().withEventType(DI_INVENTORY_HOLDING_UPDATED.value()).withContext(new HashMap<>()).withCurrentNode(profileSnapshotWrapper);
assertFalse(updateHoldingEventHandler.isEligible(dataImportEventPayload));
}
use of org.folio.ActionProfile in project mod-inventory by folio-org.
the class CreateAuthorityEventHandlerTest method isEligibleShouldReturnFalseIfRecordIsNotAuthority.
@Test
public void isEligibleShouldReturnFalseIfRecordIsNotAuthority() {
ActionProfile actionProfile = new ActionProfile().withId(UUID.randomUUID().toString()).withName("Create preliminary Item").withAction(ActionProfile.Action.CREATE).withFolioRecord(ITEM);
ProfileSnapshotWrapper profileSnapshotWrapper = new ProfileSnapshotWrapper().withId(UUID.randomUUID().toString()).withProfileId(actionProfile.getId()).withContentType(JOB_PROFILE).withContent(actionProfile);
DataImportEventPayload dataImportEventPayload = new DataImportEventPayload().withEventType(DI_SRS_MARC_AUTHORITY_RECORD_CREATED.value()).withContext(new HashMap<>()).withProfileSnapshot(profileSnapshotWrapper);
assertFalse(createMarcAuthoritiesEventHandler.isEligible(dataImportEventPayload));
}
Aggregations