Skip to content

Add shortcut methods for asserting one event or rejection#897

Merged
alexander-yevsyukov merged 18 commits intomasterfrom
assert-one-event
Dec 2, 2018
Merged

Add shortcut methods for asserting one event or rejection#897
alexander-yevsyukov merged 18 commits intomasterfrom
assert-one-event

Conversation

@alexander-yevsyukov
Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Nov 30, 2018

This PR:

  1. clarifies multi-tenancy status in API of creating BlackBoxBoundedContext.
  2. addresses generics usage warning from ErrorProne.
  3. adds shortcut methods for testing emitted events or rejections. So that instead of:
     context.assertThat(emittedEvent(TaskCreated.class, once()));

... it would be possible to write:

   context.assertEmitted(TaskCreated.class);

It is also possible to write:

   context.assertRejectedWith(SomeRejection.class);

@codecov
Copy link

codecov bot commented Nov 30, 2018

Codecov Report

Merging #897 into master will increase coverage by 0.05%.
The diff coverage is 87.5%.

@@             Coverage Diff             @@
##             master    #897      +/-   ##
===========================================
+ Coverage     93.15%   93.2%   +0.05%     
- Complexity     3802    3808       +6     
===========================================
  Files           522     522              
  Lines         12541   12552      +11     
  Branches        710     710              
===========================================
+ Hits          11682   11699      +17     
+ Misses          629     627       -2     
+ Partials        230     226       -4

@alexander-yevsyukov
Copy link
Contributor Author

alexander-yevsyukov commented Dec 1, 2018

@armiol, there is some strange anomaly of collecting rejections in BlackBoxBoundedContext. Please see my TODO note in the BlackBoxBoundedContext.assertRejectedWith(). We're getting two messages instead of one. If you can have somebody to look into this, I'd appreciate that.

PTAL to my changes in this PR. I decided to introduce them in relation to my current works on improving Kanban Board example.

alexander-yevsyukov and others added 2 commits December 1, 2018 03:47
…atus to the `BbProjectAggregate`.

 Modify a rejection verifies to ensure the rejection is emitted strictly once.
@armiol
Copy link
Contributor

armiol commented Dec 1, 2018

@alexander-yevsyukov I have addressed your todo item. Please see this commit for more details.

Copy link
Contributor

@armiol armiol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexander-yevsyukov LGTM in general. Please see my comment — it's probably more convenient to discuss it in person.

@SpineEventEngine SpineEventEngine deleted a comment Dec 2, 2018
@alexander-yevsyukov alexander-yevsyukov merged commit 5df31d8 into master Dec 2, 2018
@alexander-yevsyukov alexander-yevsyukov deleted the assert-one-event branch December 2, 2018 00:55
@armiol armiol mentioned this pull request Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants