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
-
Method Summary
Modifier and TypeMethodDescriptionstatic RemoteLoggingHelper
create()
Creates aRemoteLoggingHelper
object using default project id and authentication credentials.static RemoteLoggingHelper
create
(String projectId, InputStream keyStream) Creates aRemoteLoggingHelper
object for the given project id and JSON key input stream.static String
formatForTest
(String name) Formats a resource name for testing purpose.Returns aLoggingOptions
object to be used for testing.
-
Method Details
-
getOptions
Returns aLoggingOptions
object to be used for testing. -
create
Creates aRemoteLoggingHelper
object 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
RemoteLoggingHelper
object for the provided options - Throws:
RemoteLoggingHelper.LoggingHelperException
- ifkeyStream
is not a valid JSON key stream
-
create
Creates aRemoteLoggingHelper
object 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.
-