Class RemoteLoggingHelper (3.9.0)

public class RemoteLoggingHelper

Utility to create a remote logging configuration for testing. Logging options can be obtained via the #getOptions() method. Returned options have custom LoggingOptions#getRetrySettings(): RetrySettings#getMaxRetryDelay() is 30000, RetrySettings#getTotalTimeout() is 120000 and RetrySettings#getInitialRetryDelay() is 250.

Inheritance

java.lang.Object > RemoteLoggingHelper

Static Methods

create()

public static RemoteLoggingHelper create()

Creates a RemoteLoggingHelper object using default project id and authentication credentials.

Returns
TypeDescription
RemoteLoggingHelper
Exceptions
TypeDescription
RemoteLoggingHelper.LoggingHelperException

create(String projectId, InputStream keyStream)

public static RemoteLoggingHelper create(String projectId, InputStream keyStream)

Creates a RemoteLoggingHelper object for the given project id and JSON key input stream.

Parameters
NameDescription
projectIdString

id of the project to be used for running the tests

keyStreamInputStream

input stream for a JSON key

Returns
TypeDescription
RemoteLoggingHelper

A RemoteLoggingHelper object for the provided options

Exceptions
TypeDescription
RemoteLoggingHelper.LoggingHelperException

if keyStream is not a valid JSON key stream

formatForTest(String name)

public static String formatForTest(String name)

Formats a resource name for testing purpose. This method appends a random UUID to the provided name.

Parameter
NameDescription
nameString
Returns
TypeDescription
String

Methods

getOptions()

public LoggingOptions getOptions()

Returns a LoggingOptions object to be used for testing.

Returns
TypeDescription
LoggingOptions