Class GcpDatastoreEmulatorAutoConfiguration

java.lang.Object
com.google.cloud.spring.autoconfigure.datastore.GcpDatastoreEmulatorAutoConfiguration
All Implemented Interfaces:
org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

@AutoConfiguration @ConditionalOnProperty("spring.cloud.gcp.datastore.emulator.enabled") @AutoConfigureBefore(GcpDatastoreAutoConfiguration.class) @EnableConfigurationProperties(GcpDatastoreProperties.class) @ConditionalOnMissingBean(com.google.cloud.datastore.testing.LocalDatastoreHelper.class) public class GcpDatastoreEmulatorAutoConfiguration extends Object implements org.springframework.context.SmartLifecycle
If spring.cloud.gcp.datastore.emulator.enabled is set to true the emulator will be started as a local datastore server using the LocalDatastoreHelper.
Since:
1.2
  • Constructor Details

    • GcpDatastoreEmulatorAutoConfiguration

      public GcpDatastoreEmulatorAutoConfiguration()
  • Method Details

    • createDatastoreHelper

      @Bean public com.google.cloud.datastore.testing.LocalDatastoreHelper createDatastoreHelper(GcpDatastoreProperties datastoreProperties)
    • stop

      public void stop()
      Stops the instance of the emulator.
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • isRunning

      public boolean isRunning()
      Checks if the instance is running. This will be true after a successful execution of the method start() and false after a successful execution of the method stop(). method is called.
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • start

      public void start()
      Starts the instance of the emulator.
      Specified by:
      start in interface org.springframework.context.Lifecycle