cjscommonplatform / domain-test-dsl Goto Github PK
View Code? Open in Web Editor NEWDSL for testing aggregates and events using domain language
DSL for testing aggregates and events using domain language
There have been reports of problems passing lists of POJOs to the aggregate method. We need to:
If an aggregate generates data (eg, creates a UUID or the current timestamp) and uses those values in an expected event, then we cannot match against the expected event because an exact match is done between the expected and actual events.
We need to add support for specifying a wildcard in the expected event data to support this scenario.
If a "Then" (or subsequent "And") does not match an event, it should report what event (if any) was found instead of the one expected. Currently, if no event is found, the following stack trace is emitted instead:
Then hearing allocated for listing # DomainTestSteps.previous_events(String)
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.LinkedList.checkElementIndex(LinkedList.java:555)
at java.util.LinkedList.get(LinkedList.java:476)
at uk.gov.justice.services.test.domain.DomainTestSteps.assert_events_generated(DomainTestSteps.java:54)
at uk.gov.justice.services.test.domain.DomainTestSteps.previous_events(DomainTestSteps.java:32)
at โฝ.Then hearing allocated for listing(allocate-hearing.feature:28)
Currently, if a field is omitted from the argument JSON that is used to create the arguments passed to the aggregate method, because it is not a required field, then the aggregate wrapper fails to find the matching method.
We need to expand the code that finds a matching method so that if it doesn't find an exact match it looks for methods that take additional optionals.
We should discuss whether this should be expanded to pass nulls for unmatched parameters, or whether to insist on optionals.
Add support to allow multiple events to be listed in a JSON array in an input or output file. It should act as though the events were listed explicitly in the Given or Then.
Currently we support When clauses such as:
When you doSomething to an ExampleAggregate
We would like to make the "to" (and other similar words) optional, so we can support:
When you something an ExampleAggregate
We would also like to update the joingin words that are used with the method arguments in the When clause, so that the "a|an" is not mandatory and to additionally support "some":
When you doSomething to an ExampleAggregate using a turnip
When you doSomething to an ExampleAggregate using some turnips
When you doSomething to an ExampleAggregate using turnips
Comma separated events appear to work, but events listed with "And"s do not get applied prior to the action method being called on the aggregate
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.