Skip to content

MODLD-1020: Use LabelGeneratorService to compute the label of PROVIDER_EVENT resource#484

Open
pkjacob wants to merge 1 commit intomasterfrom
pjacob/MODLD-1020
Open

MODLD-1020: Use LabelGeneratorService to compute the label of PROVIDER_EVENT resource#484
pkjacob wants to merge 1 commit intomasterfrom
pjacob/MODLD-1020

Conversation

@pkjacob
Copy link
Copy Markdown
Contributor

@pkjacob pkjacob commented Mar 20, 2026

Copilot AI review requested due to automatic review settings March 20, 2026 19:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates PROVIDER_EVENT label generation to align with the centralized LabelGeneratorService approach already used for other resource types.

Changes:

  • Switch PROVIDER_EVENT entity mapping to assign labels via ResourceEntityLabelService (instead of picking the first available field).
  • Update E2E assertions to expect the generated composite label and the persisted LABEL doc property.
  • Add release note entry for MODLD-1020.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/test/java/org/folio/linked/data/e2e/resource/ResourceControllerITBase.java Adjusts provider event label expectations and asserts the LABEL property is present in doc.
src/main/java/org/folio/linked/data/mapper/dto/resource/common/instance/sub/ProviderEventMapperUnit.java Delegates PROVIDER_EVENT label assignment to ResourceEntityLabelService before hashing.
NEWS.md Documents the change for MODLD-1020.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 845 to +868
@@ -862,9 +863,9 @@ private void validateProviderEvent(ResourceEdge edge, Resource source, Predicate
.isEqualTo(type + " provider date");
assertThat(providerEvent.getDoc().get(SIMPLE_PLACE.getValue()).size()).isEqualTo(1);
assertThat(providerEvent.getDoc().get(SIMPLE_PLACE.getValue()).get(0).asString()).isEqualTo(type + " simple place");
assertThat(providerEvent.getDoc().get(LABEL.getValue()).get(0).asString()).isEqualTo(expectedLabel);
assertThat(providerEvent.getOutgoingEdges()).hasSize(1);
validateProviderPlace(providerEvent.getOutgoingEdges().iterator().next(), providerEvent, expectedCode,
expectedLabel);
validateProviderPlace(providerEvent.getOutgoingEdges().iterator().next(), providerEvent, countryCode, providePlace);
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validateProviderEvent parameter providePlace looks like a typo/unclear name (it’s passed through as the provider place label to validateProviderPlace). Consider renaming it to providerPlace or providerPlaceLabel to match its meaning and avoid confusion with the providerEvent label computed inside this method.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants