-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CIRC-1966]-Added integration with mod-circulation-item (#1379)
* [CIRC-1966]-Added intigration with mod-circulation-item * [CIRC-1966]-Added intigration with mod-circulation-item * [CIRC-1966]-Added intigration with mod-circulation-item * [CIRC-1966]-Added intigration with mod-circulation-item
- Loading branch information
Showing
11 changed files
with
163 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
27 changes: 27 additions & 0 deletions
27
src/test/java/api/support/builders/CirculationItemsBuilder.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package api.support.builders; | ||
|
||
import io.vertx.core.json.JsonObject; | ||
|
||
import java.util.UUID; | ||
|
||
public class CirculationItemsBuilder implements Builder { | ||
|
||
private final JsonObject representation; | ||
|
||
public CirculationItemsBuilder(UUID itemId, String barcode, UUID holdingId, UUID locationId, UUID materialTypeId, UUID loanTypeId, boolean isDcb) { | ||
|
||
this.representation = new JsonObject() | ||
.put("id", itemId) | ||
.put("holdingsRecordId", holdingId) | ||
.put("effectiveLocationId", locationId) | ||
.put("barcode", barcode) | ||
.put("materialTypeId", materialTypeId) | ||
.put("temporaryLoanTypeId", loanTypeId) | ||
.put("dcbItem", isDcb); | ||
} | ||
|
||
@Override | ||
public JsonObject create() { | ||
return representation; | ||
} | ||
} |
This file contains 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
30 changes: 30 additions & 0 deletions
30
src/test/java/api/support/fixtures/CirculationItemsFixture.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package api.support.fixtures; | ||
|
||
import api.support.builders.CirculationItemsBuilder; | ||
import api.support.http.IndividualResource; | ||
import api.support.http.ResourceClient; | ||
|
||
import java.util.UUID; | ||
|
||
public class CirculationItemsFixture { | ||
private final ResourceClient circulationItemsByIdsClient; | ||
private final ResourceClient circulationItemClient; | ||
private final MaterialTypesFixture materialTypesFixture; | ||
private final LoanTypesFixture loanTypesFixture; | ||
|
||
public CirculationItemsFixture( | ||
MaterialTypesFixture materialTypesFixture, | ||
LoanTypesFixture loanTypesFixture) { | ||
|
||
circulationItemsByIdsClient = ResourceClient.forCirculationItemsByIds(); | ||
circulationItemClient = ResourceClient.forCirculationItem(); | ||
this.materialTypesFixture = materialTypesFixture; | ||
this.loanTypesFixture = loanTypesFixture; | ||
} | ||
|
||
public IndividualResource createCirculationItem(UUID itemId, String barcode, UUID holdingId, UUID locationId) { | ||
CirculationItemsBuilder circulationItemsBuilder = new CirculationItemsBuilder(itemId, barcode, holdingId, locationId, materialTypesFixture.book().getId(), loanTypesFixture.canCirculate().getId(), true); | ||
circulationItemClient.create(circulationItemsBuilder); | ||
return circulationItemsByIdsClient.create(circulationItemsBuilder); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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