Send external events from black box tests#903
Conversation
Codecov Report
@@ Coverage Diff @@
## master #903 +/- ##
============================================
+ Coverage 93.19% 93.22% +0.02%
- Complexity 3816 3823 +7
============================================
Files 522 522
Lines 12573 12585 +12
Branches 711 710 -1
============================================
+ Hits 11718 11732 +14
+ Misses 626 625 -1
+ Partials 229 228 -1 |
…events # Conflicts: # testutil-client/src/main/java/io/spine/testing/client/blackbox/ErrorAbsenceVerify.java # testutil-server/src/main/java/io/spine/testing/server/blackbox/BlackBoxBoundedContext.java # testutil-server/src/test/java/io/spine/testing/server/blackbox/BlackBoxBoundedContextTest.java # testutil-server/src/test/java/io/spine/testing/server/blackbox/given/BbProjectAggregate.java # testutil-server/src/test/java/io/spine/testing/server/blackbox/given/Given.java
…black-box-external-events
|
@armiol, PTAL. |
…events # Conflicts: # testutil-server/src/main/java/io/spine/testing/server/blackbox/BlackBoxBoundedContext.java # testutil-server/src/test/java/io/spine/testing/server/blackbox/BlackBoxBoundedContextTest.java
| * @apiNote Returned value can be ignored when this method invoked for test setup | ||
| */ | ||
| @CanIgnoreReturnValue | ||
| public T receivesExternalEvent(Message messageOrEvent) { |
There was a problem hiding this comment.
In case of a plain message posted, it's not clear how to set the mandatory ExternalMessage.bounded_context_name field.
| @VisibleForTesting | ||
| final class BlackBoxSetup { | ||
|
|
||
| private final BoundedContextName contextName; |
There was a problem hiding this comment.
If the one above resolved, this field requires (maybe) both renaming and explanation OR removal.
| } | ||
|
|
||
| @React(external = true) | ||
| Optional<BbUserUnassigned> on(BbUserDeleted event) { |
There was a problem hiding this comment.
BbUserUnassigned is about a user, while we speak of a Project aggregate. So probably this is BbAssigneeRemoved.
| } | ||
|
|
||
| // | ||
| // External User bounded context events |
| // An external event to be imported into an aggretate. | ||
| // An event to be imported into an aggretate. | ||
| // | ||
| message TuCommentRecievedByEmail { |
There was a problem hiding this comment.
Let's fix the spelling here as well. TuCommentReceivedByEmail
| repeated BbProjectId project_id = 2; | ||
| } | ||
|
|
||
| message BbAddProjectAssignee { |
There was a problem hiding this comment.
| message BbAddProjectAssignee { | |
| message BbAssignProject { |
|
@armiol, PTAL. |
| * optional external events to be dispatched to the Bounded Context | ||
| * in supplied order | ||
| * @return current instance | ||
| * @apiNote Returned value can be ignored when this method invoked for test setup |
There was a problem hiding this comment.
We have agreed to put periods in @apiNote and @implNote, as these are sentences.
This PR adds a
receivesExternalEventcall to theBlackBoxBoundedContext.