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
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.cloud.datastore.testing.LocalDatastoreHelper
createDatastoreHelper
(GcpDatastoreProperties datastoreProperties) boolean
Checks if the instance is running.void
start()
Starts the instance of the emulator.void
stop()
Stops the instance of the emulator.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
stop
in interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()Checks if the instance is running. This will betrue
after a successful execution of the methodstart()
andfalse
after a successful execution of the methodstop()
. method is called.- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
-
start
public void start()Starts the instance of the emulator.- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
-