From 8db10daedaa0cc2c6e406997b30d23a481981128 Mon Sep 17 00:00:00 2001 From: Simon Zambrovski Date: Sun, 7 Feb 2021 14:43:05 +0100 Subject: [PATCH 01/21] Update for next development version --- examples/bankaccount-jgiven-junit4/pom.xml | 2 +- examples/bankaccount-jgiven-junit5/pom.xml | 2 +- examples/pom.xml | 2 +- extension/jgiven-core/pom.xml | 2 +- extension/jgiven-junit/pom.xml | 2 +- extension/jgiven-junit5/pom.xml | 2 +- extension/pom.xml | 2 +- extension/upcaster-test-core/pom.xml | 2 +- lib/fixtures/bankaccount/pom.xml | 2 +- lib/fixtures/giftcard/pom.xml | 2 +- lib/fixtures/pom.xml | 2 +- lib/pom.xml | 2 +- pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/bankaccount-jgiven-junit4/pom.xml b/examples/bankaccount-jgiven-junit4/pom.xml index b9f5150..d218043 100644 --- a/examples/bankaccount-jgiven-junit4/pom.xml +++ b/examples/bankaccount-jgiven-junit4/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ examples - 0.0.1 + 0.0.2-SNAPSHOT io.holixon.axon.testing.examples diff --git a/examples/bankaccount-jgiven-junit5/pom.xml b/examples/bankaccount-jgiven-junit5/pom.xml index 0c30000..aa1eef8 100644 --- a/examples/bankaccount-jgiven-junit5/pom.xml +++ b/examples/bankaccount-jgiven-junit5/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ examples - 0.0.1 + 0.0.2-SNAPSHOT io.holixon.axon.testing.examples diff --git a/examples/pom.xml b/examples/pom.xml index 1dfd285..f17cb9c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ axon-testing_ - 0.0.1 + 0.0.2-SNAPSHOT examples diff --git a/extension/jgiven-core/pom.xml b/extension/jgiven-core/pom.xml index 2ce736d..15ad443 100644 --- a/extension/jgiven-core/pom.xml +++ b/extension/jgiven-core/pom.xml @@ -7,7 +7,7 @@ io.holixon.axon.testing._ extension - 0.0.1 + 0.0.2-SNAPSHOT io.holixon.axon.testing diff --git a/extension/jgiven-junit/pom.xml b/extension/jgiven-junit/pom.xml index 10bde82..cb55cad 100644 --- a/extension/jgiven-junit/pom.xml +++ b/extension/jgiven-junit/pom.xml @@ -7,7 +7,7 @@ io.holixon.axon.testing._ extension - 0.0.1 + 0.0.2-SNAPSHOT io.holixon.axon.testing diff --git a/extension/jgiven-junit5/pom.xml b/extension/jgiven-junit5/pom.xml index 523518f..f36fe7d 100644 --- a/extension/jgiven-junit5/pom.xml +++ b/extension/jgiven-junit5/pom.xml @@ -7,7 +7,7 @@ io.holixon.axon.testing._ extension - 0.0.1 + 0.0.2-SNAPSHOT io.holixon.axon.testing diff --git a/extension/pom.xml b/extension/pom.xml index 411f7a1..6513b36 100644 --- a/extension/pom.xml +++ b/extension/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ axon-testing_ - 0.0.1 + 0.0.2-SNAPSHOT extension diff --git a/extension/upcaster-test-core/pom.xml b/extension/upcaster-test-core/pom.xml index 961c8e4..bcf0d45 100644 --- a/extension/upcaster-test-core/pom.xml +++ b/extension/upcaster-test-core/pom.xml @@ -7,7 +7,7 @@ io.holixon.axon.testing._ extension - 0.0.1 + 0.0.2-SNAPSHOT io.holixon.axon.testing diff --git a/lib/fixtures/bankaccount/pom.xml b/lib/fixtures/bankaccount/pom.xml index ac17838..a63fa4d 100644 --- a/lib/fixtures/bankaccount/pom.xml +++ b/lib/fixtures/bankaccount/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ fixtures - 0.0.1 + 0.0.2-SNAPSHOT io.holixon.axon.testing.lib diff --git a/lib/fixtures/giftcard/pom.xml b/lib/fixtures/giftcard/pom.xml index 2a7ed52..0e310f6 100644 --- a/lib/fixtures/giftcard/pom.xml +++ b/lib/fixtures/giftcard/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ fixtures - 0.0.1 + 0.0.2-SNAPSHOT io.holixon.axon.testing.lib diff --git a/lib/fixtures/pom.xml b/lib/fixtures/pom.xml index bd041bf..cfd84bf 100644 --- a/lib/fixtures/pom.xml +++ b/lib/fixtures/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ lib - 0.0.1 + 0.0.2-SNAPSHOT fixtures diff --git a/lib/pom.xml b/lib/pom.xml index 93ea26d..fbe49f5 100644 --- a/lib/pom.xml +++ b/lib/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ axon-testing_ - 0.0.1 + 0.0.2-SNAPSHOT lib diff --git a/pom.xml b/pom.xml index da3eeb8..9d103e8 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ io.holixon.axon.testing._ axon-testing_ - 0.0.1 + 0.0.2-SNAPSHOT pom From 1108be9da110ae9dd63111072d59c77c93547f53 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Feb 2021 07:24:18 +0000 Subject: [PATCH 02/21] chore(deps): bump gitflow-maven-plugin from 1.14.0 to 1.15.1 Bumps [gitflow-maven-plugin](https://github.com/aleksandr-m/gitflow-maven-plugin) from 1.14.0 to 1.15.1. - [Release notes](https://github.com/aleksandr-m/gitflow-maven-plugin/releases) - [Changelog](https://github.com/aleksandr-m/gitflow-maven-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/aleksandr-m/gitflow-maven-plugin/compare/v1.14.0...v1.15.1) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7e7c239..2c3b6a9 100644 --- a/pom.xml +++ b/pom.xml @@ -346,7 +346,7 @@ com.amashchenko.maven.plugin gitflow-maven-plugin - 1.14.0 + 1.15.1 master From d087a9028463de2d728758b3520bfb8d7dcb09d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Feb 2021 07:24:27 +0000 Subject: [PATCH 03/21] chore(deps): bump dokka-maven-plugin from 1.4.10.2 to 1.4.20 Bumps [dokka-maven-plugin](https://github.com/Kotlin/dokka) from 1.4.10.2 to 1.4.20. - [Release notes](https://github.com/Kotlin/dokka/releases) - [Commits](https://github.com/Kotlin/dokka/compare/v1.4.10.2...v1.4.20) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7e7c239..3551992 100644 --- a/pom.xml +++ b/pom.xml @@ -267,7 +267,7 @@ org.jetbrains.dokka dokka-maven-plugin - 1.4.10.2 + 1.4.20 ${dokka.skip} From 5e5c51e835df7841f2a48e327ad017fd56c011f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Feb 2021 06:24:39 +0000 Subject: [PATCH 04/21] chore(deps): bump axon-framework.version from 4.4.6 to 4.4.7 Bumps `axon-framework.version` from 4.4.6 to 4.4.7. Updates `axon-framework-bom` from 4.4.6 to 4.4.7 - [Release notes](https://github.com/holixon/axon-framework-bom/releases) - [Changelog](https://github.com/holixon/axon-framework-bom/blob/develop/RELEASE.md) - [Commits](https://github.com/holixon/axon-framework-bom/compare/4.4.6...4.4.7) Updates `axon-configuration` from 4.4.6 to 4.4.7 Updates `axon-test` from 4.4.6 to 4.4.7 - [Release notes](https://github.com/AxonFramework/AxonFramework/releases) - [Changelog](https://github.com/AxonFramework/AxonFramework/blob/master/axon-4-api-changes.md) - [Commits](https://github.com/AxonFramework/AxonFramework/compare/axon-4.4.6...axon-4.4.7) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4b76db6..4247976 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ ${java.version} 1.4.30 - 4.4.6 + 4.4.7 2.12.1 4.13.1 From a709c16155b4c6231df520db892bbba7d6cb5096 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Feb 2021 07:21:41 +0000 Subject: [PATCH 05/21] chore(deps): bump junit from 4.13.1 to 4.13.2 Bumps [junit](https://github.com/junit-team/junit4) from 4.13.1 to 4.13.2. - [Release notes](https://github.com/junit-team/junit4/releases) - [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md) - [Commits](https://github.com/junit-team/junit4/compare/r4.13.1...r4.13.2) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4247976..13d353f 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 4.4.7 2.12.1 - 4.13.1 + 4.13.2 5.7.1 1.0.0-RC7 2.1.3 From c80eb26368cd816943b78148eae32939c3c12628 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Feb 2021 06:24:51 +0000 Subject: [PATCH 06/21] chore(deps): bump dokka-maven-plugin from 1.4.20 to 1.4.20-dev-65 Bumps [dokka-maven-plugin](https://github.com/Kotlin/dokka) from 1.4.20 to 1.4.20-dev-65. - [Release notes](https://github.com/Kotlin/dokka/releases) - [Commits](https://github.com/Kotlin/dokka/commits) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 13d353f..db43ed1 100644 --- a/pom.xml +++ b/pom.xml @@ -267,7 +267,7 @@ org.jetbrains.dokka dokka-maven-plugin - 1.4.20 + 1.4.20-dev-65 ${dokka.skip} From 7d263c3615f7ce338d38e69636943897a94aa9b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Feb 2021 06:24:55 +0000 Subject: [PATCH 07/21] chore(deps-dev): bump mockito-core from 3.7.7 to 3.8.0 Bumps [mockito-core](https://github.com/mockito/mockito) from 3.7.7 to 3.8.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v3.7.7...v3.8.0) Signed-off-by: dependabot[bot] --- examples/bankaccount-jgiven-junit4/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bankaccount-jgiven-junit4/pom.xml b/examples/bankaccount-jgiven-junit4/pom.xml index d218043..60f77b3 100644 --- a/examples/bankaccount-jgiven-junit4/pom.xml +++ b/examples/bankaccount-jgiven-junit4/pom.xml @@ -50,7 +50,7 @@ org.mockito mockito-core - 3.7.7 + 3.8.0 test From e93e1d577a9b475a634cfc3dac46145788d5dc95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Mar 2021 06:22:11 +0000 Subject: [PATCH 08/21] chore(deps-dev): bump jackson.version from 2.12.1 to 2.12.2 Bumps `jackson.version` from 2.12.1 to 2.12.2. Updates `jackson-databind` from 2.12.1 to 2.12.2 - [Release notes](https://github.com/FasterXML/jackson/releases) - [Commits](https://github.com/FasterXML/jackson/commits) Updates `jackson-module-kotlin` from 2.12.1 to 2.12.2 - [Release notes](https://github.com/FasterXML/jackson-module-kotlin/releases) - [Commits](https://github.com/FasterXML/jackson-module-kotlin/compare/jackson-module-kotlin-2.12.1...jackson-module-kotlin-2.12.2) Updates `jackson-datatype-jsr310` from 2.12.1 to 2.12.2 Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index db43ed1..ec78040 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ 4.4.7 - 2.12.1 + 2.12.2 4.13.2 5.7.1 1.0.0-RC7 From ebc3f952503e1651b41d2ea2390b996d43a68189 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Mar 2021 06:22:41 +0000 Subject: [PATCH 09/21] chore(deps): bump jgiven.version from 1.0.0-RC7 to 1.0.0 Bumps `jgiven.version` from 1.0.0-RC7 to 1.0.0. Updates `jgiven-core` from 1.0.0-RC7 to 1.0.0 - [Release notes](https://github.com/TNG/jgiven/releases) - [Changelog](https://github.com/TNG/JGiven/blob/master/CHANGELOG.md) - [Commits](https://github.com/TNG/jgiven/compare/v1.0.0-RC7...v1.0.0) Updates `jgiven-junit` from 1.0.0-RC7 to 1.0.0 - [Release notes](https://github.com/TNG/jgiven/releases) - [Changelog](https://github.com/TNG/JGiven/blob/master/CHANGELOG.md) - [Commits](https://github.com/TNG/jgiven/compare/v1.0.0-RC7...v1.0.0) Updates `jgiven-junit5` from 1.0.0-RC7 to 1.0.0 - [Release notes](https://github.com/TNG/jgiven/releases) - [Changelog](https://github.com/TNG/JGiven/blob/master/CHANGELOG.md) - [Commits](https://github.com/TNG/jgiven/compare/v1.0.0-RC7...v1.0.0) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index db43ed1..4a321af 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 2.12.1 4.13.2 5.7.1 - 1.0.0-RC7 + 1.0.0 2.1.3 3.19.0 From 94303b01c2a268114abc92d3686fe0fb3cedf0a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Mar 2021 06:21:59 +0000 Subject: [PATCH 10/21] chore(deps): bump dokka-maven-plugin from 1.4.20-dev-65 to 1.4.30 Bumps [dokka-maven-plugin](https://github.com/Kotlin/dokka) from 1.4.20-dev-65 to 1.4.30. - [Release notes](https://github.com/Kotlin/dokka/releases) - [Commits](https://github.com/Kotlin/dokka/commits/v1.4.30) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4a321af..c3f0f1c 100644 --- a/pom.xml +++ b/pom.xml @@ -267,7 +267,7 @@ org.jetbrains.dokka dokka-maven-plugin - 1.4.20-dev-65 + 1.4.30 ${dokka.skip} From 7761d3150dbf55f54d9a76863ef5aa2468da6f3f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Mar 2021 07:51:58 +0000 Subject: [PATCH 11/21] chore(deps): bump guava from 30.1-jre to 30.1.1-jre Bumps [guava](https://github.com/google/guava) from 30.1-jre to 30.1.1-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) Signed-off-by: dependabot[bot] --- lib/fixtures/giftcard/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fixtures/giftcard/pom.xml b/lib/fixtures/giftcard/pom.xml index 0e310f6..9e9a1fd 100644 --- a/lib/fixtures/giftcard/pom.xml +++ b/lib/fixtures/giftcard/pom.xml @@ -20,7 +20,7 @@ com.google.guava guava - 30.1-jre + 30.1.1-jre From 14e30be1e033b99ec526b0e5ed6b1d89e6471bfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Mar 2021 06:30:50 +0000 Subject: [PATCH 12/21] chore(deps): bump kotlin.version from 1.4.30 to 1.4.32 Bumps `kotlin.version` from 1.4.30 to 1.4.32. Updates `kotlin-bom` from 1.4.30 to 1.4.32 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/commits) Updates `kotlin-maven-allopen` from 1.4.30 to 1.4.32 Updates `kotlin-maven-plugin` from 1.4.30 to 1.4.32 Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4a321af..d548161 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ 11 ${java.version} ${java.version} - 1.4.30 + 1.4.32 4.4.7 From 4faec32308cd1256d5fb6fb9d3dfc5dd8587a867 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Mar 2021 06:22:08 +0000 Subject: [PATCH 13/21] chore(deps): bump gitflow-maven-plugin from 1.15.1 to 1.16.0 Bumps [gitflow-maven-plugin](https://github.com/aleksandr-m/gitflow-maven-plugin) from 1.15.1 to 1.16.0. - [Release notes](https://github.com/aleksandr-m/gitflow-maven-plugin/releases) - [Changelog](https://github.com/aleksandr-m/gitflow-maven-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/aleksandr-m/gitflow-maven-plugin/compare/v1.15.1...v1.16.0) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4a321af..9ca59ae 100644 --- a/pom.xml +++ b/pom.xml @@ -346,7 +346,7 @@ com.amashchenko.maven.plugin gitflow-maven-plugin - 1.15.1 + 1.16.0 master From e4210fa3b0ddb1f340f4a0d9e3c07f949025ecd3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Mar 2021 06:01:59 +0000 Subject: [PATCH 14/21] chore(deps): bump axon-framework.version from 4.4.7 to 4.4.8 Bumps `axon-framework.version` from 4.4.7 to 4.4.8. Updates `axon-framework-bom` from 4.4.7 to 4.4.8 - [Release notes](https://github.com/holixon/axon-framework-bom/releases) - [Changelog](https://github.com/holixon/axon-framework-bom/blob/develop/RELEASE.md) - [Commits](https://github.com/holixon/axon-framework-bom/compare/4.4.7...4.4.8) Updates `axon-configuration` from 4.4.7 to 4.4.8 Updates `axon-test` from 4.4.7 to 4.4.8 - [Release notes](https://github.com/AxonFramework/AxonFramework/releases) - [Changelog](https://github.com/AxonFramework/AxonFramework/blob/master/axon-4-api-changes.md) - [Commits](https://github.com/AxonFramework/AxonFramework/compare/axon-4.4.7...axon-4.4.8) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index edf0440..bf6065e 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ ${java.version} 1.4.30 - 4.4.7 + 4.4.8 2.12.2 4.13.2 From e5d906004671a82f3990429128b97052b6ad5c1b Mon Sep 17 00:00:00 2001 From: Jan Galinski Date: Thu, 1 Apr 2021 11:21:19 +0200 Subject: [PATCH 15/21] provide extensions for casting, see #46 --- .../java/BankAccountAggregateJgivenJavaTest.java | 12 ++++++++++-- .../junit4/java/MoneyTransferSagaJgivenJavaTest.java | 3 ++- extension/jgiven-core/src/main/kotlin/AxonJGiven.kt | 5 +++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/BankAccountAggregateJgivenJavaTest.java b/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/BankAccountAggregateJgivenJavaTest.java index 87a58dd..5bfd88a 100644 --- a/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/BankAccountAggregateJgivenJavaTest.java +++ b/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/BankAccountAggregateJgivenJavaTest.java @@ -15,17 +15,25 @@ import io.holixon.axon.testing.jgiven.junit.AggregateFixtureScenarioTest; import org.axonframework.test.aggregate.AggregateTestFixture; import org.junit.Test; +import org.mockito.Mockito; +import java.io.Serializable; import java.util.UUID; -import static fixture.bankaccount.AccountAggregateTestHelper.*; +import static fixture.bankaccount.AccountAggregateTestHelper.ACCOUNT_ID_1; +import static fixture.bankaccount.AccountAggregateTestHelper.ACCOUNT_ID_2; +import static fixture.bankaccount.AccountAggregateTestHelper.CUSTOMER_ID_1; +import static fixture.bankaccount.AccountAggregateTestHelper.accountAggregate; +import static fixture.bankaccount.AccountAggregateTestHelper.accountCreatedEvent; +import static fixture.bankaccount.AccountAggregateTestHelper.createAccountCommand; import static fixture.bankaccount.BankAccountAggregate.Configuration.DEFAULT_INITIAL_BALANCE; import static fixture.bankaccount.BankAccountAggregate.Configuration.DEFAULT_MAXIMAL_BALANCE; public class BankAccountAggregateJgivenJavaTest extends AggregateFixtureScenarioTest { @ProvidedScenarioState - private final AggregateTestFixture fixture = new AggregateTestFixture<>(BankAccountAggregate.class); + private final AggregateTestFixture fixture = (AggregateTestFixture) new AggregateTestFixture<>(BankAccountAggregate.class) + .registerInjectableResource(Mockito.mock(Serializable.class)); @Test public void create_account() { diff --git a/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/MoneyTransferSagaJgivenJavaTest.java b/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/MoneyTransferSagaJgivenJavaTest.java index 7d7aa2b..dc3752a 100644 --- a/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/MoneyTransferSagaJgivenJavaTest.java +++ b/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/MoneyTransferSagaJgivenJavaTest.java @@ -12,7 +12,8 @@ public class MoneyTransferSagaJgivenJavaTest extends SagaFixtureScenarioTest { @ProvidedScenarioState - private final SagaTestFixture fixture = new SagaTestFixture<>(MoneyTransferSaga.class); + private final SagaTestFixture fixture = (SagaTestFixture) new SagaTestFixture<>(MoneyTransferSaga.class) + .registerStartRecordingCallback(() -> {}); @Test public void initialize_transfer_money() { diff --git a/extension/jgiven-core/src/main/kotlin/AxonJGiven.kt b/extension/jgiven-core/src/main/kotlin/AxonJGiven.kt index 39b4f76..d3491a3 100644 --- a/extension/jgiven-core/src/main/kotlin/AxonJGiven.kt +++ b/extension/jgiven-core/src/main/kotlin/AxonJGiven.kt @@ -7,6 +7,8 @@ import io.holixon.axon.testing.jgiven.aggregate.AggregateFixtureWhen import io.holixon.axon.testing.jgiven.saga.SagaFixtureGiven import io.holixon.axon.testing.jgiven.saga.SagaFixtureThen import io.holixon.axon.testing.jgiven.saga.SagaFixtureWhen +import org.axonframework.test.aggregate.AggregateTestFixture +import org.axonframework.test.saga.SagaTestFixture /** * Base class for scenario aggregate tests. @@ -17,3 +19,6 @@ abstract class AggregateFixtureScenarioTestBase : ScenarioTestBase : ScenarioTestBase, SagaFixtureWhen, SagaFixtureThen>() + +fun org.axonframework.test.aggregate.FixtureConfiguration.toFixture() = this as AggregateTestFixture +fun org.axonframework.test.saga.FixtureConfiguration.toFixture() = this as SagaTestFixture From 49adc08d0846981bb9cb93bf843c62b71cf47bfa Mon Sep 17 00:00:00 2001 From: Simon Zambrovski Date: Thu, 1 Apr 2021 11:58:29 +0200 Subject: [PATCH 16/21] Update development.yml No reason for GPG import in develop build --- .github/workflows/development.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 0dcba1f..ccc2b3c 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -24,11 +24,11 @@ jobs: ${{ runner.os }}-maven # Get GPG private key into GPG - - name: Import GPG Owner Trust - run: echo ${{ secrets.GPG_OWNERTRUST }} | base64 --decode | gpg --import-ownertrust +# - name: Import GPG Owner Trust +# run: echo ${{ secrets.GPG_OWNERTRUST }} | base64 --decode | gpg --import-ownertrust - - name: Import GPG key - run: echo ${{ secrets.GPG_SECRET_KEYS }} | base64 --decode | gpg --import --no-tty --batch --yes +# - name: Import GPG key +# run: echo ${{ secrets.GPG_SECRET_KEYS }} | base64 --decode | gpg --import --no-tty --batch --yes # Setup JDK and Maven - name: Set up JDK 11 From 35598871276e95cb61b666cffd5b600b704d9d81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Apr 2021 06:22:10 +0000 Subject: [PATCH 17/21] chore(deps): bump lombok from 1.18.18 to 1.18.20 Bumps [lombok](https://github.com/rzwitserloot/lombok) from 1.18.18 to 1.18.20. - [Release notes](https://github.com/rzwitserloot/lombok/releases) - [Changelog](https://github.com/rzwitserloot/lombok/blob/master/doc/changelog.markdown) - [Commits](https://github.com/rzwitserloot/lombok/compare/v1.18.18...v1.18.20) Signed-off-by: dependabot[bot] --- lib/fixtures/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fixtures/pom.xml b/lib/fixtures/pom.xml index cfd84bf..b4c9d80 100644 --- a/lib/fixtures/pom.xml +++ b/lib/fixtures/pom.xml @@ -38,7 +38,7 @@ org.projectlombok lombok - 1.18.18 + 1.18.20 provided From 7af2ad49269b88a6caf098cba304e458d593dd44 Mon Sep 17 00:00:00 2001 From: Jan Galinski Date: Sat, 3 Apr 2021 11:42:41 +0200 Subject: [PATCH 18/21] provide AggregateTestFixturBuilder --- .../BankAccountAggregateJgivenJavaTest.java | 10 +- .../BankAccountAggregateJgivenKotlinTest.kt | 42 ++++--- .../jgiven-core/src/main/kotlin/AxonJGiven.kt | 10 ++ .../aggregate/AggregateTestFixtureBuilder.kt | 117 ++++++++++++++++++ 4 files changed, 159 insertions(+), 20 deletions(-) create mode 100644 extension/jgiven-core/src/main/kotlin/aggregate/AggregateTestFixtureBuilder.kt diff --git a/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/BankAccountAggregateJgivenJavaTest.java b/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/BankAccountAggregateJgivenJavaTest.java index 5bfd88a..182ee0f 100644 --- a/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/BankAccountAggregateJgivenJavaTest.java +++ b/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/BankAccountAggregateJgivenJavaTest.java @@ -12,6 +12,7 @@ import fixture.bankaccount.exception.InsufficientBalanceException; import fixture.bankaccount.exception.MaximalBalanceExceededException; import fixture.bankaccount.exception.MaximumActiveMoneyTransfersReachedException; +import io.holixon.axon.testing.jgiven.AxonJGiven; import io.holixon.axon.testing.jgiven.junit.AggregateFixtureScenarioTest; import org.axonframework.test.aggregate.AggregateTestFixture; import org.junit.Test; @@ -28,12 +29,17 @@ import static fixture.bankaccount.AccountAggregateTestHelper.createAccountCommand; import static fixture.bankaccount.BankAccountAggregate.Configuration.DEFAULT_INITIAL_BALANCE; import static fixture.bankaccount.BankAccountAggregate.Configuration.DEFAULT_MAXIMAL_BALANCE; +import static io.holixon.axon.testing.jgiven.AxonJGiven.aggregateTestFixtureBuilder; +import static org.mockito.Mockito.mock; public class BankAccountAggregateJgivenJavaTest extends AggregateFixtureScenarioTest { + private interface MyService {} + @ProvidedScenarioState - private final AggregateTestFixture fixture = (AggregateTestFixture) new AggregateTestFixture<>(BankAccountAggregate.class) - .registerInjectableResource(Mockito.mock(Serializable.class)); + private final AggregateTestFixture fixture = aggregateTestFixtureBuilder(BankAccountAggregate.class) + .registerInjectableResource(mock(MyService.class)) + .build(); @Test public void create_account() { diff --git a/examples/bankaccount-jgiven-junit4/src/test/kotlin/BankAccountAggregateJgivenKotlinTest.kt b/examples/bankaccount-jgiven-junit4/src/test/kotlin/BankAccountAggregateJgivenKotlinTest.kt index 1bfb6a5..333cc93 100644 --- a/examples/bankaccount-jgiven-junit4/src/test/kotlin/BankAccountAggregateJgivenKotlinTest.kt +++ b/examples/bankaccount-jgiven-junit4/src/test/kotlin/BankAccountAggregateJgivenKotlinTest.kt @@ -5,6 +5,8 @@ import fixture.bankaccount.BankAccountAggregate import fixture.bankaccount.BankAccountAggregate.Configuration.DEFAULT_MAXIMAL_BALANCE import fixture.bankaccount.command.CreateAccountCommand import fixture.bankaccount.event.AccountCreatedEvent +import io.holixon.axon.testing.jgiven.AxonJGiven +import io.holixon.axon.testing.jgiven.AxonJGiven.aggregateTestFixtureBuilder import io.holixon.axon.testing.jgiven.junit.AggregateFixtureScenarioTest import io.toolisticon.testing.jgiven.AND import io.toolisticon.testing.jgiven.GIVEN @@ -13,11 +15,10 @@ import io.toolisticon.testing.jgiven.WHEN import org.axonframework.test.aggregate.AggregateTestFixture import org.junit.Test - class BankAccountAggregateJgivenKotlinTest : AggregateFixtureScenarioTest() { @ProvidedScenarioState - private val fixture = AggregateTestFixture(BankAccountAggregate::class.java) + private val fixture = aggregateTestFixtureBuilder(BankAccountAggregate::class).build() @Test fun `create account`() { @@ -25,25 +26,30 @@ class BankAccountAggregateJgivenKotlinTest : AggregateFixtureScenarioTest : ScenarioTestBase org.axonframework.test.aggregate.FixtureConfiguration.toFixture() = this as AggregateTestFixture fun org.axonframework.test.saga.FixtureConfiguration.toFixture() = this as SagaTestFixture + +object AxonJGiven { + @JvmStatic + fun aggregateTestFixtureBuilder(aggregateType:Class) = AggregateTestFixtureBuilder(aggregateType) + + inline fun aggregateTestFixtureBuilder(aggregateType: KClass) = AggregateTestFixtureBuilder(T::class.java) + +} diff --git a/extension/jgiven-core/src/main/kotlin/aggregate/AggregateTestFixtureBuilder.kt b/extension/jgiven-core/src/main/kotlin/aggregate/AggregateTestFixtureBuilder.kt new file mode 100644 index 0000000..c66ba93 --- /dev/null +++ b/extension/jgiven-core/src/main/kotlin/aggregate/AggregateTestFixtureBuilder.kt @@ -0,0 +1,117 @@ +package io.holixon.axon.testing.jgiven.aggregate + +import org.axonframework.commandhandling.CommandMessage +import org.axonframework.deadline.DeadlineMessage +import org.axonframework.eventsourcing.AggregateFactory +import org.axonframework.messaging.MessageDispatchInterceptor +import org.axonframework.messaging.MessageHandler +import org.axonframework.messaging.MessageHandlerInterceptor +import org.axonframework.messaging.annotation.HandlerDefinition +import org.axonframework.messaging.annotation.HandlerEnhancerDefinition +import org.axonframework.messaging.annotation.ParameterResolverFactory +import org.axonframework.modelling.command.CommandTargetResolver +import org.axonframework.modelling.command.Repository +import org.axonframework.modelling.command.RepositoryProvider +import org.axonframework.test.aggregate.AggregateTestFixture +import org.axonframework.test.matchers.FieldFilter +import kotlin.reflect.KClass + +class AggregateTestFixtureBuilder(private val aggregateType: Class) { + + private lateinit var aggregateFactory: AggregateFactory + private val annotatedCommandHandler: MutableList = mutableListOf() + private val commandHandlers: MutableMap>> = mutableMapOf() + private val commandDispatchInterceptors: MutableList>> = mutableListOf() + private val commandHandlerInterceptors: MutableList>> = mutableListOf() + private lateinit var commandTargetResolver: CommandTargetResolver + private val deadlineDispatchInterceptors: MutableList>> = mutableListOf() + private val deadlineHandlerInterceptors: MutableList>> = mutableListOf() + private val fieldFilters: MutableList = mutableListOf() + private val handlerDefinitions: MutableList = mutableListOf() + private val handlerEnhancerDefinitions: MutableList = mutableListOf() + private val ignoredFields: MutableList, String>> = mutableListOf() + private val parameterResolverFactories: MutableList = mutableListOf() + private var reportIllegalStateChange: Boolean? = null + private lateinit var repository: Repository + private lateinit var repositoryProvider: RepositoryProvider + private val injectableResources: MutableList = mutableListOf() + private lateinit var subtypes: Array> + + fun registerAggregateFactory(aggregateFactory: AggregateFactory) = apply { this.aggregateFactory = aggregateFactory } + fun registerAnnotatedCommandHandler(annotatedCommandHandler: Any) = apply { this.annotatedCommandHandler.add(annotatedCommandHandler) } + + fun registerCommandHandler(commandName: String, commandHandler: MessageHandler>): AggregateTestFixtureBuilder = + apply { this.commandHandlers[commandName] = commandHandler } + + fun registerCommandHandler(payloadType: Class<*>, commandHandler: MessageHandler>): AggregateTestFixtureBuilder = + registerCommandHandler(payloadType.name, commandHandler) + + fun registerCommandDispatchInterceptor(vararg commandDispatchInterceptors: MessageDispatchInterceptor>) = + apply { this.commandDispatchInterceptors.addAll(commandDispatchInterceptors) } + + fun registerCommandHandlerInterceptor(vararg commandHandlerInterceptors: MessageHandlerInterceptor>) = + apply { this.commandHandlerInterceptors.addAll(commandHandlerInterceptors) } + + fun registerCommandTargetResolver(commandTargetResolver: CommandTargetResolver) = apply { this.commandTargetResolver = commandTargetResolver } + + fun registerDeadlineDispatchInterceptor(vararg deadlineDispatchInterceptors: MessageDispatchInterceptor>) = + apply { this.deadlineDispatchInterceptors.addAll(deadlineDispatchInterceptors) } + + fun registerDeadlineHandlerInterceptor(vararg deadlineHandlerInterceptors: MessageHandlerInterceptor>) = + apply { this.deadlineHandlerInterceptors.addAll(deadlineHandlerInterceptors) } + + fun registerFieldFilter(vararg fieldFilters: FieldFilter) = apply { this.fieldFilters.addAll(fieldFilters) } + + fun registerHandlerDefinition(vararg handlerDefinitions: HandlerDefinition) = apply { this.handlerDefinitions.addAll(handlerDefinitions) } + fun registerHandlerEnhancerDefinition(vararg handlerEnhancerDefinitions: HandlerEnhancerDefinition) = + apply { this.handlerEnhancerDefinitions.addAll(handlerEnhancerDefinitions) } + + + fun registerIgnoredField(declaringClass: KClass<*>, fieldName: String) = apply { ignoredFields.add(declaringClass.java to fieldName) } + fun registerIgnoredField(declaringClass: Class<*>, fieldName: String) = apply { ignoredFields.add(declaringClass to fieldName) } + + + fun registerInjectableResource(vararg resources: Any) = apply { this.injectableResources.addAll(resources) } + + fun registerParameterResolverFactory(vararg parameterResolverFactories: ParameterResolverFactory) = + apply { this.parameterResolverFactories.addAll(parameterResolverFactories) } + + fun registerRepository(repository: Repository) = apply { this.repository = repository } + fun registerRepositoryProvider(repositoryProvider: RepositoryProvider) = apply { this.repositoryProvider = repositoryProvider } + + + fun setReportIllegalStateChange(reportIllegalStateChange: Boolean) = apply { this.reportIllegalStateChange = reportIllegalStateChange } + + fun withSubtypes(vararg subtypes: Class) = withSubtypes(subtypes.asList()) + fun withSubtypes(subtypes: Collection>) = apply { this.subtypes = subtypes.toTypedArray() } + + fun build(): AggregateTestFixture { + val fixture = AggregateTestFixture(aggregateType) + + if (this::aggregateFactory.isInitialized) fixture.registerAggregateFactory(aggregateFactory) + + annotatedCommandHandler.forEach { fixture.registerAnnotatedCommandHandler(it) } + commandHandlers.forEach { fixture.registerCommandHandler(it.key, it.value) } + commandDispatchInterceptors.forEach { fixture.registerCommandDispatchInterceptor(it) } + commandHandlerInterceptors.forEach { fixture.registerCommandHandlerInterceptor(it) } + if (this::commandTargetResolver.isInitialized) fixture.registerCommandTargetResolver(commandTargetResolver) + deadlineDispatchInterceptors.forEach { fixture.registerDeadlineDispatchInterceptor(it) } + deadlineHandlerInterceptors.forEach { fixture.registerDeadlineHandlerInterceptor(it) } + fieldFilters.forEach { fixture.registerFieldFilter(it) } + + handlerEnhancerDefinitions.forEach { fixture.registerHandlerEnhancerDefinition(it) } + handlerDefinitions.forEach { fixture.registerHandlerDefinition(it) } + + injectableResources.forEach { fixture.registerInjectableResource(it) } + ignoredFields.forEach { fixture.registerIgnoredField(it.first, it.second) } + + parameterResolverFactories.forEach { fixture.registerParameterResolverFactory(it) } + + if (this::repository.isInitialized) fixture.registerRepository(repository) + if (this::repositoryProvider.isInitialized) fixture.registerRepositoryProvider(repositoryProvider) + if (this::subtypes.isInitialized) fixture.withSubtypes(*this.subtypes) + reportIllegalStateChange?.let { fixture.setReportIllegalStateChange(it) } + + return fixture + } +} From 1721ef0af2680a765bb10fc10d7379037fcc9bba Mon Sep 17 00:00:00 2001 From: Jan Galinski Date: Sat, 3 Apr 2021 13:37:24 +0200 Subject: [PATCH 19/21] provide saga test fixture builder --- .../java/MoneyTransferSagaJgivenJavaTest.java | 7 +- .../MoneyTransferSagaJgivenKotlinTest.kt | 8 +- .../jgiven-core/src/main/kotlin/AxonJGiven.kt | 13 +-- .../aggregate/AggregateTestFixtureBuilder.kt | 4 +- .../kotlin/saga/SagaTestFixtureBuilder.kt | 86 +++++++++++++++++++ 5 files changed, 106 insertions(+), 12 deletions(-) create mode 100644 extension/jgiven-core/src/main/kotlin/saga/SagaTestFixtureBuilder.kt diff --git a/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/MoneyTransferSagaJgivenJavaTest.java b/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/MoneyTransferSagaJgivenJavaTest.java index dc3752a..eff5214 100644 --- a/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/MoneyTransferSagaJgivenJavaTest.java +++ b/examples/bankaccount-jgiven-junit4/src/test/java/io/holixon/axon/testing/examples/jgiven/junit4/java/MoneyTransferSagaJgivenJavaTest.java @@ -8,12 +8,15 @@ import org.junit.Test; import static fixture.bankaccount.AccountAggregateTestHelper.*; +import static io.holixon.axon.testing.jgiven.AxonJGiven.sagaTestFixtureBuilder; public class MoneyTransferSagaJgivenJavaTest extends SagaFixtureScenarioTest { @ProvidedScenarioState - private final SagaTestFixture fixture = (SagaTestFixture) new SagaTestFixture<>(MoneyTransferSaga.class) - .registerStartRecordingCallback(() -> {}); + private final SagaTestFixture fixture = sagaTestFixtureBuilder(MoneyTransferSaga.class) + .registerStartRecordingCallback(() -> { + }) + .build(); @Test public void initialize_transfer_money() { diff --git a/examples/bankaccount-jgiven-junit4/src/test/kotlin/MoneyTransferSagaJgivenKotlinTest.kt b/examples/bankaccount-jgiven-junit4/src/test/kotlin/MoneyTransferSagaJgivenKotlinTest.kt index fa92c03..46d1c02 100644 --- a/examples/bankaccount-jgiven-junit4/src/test/kotlin/MoneyTransferSagaJgivenKotlinTest.kt +++ b/examples/bankaccount-jgiven-junit4/src/test/kotlin/MoneyTransferSagaJgivenKotlinTest.kt @@ -1,21 +1,23 @@ package io.holixon.axon.testing.examples.jgiven.junit4.kotlin import com.tngtech.jgiven.annotation.ProvidedScenarioState -import fixture.bankaccount.AccountAggregateTestHelper import fixture.bankaccount.AccountAggregateTestHelper.* import fixture.bankaccount.MoneyTransferSaga import fixture.bankaccount.event.MoneyTransferInitializedEvent +import io.holixon.axon.testing.jgiven.AxonJGiven +import io.holixon.axon.testing.jgiven.AxonJGiven.sagaTestFixtureBuilder import io.holixon.axon.testing.jgiven.junit.SagaFixtureScenarioTest import io.toolisticon.testing.jgiven.GIVEN import io.toolisticon.testing.jgiven.THEN import io.toolisticon.testing.jgiven.WHEN -import org.axonframework.test.saga.SagaTestFixture import org.junit.Test class MoneyTransferSagaJgivenKotlinTest : SagaFixtureScenarioTest() { @ProvidedScenarioState - private val fixture = SagaTestFixture(MoneyTransferSaga::class.java) + private val fixture = sagaTestFixtureBuilder(MoneyTransferSaga::class) + .registerStartRecordingCallback({}) + .build() @Test internal fun `initialize money transfer`() { diff --git a/extension/jgiven-core/src/main/kotlin/AxonJGiven.kt b/extension/jgiven-core/src/main/kotlin/AxonJGiven.kt index 2f9b74d..1ab8177 100644 --- a/extension/jgiven-core/src/main/kotlin/AxonJGiven.kt +++ b/extension/jgiven-core/src/main/kotlin/AxonJGiven.kt @@ -8,6 +8,7 @@ import io.holixon.axon.testing.jgiven.aggregate.AggregateTestFixtureBuilder import io.holixon.axon.testing.jgiven.saga.SagaFixtureGiven import io.holixon.axon.testing.jgiven.saga.SagaFixtureThen import io.holixon.axon.testing.jgiven.saga.SagaFixtureWhen +import io.holixon.axon.testing.jgiven.saga.SagaTestFixtureBuilder import org.axonframework.test.aggregate.AggregateTestFixture import org.axonframework.test.saga.SagaTestFixture import kotlin.reflect.KClass @@ -22,13 +23,15 @@ abstract class AggregateFixtureScenarioTestBase : ScenarioTestBase : ScenarioTestBase, SagaFixtureWhen, SagaFixtureThen>() -fun org.axonframework.test.aggregate.FixtureConfiguration.toFixture() = this as AggregateTestFixture -fun org.axonframework.test.saga.FixtureConfiguration.toFixture() = this as SagaTestFixture - object AxonJGiven { + + @JvmStatic + fun aggregateTestFixtureBuilder(aggregateType: Class) = AggregateTestFixtureBuilder(aggregateType) + @JvmStatic - fun aggregateTestFixtureBuilder(aggregateType:Class) = AggregateTestFixtureBuilder(aggregateType) + fun sagaTestFixtureBuilder(aggregateType: Class) = SagaTestFixtureBuilder(aggregateType) - inline fun aggregateTestFixtureBuilder(aggregateType: KClass) = AggregateTestFixtureBuilder(T::class.java) + inline fun aggregateTestFixtureBuilder(aggregateType: KClass) = AggregateTestFixtureBuilder(T::class.java) + inline fun sagaTestFixtureBuilder(aggregateType: KClass) = SagaTestFixtureBuilder(T::class.java) } diff --git a/extension/jgiven-core/src/main/kotlin/aggregate/AggregateTestFixtureBuilder.kt b/extension/jgiven-core/src/main/kotlin/aggregate/AggregateTestFixtureBuilder.kt index c66ba93..3f771a3 100644 --- a/extension/jgiven-core/src/main/kotlin/aggregate/AggregateTestFixtureBuilder.kt +++ b/extension/jgiven-core/src/main/kotlin/aggregate/AggregateTestFixtureBuilder.kt @@ -27,14 +27,14 @@ class AggregateTestFixtureBuilder(private val aggregateType: Class) { private val deadlineDispatchInterceptors: MutableList>> = mutableListOf() private val deadlineHandlerInterceptors: MutableList>> = mutableListOf() private val fieldFilters: MutableList = mutableListOf() + private val ignoredFields: MutableList, String>> = mutableListOf() private val handlerDefinitions: MutableList = mutableListOf() private val handlerEnhancerDefinitions: MutableList = mutableListOf() - private val ignoredFields: MutableList, String>> = mutableListOf() + private val injectableResources: MutableList = mutableListOf() private val parameterResolverFactories: MutableList = mutableListOf() private var reportIllegalStateChange: Boolean? = null private lateinit var repository: Repository private lateinit var repositoryProvider: RepositoryProvider - private val injectableResources: MutableList = mutableListOf() private lateinit var subtypes: Array> fun registerAggregateFactory(aggregateFactory: AggregateFactory) = apply { this.aggregateFactory = aggregateFactory } diff --git a/extension/jgiven-core/src/main/kotlin/saga/SagaTestFixtureBuilder.kt b/extension/jgiven-core/src/main/kotlin/saga/SagaTestFixtureBuilder.kt new file mode 100644 index 0000000..8896561 --- /dev/null +++ b/extension/jgiven-core/src/main/kotlin/saga/SagaTestFixtureBuilder.kt @@ -0,0 +1,86 @@ +package io.holixon.axon.testing.jgiven.saga + +import org.axonframework.deadline.DeadlineMessage +import org.axonframework.eventhandling.ListenerInvocationErrorHandler +import org.axonframework.messaging.MessageDispatchInterceptor +import org.axonframework.messaging.MessageHandlerInterceptor +import org.axonframework.messaging.annotation.HandlerDefinition +import org.axonframework.messaging.annotation.HandlerEnhancerDefinition +import org.axonframework.messaging.annotation.ParameterResolverFactory +import org.axonframework.modelling.saga.ResourceInjector +import org.axonframework.test.matchers.FieldFilter +import org.axonframework.test.saga.SagaTestFixture +import org.axonframework.test.utils.CallbackBehavior + +class SagaTestFixtureBuilder(private val sagaType: Class) { + + private val injectableResources: MutableList = mutableListOf() + private var transienceCheckEnabled: Boolean? = null + + private lateinit var resourceInjector: ResourceInjector + private lateinit var callbackBehavior: CallbackBehavior + private lateinit var listenerInvocationErrorHandler: ListenerInvocationErrorHandler + private val onStartRecordingCallbacks: MutableList = mutableListOf() + private val deadlineDispatchInterceptors: MutableList>> = mutableListOf() + private val deadlineHandlerInterceptors: MutableList>> = mutableListOf() + private val fieldFilters: MutableList = mutableListOf() + private val ignoredFields: MutableList, String>> = mutableListOf() + private val handlerDefinitions: MutableList = mutableListOf() + private val handlerEnhancerDefinitions: MutableList = mutableListOf() + private val parameterResolverFactories: MutableList = mutableListOf() + + fun withTransienceCheckDisabled() = apply { this.transienceCheckEnabled = false } + + fun registerResource(vararg resources: Any) = apply { this.injectableResources.addAll(resources) } + + fun registerParameterResolverFactory(vararg parameterResolverFactories: ParameterResolverFactory) = + apply { this.parameterResolverFactories.addAll(parameterResolverFactories) } + + fun registerFieldFilter(vararg fieldFilters: FieldFilter) = apply { this.fieldFilters.addAll(fieldFilters) } + + fun registerIgnoredField(declaringClass: Class<*>, fieldName: String) = apply { this.ignoredFields.add(declaringClass to fieldName) } + + fun registerHandlerDefinition(vararg handlerDefinitions: HandlerDefinition) = apply { this.handlerDefinitions.addAll(handlerDefinitions) } + fun registerHandlerEnhancerDefinition(vararg handlerEnhancerDefinitions: HandlerEnhancerDefinition) = + apply { this.handlerEnhancerDefinitions.addAll(handlerEnhancerDefinitions) } + + fun registerDeadlineDispatchInterceptor(vararg deadlineDispatchInterceptors: MessageDispatchInterceptor>) = + apply { this.deadlineDispatchInterceptors.addAll(deadlineDispatchInterceptors) } + + fun registerDeadlineHandlerInterceptor(vararg deadlineHandlerInterceptors: MessageHandlerInterceptor>) = + apply { this.deadlineHandlerInterceptors.addAll(deadlineHandlerInterceptors) } + + + fun registerListenerInvocationErrorHandler(listenerInvocationErrorHandler: ListenerInvocationErrorHandler) = + apply { this.listenerInvocationErrorHandler = listenerInvocationErrorHandler } + + fun registerResourceInjector(resourceInjector: ResourceInjector) = apply { this.resourceInjector = resourceInjector } + + fun registerStartRecordingCallback(vararg onStartRecordingCallbacks: Runnable) = apply { this.onStartRecordingCallbacks.addAll(onStartRecordingCallbacks) } + + fun setCallbackBehavior(callbackBehavior: CallbackBehavior) = apply { this.callbackBehavior = callbackBehavior } + + fun build(): SagaTestFixture { + val fixture = SagaTestFixture(sagaType) + handlerEnhancerDefinitions.forEach { fixture.registerHandlerEnhancerDefinition(it) } + handlerDefinitions.forEach { fixture.registerHandlerDefinition(it) } + + deadlineDispatchInterceptors.forEach { fixture.registerDeadlineDispatchInterceptor(it) } + deadlineHandlerInterceptors.forEach { fixture.registerDeadlineHandlerInterceptor(it) } + + + if (this::listenerInvocationErrorHandler.isInitialized) fixture.registerListenerInvocationErrorHandler(listenerInvocationErrorHandler) + if (this::resourceInjector.isInitialized) fixture.registerResourceInjector(resourceInjector) + fieldFilters.forEach { fixture.registerFieldFilter(it) } + injectableResources.forEach { fixture.registerResource(it) } + ignoredFields.forEach { fixture.registerIgnoredField(it.first, it.second) } + transienceCheckEnabled?.let { fixture.withTransienceCheckDisabled() } + parameterResolverFactories.forEach { fixture.registerParameterResolverFactory(it) } + + onStartRecordingCallbacks.forEach { fixture.registerStartRecordingCallback(it) } + + + return fixture + } + +} From 65c25136621324b7ffb24939f211666288a2d8db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Apr 2021 06:24:00 +0000 Subject: [PATCH 20/21] chore(deps-dev): bump mockito-core from 3.8.0 to 3.9.0 Bumps [mockito-core](https://github.com/mockito/mockito) from 3.8.0 to 3.9.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v3.8.0...v3.9.0) Signed-off-by: dependabot[bot] --- examples/bankaccount-jgiven-junit4/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bankaccount-jgiven-junit4/pom.xml b/examples/bankaccount-jgiven-junit4/pom.xml index 60f77b3..c8d50a2 100644 --- a/examples/bankaccount-jgiven-junit4/pom.xml +++ b/examples/bankaccount-jgiven-junit4/pom.xml @@ -50,7 +50,7 @@ org.mockito mockito-core - 3.8.0 + 3.9.0 test From 7d5850197d2802a8c2291f7150cd541331bc4a56 Mon Sep 17 00:00:00 2001 From: Simon Zambrovski Date: Mon, 12 Apr 2021 13:51:59 +0200 Subject: [PATCH 21/21] Update for next development version --- examples/bankaccount-jgiven-junit4/pom.xml | 2 +- examples/bankaccount-jgiven-junit5/pom.xml | 2 +- examples/pom.xml | 2 +- extension/jgiven-core/pom.xml | 2 +- extension/jgiven-junit/pom.xml | 2 +- extension/jgiven-junit5/pom.xml | 2 +- extension/pom.xml | 2 +- extension/upcaster-test-core/pom.xml | 2 +- lib/fixtures/bankaccount/pom.xml | 2 +- lib/fixtures/giftcard/pom.xml | 2 +- lib/fixtures/pom.xml | 2 +- lib/pom.xml | 2 +- pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/bankaccount-jgiven-junit4/pom.xml b/examples/bankaccount-jgiven-junit4/pom.xml index c8d50a2..f456b2c 100644 --- a/examples/bankaccount-jgiven-junit4/pom.xml +++ b/examples/bankaccount-jgiven-junit4/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ examples - 0.0.2-SNAPSHOT + 0.0.2 io.holixon.axon.testing.examples diff --git a/examples/bankaccount-jgiven-junit5/pom.xml b/examples/bankaccount-jgiven-junit5/pom.xml index aa1eef8..4a94ab0 100644 --- a/examples/bankaccount-jgiven-junit5/pom.xml +++ b/examples/bankaccount-jgiven-junit5/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ examples - 0.0.2-SNAPSHOT + 0.0.2 io.holixon.axon.testing.examples diff --git a/examples/pom.xml b/examples/pom.xml index 05c7ec1..bb9e844 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ axon-testing_ - 0.0.2-SNAPSHOT + 0.0.2 examples diff --git a/extension/jgiven-core/pom.xml b/extension/jgiven-core/pom.xml index 13a920d..be2cb5d 100644 --- a/extension/jgiven-core/pom.xml +++ b/extension/jgiven-core/pom.xml @@ -7,7 +7,7 @@ io.holixon.axon.testing._ extension - 0.0.2-SNAPSHOT + 0.0.2 io.holixon.axon.testing diff --git a/extension/jgiven-junit/pom.xml b/extension/jgiven-junit/pom.xml index d323675..b98e16d 100644 --- a/extension/jgiven-junit/pom.xml +++ b/extension/jgiven-junit/pom.xml @@ -7,7 +7,7 @@ io.holixon.axon.testing._ extension - 0.0.2-SNAPSHOT + 0.0.2 io.holixon.axon.testing diff --git a/extension/jgiven-junit5/pom.xml b/extension/jgiven-junit5/pom.xml index 83c59ff..14ffc53 100644 --- a/extension/jgiven-junit5/pom.xml +++ b/extension/jgiven-junit5/pom.xml @@ -7,7 +7,7 @@ io.holixon.axon.testing._ extension - 0.0.2-SNAPSHOT + 0.0.2 io.holixon.axon.testing diff --git a/extension/pom.xml b/extension/pom.xml index 6513b36..0ee27e1 100644 --- a/extension/pom.xml +++ b/extension/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ axon-testing_ - 0.0.2-SNAPSHOT + 0.0.2 extension diff --git a/extension/upcaster-test-core/pom.xml b/extension/upcaster-test-core/pom.xml index e58ec84..7357a52 100644 --- a/extension/upcaster-test-core/pom.xml +++ b/extension/upcaster-test-core/pom.xml @@ -7,7 +7,7 @@ io.holixon.axon.testing._ extension - 0.0.2-SNAPSHOT + 0.0.2 io.holixon.axon.testing diff --git a/lib/fixtures/bankaccount/pom.xml b/lib/fixtures/bankaccount/pom.xml index a63fa4d..0573ca8 100644 --- a/lib/fixtures/bankaccount/pom.xml +++ b/lib/fixtures/bankaccount/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ fixtures - 0.0.2-SNAPSHOT + 0.0.2 io.holixon.axon.testing.lib diff --git a/lib/fixtures/giftcard/pom.xml b/lib/fixtures/giftcard/pom.xml index 9e9a1fd..dd7aa95 100644 --- a/lib/fixtures/giftcard/pom.xml +++ b/lib/fixtures/giftcard/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ fixtures - 0.0.2-SNAPSHOT + 0.0.2 io.holixon.axon.testing.lib diff --git a/lib/fixtures/pom.xml b/lib/fixtures/pom.xml index b4c9d80..42ab504 100644 --- a/lib/fixtures/pom.xml +++ b/lib/fixtures/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ lib - 0.0.2-SNAPSHOT + 0.0.2 fixtures diff --git a/lib/pom.xml b/lib/pom.xml index d7a4f40..6bea6c1 100644 --- a/lib/pom.xml +++ b/lib/pom.xml @@ -6,7 +6,7 @@ io.holixon.axon.testing._ axon-testing_ - 0.0.2-SNAPSHOT + 0.0.2 lib diff --git a/pom.xml b/pom.xml index 52a8dc2..4b40d60 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ io.holixon.axon.testing._ axon-testing_ - 0.0.2-SNAPSHOT + 0.0.2 pom