Class MockInstanceAdminConnection (2.19.0)

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
NameDescription
GetInstanceParams
Returns
TypeDescription
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
NameDescription
p CreateInstanceParams
Returns
TypeDescription
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
NameDescription
p UpdateInstanceParams
Returns
TypeDescription
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
NameDescription
p DeleteInstanceParams
Returns
TypeDescription
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
NameDescription
GetInstanceConfigParams
Returns
TypeDescription
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
NameDescription
ListInstanceConfigsParams
Returns
TypeDescription
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
NameDescription
params ListInstancesParams
Returns
TypeDescription
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
NameDescription
GetIamPolicyParams
Returns
TypeDescription
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
NameDescription
SetIamPolicyParams
Returns
TypeDescription
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
NameDescription
TestIamPermissionsParams
Returns
TypeDescription
StatusOr< google::iam::v1::TestIamPermissionsResponse >

virtual options()

Returns
TypeDescription
Options