Add test cases to reach a 100% coverage of all message handling
functions of the OrderAggregate and OrderLine member. Added, upgrade to
JUnit 5
#BAEL-4767
Adjust the OrderAggregate to contain an OrderLine aggregate member. The
OrderLine is added as soon as a Product is added through the
AddProductCommand. The OrderLine member is capable of handling the
increment and decrement product count commands, to increase/decrease the
number of instances for that OrderLine. Decreasing the count below 1
will publish the ProductRemovedEvent from within the OrderLine.
Additional business validation is added to unsure a given Product isn't
added twice (adding a second should go through increment) and that the
products aren't adjusted as soon as the product is confirmed.
#BAEL-4767
- Introduce a DuplicateOrderLineException to signal whenever somebody
wants to add the same product twice instead of using the increment
command.
- Introduce OrderAlreadyConfirmedException to signal whenever the order
is confirmed, so that adding products and incrementing/decrementing
their count is not possible once the order has been confirmed
#BAEL-4767
- Adjust OrderPlacedEvent to only construct the order
- Introduce ProductAddedEvent to be able to add several products
to a order
- Introduce ProductCountIncrementedEvent to increase the number of
product instances for a given Order
- Introduce ProductCountDecrementedEvent to increase the number of
product instances for a given Order
- Introduce ProductRemovedEvent to signal whenever all the product count
drops below 1
#BAEL-4767
- Adjust PlaceOrderCommand to only construct the order
- Introduce AddProductCommand to be able to add several products to an
order
- Introduce IncrementProductCountCommand to increase the number of
product instances for a given Order
- Introduce DecrementProductCountCommand to increase the number of
product instances for a given Order
#BAEL-4767
* BAEL-4805 Added the code for Decoding a JWT Token in Java tutorial
* BAEL-4805 Added newline at end of test file to conform to standards
* BAEL-4805 renamed test class to conform to naming standard for unit tests
* BAEL-4805 removed @DisplayName annotations as they are redundant
* BAEL-4805 changed assertion to be the user name in payload section to be more meaningful to reader
Co-authored-by: Liam Garvie <liamgarvie@Liams-MacBook-Pro.local>