Skip to content

Example Spring project showing how to use GCP emulator in a test

Notifications You must be signed in to change notification settings

nhartner/pubsub-emulator-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pubsub-emulator-demo

Example Spring project showing how to use launch GCP emulator and test spring GCP pubsub in a test.

Key points:

  • test-containers library is used to launch google-sdk docker container and start pubsub emulator inside it
  • Tests are overridden to hit emulator via src/test/resources/test.properties by setting spring.cloud.gcp.pubsub-emulator-host: localhost:8085 (default emulator port)
  • TestPubSubConfig is used to bring up pubsub emulator inside a docker container, create a topic and subscription in the emulator. This is using GCP SDK directly, not Spring pubsub, to create the resources.

About

Example Spring project showing how to use GCP emulator in a test

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages