class GiftcardSampleScenarioTest : AggregateFixtureScenarioTest<GiftcardAggregate>() {
@ProvidedScenarioState
val fixture: AggregateTestFixture<GiftcardAggregate> = AggregateTestFixture(GiftcardAggregate::class.java)
@Test
fun `issue command creates aggregate`() {
GIVEN
.noPriorActivity()
WHEN
.command(IssueCommand("1", 100))
THEN
.expectEvent(IssuedEvent("1", 100))
.AND
.expectState(GiftcardAggregate("1", 100))
}
}
running this test gives you a console report:
Test Class: io.toolisticon.addons.axon.jgiven.GiftcardSampleScenarioTest Issue command creates aggregate Given no prior activity When command: "IssueCommand(id=1, initialBalance=100)" Then expect event: "IssuedEvent(id=1, initialBalance=100)" And expect state: "GiftcardAggregate(id=1, balance=100)"
I released the first version 0.1.1 based on axon 4.1.2 and jgiven 0.17.1 on bintray
repositories { maven("https://dl.bintray.com/toolisticon/maven/") }
dependencies { testImplementation("io.toolisticon.addons.axon:axon-jgiven:0.1.1") }
--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/8ea5b6b1-9279-40ed-840e-c57f5e9ccc22%40googlegroups.com.
Hi Steven, thanks for the applause ... will keep you posted.
Hi Steven, thanks for the applause ... will keep you posted.Jan
--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/d4693a4c-92b6-43ac-b2ae-f0ceece59428%40googlegroups.com.
Good luck with your thing :) I'm not sure though why people are doing test frameworks, everything you posted i can do with plain JUnit.Would love to see property driven testing with axon. I've seen some people talking they have it implemented for the axon to produce randomized payloads of data, im guessing nothing public.Seeing what you did there on the bdd, i do not think that the checking state is that important for aggregates, mostly they are black boxes which just publish certain events, this is why property based testing would be perfect addition for axon.