This component is based on the google java storage library that works as a client for the Google Cloud Storage.
The unit tests provided are somewhat limited. Due to the nature of the component, it needs to be tested against a google Storage instance because although there are some emulators they doesn't cover all the functionalities.
The tests are organized into two packages:
For the Unit tests has been extended the emulator google-cloud-nio adding some functionalities (bucket creation and deletion). However there are still some unsupported operations.
To run the Google Storage client library, you must first set up authentication by creating a service account key. You can find more info at: cloud.google.com/storage/docs/reference/libraries#setting_up_authentication.
When you have the service account key you can provide authentication credentials to your application code by setting the environment variable:
export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/my-key.json"
or for windows:
$Env:GOOGLE_APPLICATION_CREDENTIALS = "/home/user/Downloads/my-key.json"
or directly through the component endpoint
from("google-storage://myCamelBucket?serviceAccountKey=/home/user/Downloads/my-key.json")
Running integration tests will be automatically executed if the GOOGLE_APPLICATION_CREDENTIALS is exported, and the verify
target is executed:
mvn verify