Add axon-event-sourcing module: Axon 5.4.2 entity, projection, replay
Event-sourced bank account on Axon Framework 5.4.2 + Spring Boot 4.1.1, with transcripts generated by tests and three reproduced JPA-store variants. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b69H5rTewUKPyhGS8r
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
# Reproduces three real behaviours by compiling a deliberately broken BankAccount from src/broken/
|
||||
# in a throwaway copy of this module, and captures the exception text into output/.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
MODULE_DIR="$(pwd)"
|
||||
run_variant () {
|
||||
local name="$1" out="$2"
|
||||
local tmp; tmp="$(mktemp -d)"
|
||||
cp ../pom.xml "$tmp/pom.xml"
|
||||
mkdir "$tmp/axon-event-sourcing"
|
||||
cp -r pom.xml src "$tmp/axon-event-sourcing/"
|
||||
cp src/broken/"$name"/*.java "$tmp/axon-event-sourcing/src/main/java/com/ankurm/axondemo/domain/"
|
||||
(cd "$tmp/axon-event-sourcing" && mvn -B -q test -Dtest=VariantProbeTest \
|
||||
-Dvariant="$name" -Dvariant.file="$out" -Dtranscript.dir="$MODULE_DIR/output" >/dev/null 2>&1 || true)
|
||||
rm -rf "$tmp"
|
||||
echo "wrote output/$out"
|
||||
}
|
||||
run_variant tag-key-mismatch 05-variant-tag-key-mismatch.txt
|
||||
run_variant id-only-creator 06-variant-id-only-creator.txt
|
||||
run_variant two-tags 07-variant-two-tags.txt
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# Regenerates every file in output/: the scenario transcripts (01-04) come from the normal test
|
||||
# suite, the broken-variant transcripts (05-07) from broken-variants.sh.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
rm -f output/*.txt
|
||||
mvn -B -q test
|
||||
./scripts/broken-variants.sh
|
||||
ls output
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# Starts the application on port 8080 (Ctrl-C to stop). Try:
|
||||
# curl -X POST 'localhost:8080/accounts/acc-1?owner=Asha'
|
||||
# curl -X POST 'localhost:8080/accounts/acc-1/deposit?amount=500'
|
||||
# curl localhost:8080/accounts/acc-1
|
||||
# curl localhost:8080/accounts/acc-1/events
|
||||
# curl -X POST localhost:8080/admin/replay
|
||||
cd "$(dirname "$0")/.."
|
||||
exec mvn -B -q spring-boot:run
|
||||
Reference in New Issue
Block a user