-
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-2198 Implement the code for the feature UXPROD-5001 (#1521)
CIRC-2198 Implement the code for the feature UXPROD-5001
- Loading branch information
1 parent
4414f1d
commit 511e096
Showing
4 changed files
with
51 additions
and
4 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
36 changes: 36 additions & 0 deletions
36
src/test/java/org/folio/circulation/resources/RequestNoticeSenderTest.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,36 @@ | ||
package org.folio.circulation.resources; | ||
|
||
import static org.mockito.ArgumentMatchers.any; | ||
import static org.mockito.Mockito.times; | ||
|
||
import org.folio.circulation.domain.Request; | ||
import org.folio.circulation.domain.RequestAndRelatedRecords; | ||
import org.folio.circulation.domain.notice.ImmediatePatronNoticeService; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.Mockito; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
|
||
import api.support.builders.RequestBuilder; | ||
import io.vertx.core.json.JsonObject; | ||
|
||
@ExtendWith(MockitoExtension.class) | ||
class RequestNoticeSenderTest { | ||
|
||
@Mock | ||
private ImmediatePatronNoticeService immediatePatronNoticeService; | ||
@InjectMocks | ||
private RequestNoticeSender requestNoticeSender; | ||
|
||
@Test | ||
void shouldNotSendNotificationWhenIsDcbCancellationTrue() { | ||
JsonObject representation = new RequestBuilder().create(); | ||
representation.put("isDcbReRequestCancellation", true); | ||
requestNoticeSender.sendNoticeOnRequestCancelled( | ||
new RequestAndRelatedRecords(Request.from(representation))); | ||
Mockito.verify(immediatePatronNoticeService, times(0)).acceptNoticeEvent(any()); | ||
Mockito.verify(immediatePatronNoticeService, times(0)).sendNotice(any(), any()); | ||
} | ||
} |