Skip to content

Commit

Permalink
MODTLR-19 Change schema, response type
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderkurash committed Feb 21, 2024
1 parent eec1348 commit 5230a18
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/folio/client/feign/DcbClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public interface DcbClient {

@PostMapping("/ecs-tlr-transactions")
DcbTransaction createDcbTransaction(DcbTransaction dcbTransaction);
TransactionStatusResponse createDcbTransaction(DcbTransaction dcbTransaction);

@GetMapping("/transactions/{dcbTransactionId}/status")
TransactionStatusResponse getDcbTransactionStatus(@PathVariable String dcbTransactionId);
Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/swagger.api/schemas/dcbTransaction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ DcbTransaction:
properties:
item:
$ref: 'dcbItem.yaml#/DcbItem'
patron:
$ref: 'dcbPatron.yaml#/DcbPatron'
pickup:
$ref: 'dcbPickup.yaml#/DcbPickup'
role:
type: string
enum:
Expand Down
11 changes: 6 additions & 5 deletions src/test/java/org/folio/client/DcbClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ void canCreateDcbTransaction() {
DcbTransaction dcbTransaction = new DcbTransaction()
.role(DcbTransaction.RoleEnum.BORROWER)
.requestId(requestId);
when(dcbClient.createDcbTransaction(dcbTransaction)).thenReturn(dcbTransaction);
TransactionStatusResponse transactionStatusResponse = new TransactionStatusResponse()
.status(TransactionStatusResponse.StatusEnum.CANCELLED)
.message("test message")
.item(dcbTransaction.getItem())
.requestId(requestId);
when(dcbClient.createDcbTransaction(dcbTransaction)).thenReturn(transactionStatusResponse);
var response = dcbClient.createDcbTransaction(dcbTransaction);
assertNotNull(response);
assertEquals(DcbTransaction.RoleEnum.BORROWER, response.getRole());
Expand All @@ -44,8 +49,6 @@ void canGetDcbTransactionStatus() {
.status(TransactionStatusResponse.StatusEnum.CANCELLED)
.message("test message")
.item(dcbTransaction.getItem())
.patron(dcbTransaction.getPatron())
.pickup(dcbTransaction.getPickup())
.requestId(requestId);
when(dcbClient.getDcbTransactionStatus(transactionId)).thenReturn(transactionStatusResponse);
var response = dcbClient.getDcbTransactionStatus(transactionId);
Expand All @@ -67,8 +70,6 @@ void canChangeDcbTransactionStatus() {
.status(TransactionStatusResponse.StatusEnum.CANCELLED)
.message("test message")
.item(dcbTransaction.getItem())
.patron(dcbTransaction.getPatron())
.pickup(dcbTransaction.getPickup())
.requestId(requestId);
when(dcbClient.changeDcbTransactionStatus(transactionId, targetStatus))
.thenReturn(transactionStatusResponse);
Expand Down

0 comments on commit 5230a18

Please sign in to comment.