MODLD-1020: Use LabelGeneratorService to compute the label of PROVIDER_EVENT resource#484
Open
MODLD-1020: Use LabelGeneratorService to compute the label of PROVIDER_EVENT resource#484
Conversation
There was a problem hiding this comment.
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
LABELdoc 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); | |||
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on folio-org/lib-linked-data-dictionary#164