Package com.google.cloud.logging.testing
Class RemoteLoggingHelper
java.lang.Object
com.google.cloud.logging.testing.RemoteLoggingHelper
Utility to create a remote logging configuration for testing. Logging options can be obtained via
the
getOptions() method. Returned options have custom ServiceOptions.getRetrySettings(): RetrySettings.getMaxRetryDelay() is 30000,
RetrySettings.getTotalTimeout() is 120000 and RetrySettings.getInitialRetryDelay() is 250.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic RemoteLoggingHelpercreate()Creates aRemoteLoggingHelperobject using default project id and authentication credentials.static RemoteLoggingHelpercreate(String projectId, InputStream keyStream) Creates aRemoteLoggingHelperobject for the given project id and JSON key input stream.static StringformatForTest(String name) Formats a resource name for testing purpose.Returns aLoggingOptionsobject to be used for testing.
-
Method Details
-
getOptions
Returns aLoggingOptionsobject to be used for testing. -
create
Creates aRemoteLoggingHelperobject for the given project id and JSON key input stream.- Parameters:
projectId- id of the project to be used for running the testskeyStream- input stream for a JSON key- Returns:
- A
RemoteLoggingHelperobject for the provided options - Throws:
RemoteLoggingHelper.LoggingHelperException- ifkeyStreamis not a valid JSON key stream
-
create
Creates aRemoteLoggingHelperobject using default project id and authentication credentials. -
formatForTest
Formats a resource name for testing purpose. This method appends a random UUID to the provided name.
-