title: Spring+GCP Datastore: I use repository and want to configure it to use datastore emulator during development or test
body: <p>I started emulator by this line:</p>
  
  <pre><code>gcloud beta emulators datastore start --host-port=localhost:8484 --no-store-on-disk
  </code></pre>
  
  <p>of course i can define com.google.cloud.datastore.Datastore and create instance by this lines:</p>
  
  <pre><code>            return DatastoreOptions.newBuilder()
                  .setHost("http://localhost:8484")
                  .setProjectId("analytics-project")
                  .build()
                  .getService();
  </code></pre>
  
  <p>but how to <strong>force</strong> spring-gcp repositories to use emulator datastore?</p>
  
  <p>Example of repository class:</p>
  
  <pre><code>import org.springframework.cloud.gcp.data.datastore.repository.DatastoreRepository;
  
  import java.util.List;
  
  public interface AnalyticsUserRepo extends DatastoreRepository&lt;AnalyticsUser, String&gt; {
  
      List&lt;AnalyticsUser&gt; findByEmail(String email);
  
  }
  </code></pre>