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
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.cloud.datastore.testing.LocalDatastoreHelpercreateDatastoreHelper(GcpDatastoreProperties datastoreProperties) booleanChecks if the instance is running.voidstart()Starts the instance of the emulator.voidstop()Stops the instance of the emulator.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycle
getPhase, isAutoStartup, stop
-
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:
stopin interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()Checks if the instance is running. This will betrueafter a successful execution of the methodstart()andfalseafter a successful execution of the methodstop(). method is called.- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
start
public void start()Starts the instance of the emulator.- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-