It looks like for some reason the Spring context shuts down while the elastic config should run. The SQS Rest Server does not look like it runs and so the tests fail.
Interestingly when I run the test from Intellij it runs and logs correclty. This error happens when running in gradle.
Here is a snap of the stack trace I am seeing.
{"@timestamp":"2020-03-07T09:24:34.155+01:00","@version":"TEST","message":"Shutting down ExecutorService 'applicationTaskExecutor'","logger_name":"org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor","thread_name":"SpringContextShutdownHook","level":"INFO","level_value":20000}
{"@timestamp":"2020-03-07T09:24:34.267+01:00","@version":"TEST","message":"26dc4073-03c0-43c8-a4ef-a7ac667004e7 shut down postmaster in 00:00:00.117","logger_name":"com.opentable.db.postgres.embedded.EmbeddedPostgres","thread_name":"postgres-26dc4073-03c0-43c8-a4ef-a7ac667004e7-closer","level":"INFO","level_value":20000}
{"@timestamp":"2020-03-07T09:24:34.267+01:00","@version":"TEST","message":"9eebda74-f0dd-44e7-a8b4-f7ea128912bc shut down postmaster in 00:00:00.116","logger_name":"com.opentable.db.postgres.embedded.EmbeddedPostgres","thread_name":"postgres-9eebda74-f0dd-44e7-a8b4-f7ea128912bc-closer","level":"INFO","level_value":20000}
{"@timestamp":"2020-03-07T09:24:34.267+01:00","@version":"TEST","message":"waiting for server to shut down.... done","logger_name":"init-9eebda74-f0dd-44e7-a8b4-f7ea128912bc:pg_ctl","thread_name":"log:pid(25946)","level":"INFO","level_value":20000}
{"@timestamp":"2020-03-07T09:24:34.268+01:00","@version":"TEST","message":"waiting for server to shut down.... done","logger_name":"init-26dc4073-03c0-43c8-a4ef-a7ac667004e7:pg_ctl","thread_name":"log:pid(25945)","level":"INFO","level_value":20000}
{"@timestamp":"2020-03-07T09:24:34.375+01:00","@version":"TEST","message":"An Exception occurred while polling queue '
http://localhost:61752/queue/queue-url'. The failing operation will be retried in 10000 milliseconds","logger_name":"org.springframework.cloud.aws.messaging.listener.SimpleMessageListenerContainer","thread_name":"simpleMessageListenerContainer-2","level":"WARN","level_value":30000,"stack_trace":"j.n.ConnectException: Connection refused (Connection refused)\n\tat j.n.PlainSocketImpl.socketConnect(PlainSocketImpl.java)\n\tat j.n.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)\n\tat j.n.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)\n\tat j.n.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)\n\tat j.n.SocksSocketImpl.connect(SocksSocketImpl.java:403)\n\tat java.net.Socket.connect(Socket.java:591)\n\tat o.a.h.c.s.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)\n\tat o.a.h.i.c.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)\n\t... 32 common frames omitted\nWrapped by: o.a.h.c.HttpHostConnectException: Connect to localhost:61752 [localhost/
127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)\n\tat o.a.h.i.c.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)\n\tat o.a.h.i.c.PoolingHttpClientConnectionManager.connect(Po...\n"}
Stack trace in intellij run tests.
@timestamp":"2020-03-07T09:54:11.543+01:00","@version":"TEST","message":"Creating queue QueueData(campaign-spend-orbidder,MillisVisibilityTimeout(30000),PT0S,PT0S,2020-03-07T14:24:11.513+05:30,2020-03-07T14:24:11.513+05:30,None,false,false,None,None,Map())","logger_name":"org.elasticmq.actor.QueueManagerActor","thread_name":"elasticmq-akka.actor.default-dispatcher-4","level":"INFO","level_value":20000}
{"@timestamp":"2020-03-07T09:54:11.650+01:00","@version":"TEST","message":"Creating queue QueueData(service-bookings-queue-url,MillisVisibilityTimeout(30000),PT0S,PT0S,2020-03-07T14:24:11.650+05:30,2020-03-07T14:24:11.650+05:30,None,false,false,None,None,Map())","logger_name":"org.elasticmq.actor.QueueManagerActor","thread_name":"elasticmq-akka.actor.default-dispatcher-3","level":"INFO","level_value":20000}
{"@timestamp":"2020-03-07T09:54:11.808+01:00","@version":"TEST","message":"Initializing ExecutorService","logger_name":"org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor","thread_name":"Test worker","level":"INFO","level_value":20000}
{"@timestamp":"2020-03-07T09:54:11.951+01:00","@version":"TEST","message":"Initializing ExecutorService 'applicationTaskExecutor'","logger_name":"org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor","thread_name":"Test worker","level":"INFO","level_value":20000}
{"@timestamp":"2020-03-07T09:54:12.243+01:00","@version":"TEST","message":"Started AmountSpentEventListenerIntegrationTest in 11.29 seconds (JVM running for 12.257)","logger_name":"de.otto.platform.accounting.messaging.AmountEventListenerIntegrationTest","thread_name":"Test worker","level":"INFO","level_value":20000}
{"@timestamp":"2020-03-07T09:54:12.357+01:00","@version":"TEST","message":"Received amount spent message from test: {\n \"eventType\": \"blah\",\n \"eventTimestamp\": \"2019-08-21T11:05:03+00:00\",\n