Skip to content

Commit

Permalink
[CIRC-2036] Fix issue related to the displaySummary field not being s…
Browse files Browse the repository at this point in the history
…et (#1439)

* [MODORDERS-1017] - Add displaySummary field

* [MODORDERS-1017] - Add displaySummary field

* CIRC-2036 update schema with displaySummary field

* CIRC-2036 fix code smell issue

* CIRC-2036 fix code smell

* CIRC-2036 refactoring

* CIRC-2036 Fix Sonar reliability issue

* CIRC-2036 refactoring

* CIRC-2036 fix displaySummary for description

* CIRC-2036 fix compilation issue

---------

Co-authored-by: Dzmitry_Butramyou <[email protected]>
Co-authored-by: alexanderkurash <[email protected]>
  • Loading branch information
3 people authored Mar 11, 2024
1 parent 4cda9ba commit 9c861e8
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 5 deletions.
4 changes: 4 additions & 0 deletions ramls/check-in-by-barcode-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@
"description": "Volume is intended for monographs when a multipart monograph (e.g. a biography of George Bernard Shaw in three volumes).",
"type": "string"
},
"displaySummary": {
"description": "Display summary about the item",
"type": "string"
},
"inTransitDestinationServicePointId": {
"description": "Service point an item is intended to be transited to (should only be present when in transit)",
"type": "string",
Expand Down
4 changes: 4 additions & 0 deletions ramls/items-in-transit.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
"description": "The volume of the item",
"type": "string"
},
"displaySummary": {
"description": "Display summary about the item",
"type": "string"
},
"yearCaption": {
"description": "The year caption of the item",
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ private ItemDescription getDescription(JsonObject representation) {
getProperty(representation, "copyNumber"),
getProperty(representation, "volume"),
getProperty(representation, "chronology"),
getProperty(representation, "displaySummary"),
getProperty(representation, "numberOfPieces"),
getProperty(representation, "descriptionOfPieces"),
getProperty(representation, "displaySummary"),
toStream(representation, "yearCaption")
.collect(Collectors.toList()));
}
Expand Down
6 changes: 5 additions & 1 deletion src/test/java/api/loans/CheckInByBarcodeTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ void canCloseAnOpenLoanByCheckingInTheItem() {
.withTemporaryLocation(homeLocation.getId())
.withEnumeration("v.70:no.1-6")
.withChronology("1987:Jan.-June")
.withVolume("testVolume"));
.withVolume("testVolume")
.withDisplaySummary("test displaySummary"));

final IndividualResource loan = checkOutFixture.checkOutByBarcode(nod, james,
ZonedDateTime.of(2018, 3, 1, 13, 25, 46, 0, UTC));
Expand Down Expand Up @@ -207,6 +208,9 @@ void canCloseAnOpenLoanByCheckingInTheItem() {
assertThat("has item chronology",
itemFromResponse.getString("chronology"), is("1987:Jan.-June"));

assertThat("has item displaySummary",
itemFromResponse.getString("displaySummary"), is("test displaySummary"));

assertThat("has item volume",
itemFromResponse.getString("volume"), is("testVolume"));

Expand Down
6 changes: 5 additions & 1 deletion src/test/java/api/loans/LoanAPITests.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ void canCreateALoan() {
item -> item
.withEnumeration("v.70:no.1-6")
.withChronology("1987:Jan.-June")
.withVolume("testVolume"));
.withVolume("testVolume")
.withDisplaySummary("testDisplaySummary"));

UUID itemId = smallAngryPlanet.getId();

Expand Down Expand Up @@ -142,6 +143,9 @@ void canCreateALoan() {
assertThat("has item volume",
loan.getJsonObject("item").getString("volume"), is("testVolume"));

assertThat("has item displaySummary",
loan.getJsonObject("item").getString("displaySummary"), is("testDisplaySummary"));

JsonArray contributors = loan.getJsonObject("item").getJsonArray("contributors");

assertThat("item has a single contributor",
Expand Down
1 change: 1 addition & 0 deletions src/test/java/api/requests/RequestsAPICreationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ void canCreateARequest() {
assertThat(requestItem.getString("enumeration"), is("enumeration1"));
assertThat(requestItem.getString("chronology"), is("chronology"));
assertThat(requestItem.getString("volume"), is("vol.1"));
assertThat(requestItem.getString("displaySummary"), is("displaySummary"));

JsonArray identifiers = requestInstance.getJsonArray("identifiers");
assertThat(identifiers, notNullValue());
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/api/support/fixtures/ItemsFixture.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ public Function<ItemBuilder, ItemBuilder> addCallNumberStringComponents(String p
.withCallNumber(prefix + "itCn", prefix + "itCnPrefix", prefix + "itCnSuffix")
.withEnumeration(prefix + "enumeration1")
.withChronology(prefix + "chronology")
.withVolume(prefix + "vol.1");
.withVolume(prefix + "vol.1")
.withDisplaySummary(prefix + "displaySummary");
}

public Function<ItemBuilder, ItemBuilder> addCallNumberStringComponents() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/api/support/http/ResourceClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public IndividualResource create(Builder builder) {

public IndividualResource create(JsonObject representation) {

return new IndividualResource(restAssuredClient.post(representation,
return new IndividualResource(restAssuredClient.post(representation,
rootUrl(), 201, "create-record"));
}

Expand Down
4 changes: 4 additions & 0 deletions src/test/resources/item-storage-8-9.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@
"type": "string",
"description": "Chronology is the descriptive information for the dating scheme of a serial."
},
"displaySummary": {
"description": "Display summary about the item",
"type": "string"
},
"yearCaption": {
"type": "array",
"description": "In multipart monographs, a caption is a character(s) used to label a level of chronology, e.g., year 1985.",
Expand Down

0 comments on commit 9c861e8

Please sign in to comment.