Class MockInstanceAdminConnection (2.15.1)

Application developers may want to test their code with simulated responses, including errors from a spanner::InstanceAdminClient. To do so, construct a spanner::InstanceAdminClient with an instance of this class. Then use the Google Test framework functions to program the behavior of this mock.

Functions

GetInstance(GetInstanceParams)

Return the metadata for the given instance.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
GetInstanceParams
Returns
Type Description
StatusOr< google::spanner::admin::instance::v1::Instance >

CreateInstance(CreateInstanceParams)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
p CreateInstanceParams
Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::Instance > >

UpdateInstance(UpdateInstanceParams)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
p UpdateInstanceParams
Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::Instance > >

DeleteInstance(DeleteInstanceParams)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
p DeleteInstanceParams
Returns
Type Description
Status

GetInstanceConfig(GetInstanceConfigParams)

Return the InstanceConfig with the given name.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
GetInstanceConfigParams
Returns
Type Description
StatusOr< google::spanner::admin::instance::v1::InstanceConfig >

ListInstanceConfigs(ListInstanceConfigsParams)

Returns a one-pass input range with all the instance configs.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
ListInstanceConfigsParams
Returns
Type Description
ListInstanceConfigsRange

ListInstances(ListInstancesParams)

Returns a one-pass input range with all the instances meeting the requirements in params.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
params ListInstancesParams
Returns
Type Description
ListInstancesRange

GetIamPolicy(GetIamPolicyParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.GetIamPolicy RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
GetIamPolicyParams
Returns
Type Description
StatusOr< google::iam::v1::Policy >

SetIamPolicy(SetIamPolicyParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.SetIamPolicy RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
SetIamPolicyParams
Returns
Type Description
StatusOr< google::iam::v1::Policy >

TestIamPermissions(TestIamPermissionsParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.TestIamPermissions RPC.

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
Name Description
TestIamPermissionsParams
Returns
Type Description
StatusOr< google::iam::v1::TestIamPermissionsResponse >

virtual options()

Returns
Type Description
Options