Package com.google.cloud.logging.testing
Class RemoteLoggingHelper
- java.lang.Object
-
- com.google.cloud.logging.testing.RemoteLoggingHelper
-
public class RemoteLoggingHelper extends Object
Utility to create a remote logging configuration for testing. Logging options can be obtained via thegetOptions()method. Returned options have customServiceOptions.getRetrySettings():RetrySettings.getMaxRetryDelay()is30000,RetrySettings.getTotalTimeout()is120000andRetrySettings.getInitialRetryDelay()is250.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRemoteLoggingHelper.LoggingHelperException
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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.LoggingOptionsgetOptions()Returns aLoggingOptionsobject to be used for testing.
-
-
-
Method Detail
-
getOptions
public LoggingOptions getOptions()
Returns aLoggingOptionsobject to be used for testing.
-
create
public static RemoteLoggingHelper create(String projectId, InputStream keyStream)
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
public static RemoteLoggingHelper create()
Creates aRemoteLoggingHelperobject using default project id and authentication credentials.
-
-