Publishes Events about prison offender changes to Pub / Sub Topics
TMPDIR=/private$TMPDIR docker compose up localstackSimplest way is running the following script
./setup-sns.bashOr you can run the scripts individually as shown below.
aws --endpoint-url=http://localhost:4566 sns create-topic --name offender_eventsResults in:
{
"TopicArn": "arn:aws:sns:eu-west-2:000000000000:offender_events"
}
aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name event_queueResults in:
{
"QueueUrl": "http://localhost:4566/queue/event_queue"
}aws --endpoint-url=http://localhost:4566 sns subscribe \
--topic-arn arn:aws:sns:eu-west-2:000000000000:offender_events \
--protocol sqs \
--notification-endpoint http://localhost:4566/queue/event_queue \
--attributes '{"FilterPolicy":"{\"eventType\":[\"EXTERNAL_MOVEMENT_RECORD-INSERTED\", \"BOOKING_NUMBER-CHANGED\"]}"}'Results in:
{
"SubscriptionArn": "arn:aws:sns:eu-west-2:000000000000:offender_events:074545bd-393c-4a43-ad62-95b1809534f0"
}aws --endpoint-url=http://localhost:4566 sqs receive-message --queue-url http://localhost:4566/queue/event_queueThe integration tests depend on localstack to be running to access the topics and test queues, this can be started with docker-compose
docker compose -f docker-compose-test.yml upThe source set testSmoke contains the smoke tests.
These tests are not intended to be run locally, but instead are run against a deployed application (as happens in the Github actions build).
For more information on the smoke tests see the project dps-smoketest.