Publishes Events about prison offender changes to Pub / Sub Topics
TMPDIR=/private$TMPDIR docker-compose up localstack
Simplest way is running the following script
./setup-sns.bash
Or you can run the scripts individually as shown below.
aws --endpoint-url=http://localhost:4566 sns create-topic --name offender_events
Results in:
{
"TopicArn": "arn:aws:sns:eu-west-2:000000000000:offender_events"
}
aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name event_queue
Results 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_queue
The 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 up
The 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 Circle build).
For more information on the smoke tests see the project dps-smoketest
.