Rate This Document
Findability
Accuracy
Completeness
Readability

spring-cloud-gcp Error

Symptom

No error is reported when the GcpDatastoreEmulatorIntegrationTests case is querying datastore. However, the test case requires that an error be reported. The Cloud Datastore Emulator version is 291.0.0.

Key Process and Cause Analysis

Add the code for throwing exceptions to the code segment where the exception may occur. Modify the code to query the datastore.

Conclusion and Solution

  1. Open the GcpDatastoreEmulatorIntegrationTests.java file in the spring-cloud-gcp source code directory.
    cd /home/spring-cloud-gcp
    vim spring-cloud-gcp-autoconfigure/src/test/java/org/springframework/cloud/gcp/autoconfigure/datastore/it/GcpDatastoreEmulatorIntegrationTests.java
  2. Comment out lines 102 to 103 and add the following content to line 104, as shown in the following figure.
    datastore.run(query);

  3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Run the compile command again.
    ./mvnw clean install -Dgpg.skip=true