# frozen_string_literal: true

# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Auto-generated by gapic-generator-ruby. DO NOT EDIT!

require "helper"

require "gapic/grpc/service_stub"

require "google/cloud/oracledatabase/v1/oracledatabase_pb"
require "google/cloud/oracle_database/v1/oracle_database"

class ::Google::Cloud::OracleDatabase::V1::OracleDatabase::ClientTest < Minitest::Test
  class ClientStub
    attr_accessor :call_rpc_count, :requests

    def initialize response, operation, &block
      @response = response
      @operation = operation
      @block = block
      @call_rpc_count = 0
      @requests = []
    end

    def call_rpc *args, **kwargs
      @call_rpc_count += 1

      @requests << @block&.call(*args, **kwargs)

      catch :response do
        yield @response, @operation if block_given?
        @response
      end
    end

    def endpoint
      "endpoint.example.com"
    end

    def universe_domain
      "example.com"
    end

    def stub_logger
      nil
    end

    def logger
      nil
    end
  end

  def test_list_cloud_exadata_infrastructures
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::ListCloudExadataInfrastructuresResponse.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    page_size = 42
    page_token = "hello world"

    list_cloud_exadata_infrastructures_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :list_cloud_exadata_infrastructures, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::ListCloudExadataInfrastructuresRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal 42, request["page_size"]
      assert_equal "hello world", request["page_token"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, list_cloud_exadata_infrastructures_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.list_cloud_exadata_infrastructures({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.list_cloud_exadata_infrastructures parent: parent, page_size: page_size, page_token: page_token do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.list_cloud_exadata_infrastructures ::Google::Cloud::OracleDatabase::V1::ListCloudExadataInfrastructuresRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.list_cloud_exadata_infrastructures({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.list_cloud_exadata_infrastructures(::Google::Cloud::OracleDatabase::V1::ListCloudExadataInfrastructuresRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, list_cloud_exadata_infrastructures_client_stub.call_rpc_count
    end
  end

  def test_get_cloud_exadata_infrastructure
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::CloudExadataInfrastructure.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    name = "hello world"

    get_cloud_exadata_infrastructure_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :get_cloud_exadata_infrastructure, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::GetCloudExadataInfrastructureRequest, request
      assert_equal "hello world", request["name"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, get_cloud_exadata_infrastructure_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.get_cloud_exadata_infrastructure({ name: name }) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.get_cloud_exadata_infrastructure name: name do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.get_cloud_exadata_infrastructure ::Google::Cloud::OracleDatabase::V1::GetCloudExadataInfrastructureRequest.new(name: name) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.get_cloud_exadata_infrastructure({ name: name }, grpc_options) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.get_cloud_exadata_infrastructure(::Google::Cloud::OracleDatabase::V1::GetCloudExadataInfrastructureRequest.new(name: name), grpc_options) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, get_cloud_exadata_infrastructure_client_stub.call_rpc_count
    end
  end

  def test_create_cloud_exadata_infrastructure
    # Create GRPC objects.
    grpc_response = ::Google::Longrunning::Operation.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    cloud_exadata_infrastructure_id = "hello world"
    cloud_exadata_infrastructure = {}
    request_id = "hello world"

    create_cloud_exadata_infrastructure_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :create_cloud_exadata_infrastructure, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::CreateCloudExadataInfrastructureRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal "hello world", request["cloud_exadata_infrastructure_id"]
      assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::OracleDatabase::V1::CloudExadataInfrastructure), request["cloud_exadata_infrastructure"]
      assert_equal "hello world", request["request_id"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, create_cloud_exadata_infrastructure_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.create_cloud_exadata_infrastructure({ parent: parent, cloud_exadata_infrastructure_id: cloud_exadata_infrastructure_id, cloud_exadata_infrastructure: cloud_exadata_infrastructure, request_id: request_id }) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.create_cloud_exadata_infrastructure parent: parent, cloud_exadata_infrastructure_id: cloud_exadata_infrastructure_id, cloud_exadata_infrastructure: cloud_exadata_infrastructure, request_id: request_id do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.create_cloud_exadata_infrastructure ::Google::Cloud::OracleDatabase::V1::CreateCloudExadataInfrastructureRequest.new(parent: parent, cloud_exadata_infrastructure_id: cloud_exadata_infrastructure_id, cloud_exadata_infrastructure: cloud_exadata_infrastructure, request_id: request_id) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.create_cloud_exadata_infrastructure({ parent: parent, cloud_exadata_infrastructure_id: cloud_exadata_infrastructure_id, cloud_exadata_infrastructure: cloud_exadata_infrastructure, request_id: request_id }, grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.create_cloud_exadata_infrastructure(::Google::Cloud::OracleDatabase::V1::CreateCloudExadataInfrastructureRequest.new(parent: parent, cloud_exadata_infrastructure_id: cloud_exadata_infrastructure_id, cloud_exadata_infrastructure: cloud_exadata_infrastructure, request_id: request_id), grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, create_cloud_exadata_infrastructure_client_stub.call_rpc_count
    end
  end

  def test_delete_cloud_exadata_infrastructure
    # Create GRPC objects.
    grpc_response = ::Google::Longrunning::Operation.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    name = "hello world"
    request_id = "hello world"
    force = true

    delete_cloud_exadata_infrastructure_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :delete_cloud_exadata_infrastructure, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::DeleteCloudExadataInfrastructureRequest, request
      assert_equal "hello world", request["name"]
      assert_equal "hello world", request["request_id"]
      assert_equal true, request["force"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, delete_cloud_exadata_infrastructure_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.delete_cloud_exadata_infrastructure({ name: name, request_id: request_id, force: force }) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.delete_cloud_exadata_infrastructure name: name, request_id: request_id, force: force do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.delete_cloud_exadata_infrastructure ::Google::Cloud::OracleDatabase::V1::DeleteCloudExadataInfrastructureRequest.new(name: name, request_id: request_id, force: force) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.delete_cloud_exadata_infrastructure({ name: name, request_id: request_id, force: force }, grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.delete_cloud_exadata_infrastructure(::Google::Cloud::OracleDatabase::V1::DeleteCloudExadataInfrastructureRequest.new(name: name, request_id: request_id, force: force), grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, delete_cloud_exadata_infrastructure_client_stub.call_rpc_count
    end
  end

  def test_list_cloud_vm_clusters
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::ListCloudVmClustersResponse.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    page_size = 42
    page_token = "hello world"
    filter = "hello world"

    list_cloud_vm_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :list_cloud_vm_clusters, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::ListCloudVmClustersRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal 42, request["page_size"]
      assert_equal "hello world", request["page_token"]
      assert_equal "hello world", request["filter"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, list_cloud_vm_clusters_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.list_cloud_vm_clusters({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.list_cloud_vm_clusters parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.list_cloud_vm_clusters ::Google::Cloud::OracleDatabase::V1::ListCloudVmClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.list_cloud_vm_clusters({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.list_cloud_vm_clusters(::Google::Cloud::OracleDatabase::V1::ListCloudVmClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, list_cloud_vm_clusters_client_stub.call_rpc_count
    end
  end

  def test_get_cloud_vm_cluster
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::CloudVmCluster.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    name = "hello world"

    get_cloud_vm_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :get_cloud_vm_cluster, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::GetCloudVmClusterRequest, request
      assert_equal "hello world", request["name"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, get_cloud_vm_cluster_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.get_cloud_vm_cluster({ name: name }) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.get_cloud_vm_cluster name: name do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.get_cloud_vm_cluster ::Google::Cloud::OracleDatabase::V1::GetCloudVmClusterRequest.new(name: name) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.get_cloud_vm_cluster({ name: name }, grpc_options) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.get_cloud_vm_cluster(::Google::Cloud::OracleDatabase::V1::GetCloudVmClusterRequest.new(name: name), grpc_options) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, get_cloud_vm_cluster_client_stub.call_rpc_count
    end
  end

  def test_create_cloud_vm_cluster
    # Create GRPC objects.
    grpc_response = ::Google::Longrunning::Operation.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    cloud_vm_cluster_id = "hello world"
    cloud_vm_cluster = {}
    request_id = "hello world"

    create_cloud_vm_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :create_cloud_vm_cluster, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::CreateCloudVmClusterRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal "hello world", request["cloud_vm_cluster_id"]
      assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::OracleDatabase::V1::CloudVmCluster), request["cloud_vm_cluster"]
      assert_equal "hello world", request["request_id"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, create_cloud_vm_cluster_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.create_cloud_vm_cluster({ parent: parent, cloud_vm_cluster_id: cloud_vm_cluster_id, cloud_vm_cluster: cloud_vm_cluster, request_id: request_id }) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.create_cloud_vm_cluster parent: parent, cloud_vm_cluster_id: cloud_vm_cluster_id, cloud_vm_cluster: cloud_vm_cluster, request_id: request_id do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.create_cloud_vm_cluster ::Google::Cloud::OracleDatabase::V1::CreateCloudVmClusterRequest.new(parent: parent, cloud_vm_cluster_id: cloud_vm_cluster_id, cloud_vm_cluster: cloud_vm_cluster, request_id: request_id) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.create_cloud_vm_cluster({ parent: parent, cloud_vm_cluster_id: cloud_vm_cluster_id, cloud_vm_cluster: cloud_vm_cluster, request_id: request_id }, grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.create_cloud_vm_cluster(::Google::Cloud::OracleDatabase::V1::CreateCloudVmClusterRequest.new(parent: parent, cloud_vm_cluster_id: cloud_vm_cluster_id, cloud_vm_cluster: cloud_vm_cluster, request_id: request_id), grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, create_cloud_vm_cluster_client_stub.call_rpc_count
    end
  end

  def test_delete_cloud_vm_cluster
    # Create GRPC objects.
    grpc_response = ::Google::Longrunning::Operation.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    name = "hello world"
    request_id = "hello world"
    force = true

    delete_cloud_vm_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :delete_cloud_vm_cluster, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::DeleteCloudVmClusterRequest, request
      assert_equal "hello world", request["name"]
      assert_equal "hello world", request["request_id"]
      assert_equal true, request["force"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, delete_cloud_vm_cluster_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.delete_cloud_vm_cluster({ name: name, request_id: request_id, force: force }) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.delete_cloud_vm_cluster name: name, request_id: request_id, force: force do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.delete_cloud_vm_cluster ::Google::Cloud::OracleDatabase::V1::DeleteCloudVmClusterRequest.new(name: name, request_id: request_id, force: force) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.delete_cloud_vm_cluster({ name: name, request_id: request_id, force: force }, grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.delete_cloud_vm_cluster(::Google::Cloud::OracleDatabase::V1::DeleteCloudVmClusterRequest.new(name: name, request_id: request_id, force: force), grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, delete_cloud_vm_cluster_client_stub.call_rpc_count
    end
  end

  def test_list_entitlements
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::ListEntitlementsResponse.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    page_size = 42
    page_token = "hello world"

    list_entitlements_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :list_entitlements, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::ListEntitlementsRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal 42, request["page_size"]
      assert_equal "hello world", request["page_token"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, list_entitlements_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.list_entitlements({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.list_entitlements parent: parent, page_size: page_size, page_token: page_token do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.list_entitlements ::Google::Cloud::OracleDatabase::V1::ListEntitlementsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.list_entitlements({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.list_entitlements(::Google::Cloud::OracleDatabase::V1::ListEntitlementsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, list_entitlements_client_stub.call_rpc_count
    end
  end

  def test_list_db_servers
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::ListDbServersResponse.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    page_size = 42
    page_token = "hello world"

    list_db_servers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :list_db_servers, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::ListDbServersRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal 42, request["page_size"]
      assert_equal "hello world", request["page_token"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, list_db_servers_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.list_db_servers({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.list_db_servers parent: parent, page_size: page_size, page_token: page_token do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.list_db_servers ::Google::Cloud::OracleDatabase::V1::ListDbServersRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.list_db_servers({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.list_db_servers(::Google::Cloud::OracleDatabase::V1::ListDbServersRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, list_db_servers_client_stub.call_rpc_count
    end
  end

  def test_list_db_nodes
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::ListDbNodesResponse.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    page_size = 42
    page_token = "hello world"

    list_db_nodes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :list_db_nodes, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::ListDbNodesRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal 42, request["page_size"]
      assert_equal "hello world", request["page_token"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, list_db_nodes_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.list_db_nodes({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.list_db_nodes parent: parent, page_size: page_size, page_token: page_token do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.list_db_nodes ::Google::Cloud::OracleDatabase::V1::ListDbNodesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.list_db_nodes({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.list_db_nodes(::Google::Cloud::OracleDatabase::V1::ListDbNodesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, list_db_nodes_client_stub.call_rpc_count
    end
  end

  def test_list_gi_versions
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::ListGiVersionsResponse.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    page_size = 42
    page_token = "hello world"

    list_gi_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :list_gi_versions, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::ListGiVersionsRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal 42, request["page_size"]
      assert_equal "hello world", request["page_token"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, list_gi_versions_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.list_gi_versions({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.list_gi_versions parent: parent, page_size: page_size, page_token: page_token do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.list_gi_versions ::Google::Cloud::OracleDatabase::V1::ListGiVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.list_gi_versions({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.list_gi_versions(::Google::Cloud::OracleDatabase::V1::ListGiVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, list_gi_versions_client_stub.call_rpc_count
    end
  end

  def test_list_db_system_shapes
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::ListDbSystemShapesResponse.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    page_size = 42
    page_token = "hello world"

    list_db_system_shapes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :list_db_system_shapes, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::ListDbSystemShapesRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal 42, request["page_size"]
      assert_equal "hello world", request["page_token"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, list_db_system_shapes_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.list_db_system_shapes({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.list_db_system_shapes parent: parent, page_size: page_size, page_token: page_token do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.list_db_system_shapes ::Google::Cloud::OracleDatabase::V1::ListDbSystemShapesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.list_db_system_shapes({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.list_db_system_shapes(::Google::Cloud::OracleDatabase::V1::ListDbSystemShapesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, list_db_system_shapes_client_stub.call_rpc_count
    end
  end

  def test_list_autonomous_databases
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::ListAutonomousDatabasesResponse.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    page_size = 42
    page_token = "hello world"
    filter = "hello world"
    order_by = "hello world"

    list_autonomous_databases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :list_autonomous_databases, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::ListAutonomousDatabasesRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal 42, request["page_size"]
      assert_equal "hello world", request["page_token"]
      assert_equal "hello world", request["filter"]
      assert_equal "hello world", request["order_by"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, list_autonomous_databases_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.list_autonomous_databases({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.list_autonomous_databases parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.list_autonomous_databases ::Google::Cloud::OracleDatabase::V1::ListAutonomousDatabasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.list_autonomous_databases({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.list_autonomous_databases(::Google::Cloud::OracleDatabase::V1::ListAutonomousDatabasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, list_autonomous_databases_client_stub.call_rpc_count
    end
  end

  def test_get_autonomous_database
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::AutonomousDatabase.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    name = "hello world"

    get_autonomous_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :get_autonomous_database, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::GetAutonomousDatabaseRequest, request
      assert_equal "hello world", request["name"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, get_autonomous_database_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.get_autonomous_database({ name: name }) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.get_autonomous_database name: name do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.get_autonomous_database ::Google::Cloud::OracleDatabase::V1::GetAutonomousDatabaseRequest.new(name: name) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.get_autonomous_database({ name: name }, grpc_options) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.get_autonomous_database(::Google::Cloud::OracleDatabase::V1::GetAutonomousDatabaseRequest.new(name: name), grpc_options) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, get_autonomous_database_client_stub.call_rpc_count
    end
  end

  def test_create_autonomous_database
    # Create GRPC objects.
    grpc_response = ::Google::Longrunning::Operation.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    autonomous_database_id = "hello world"
    autonomous_database = {}
    request_id = "hello world"

    create_autonomous_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :create_autonomous_database, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::CreateAutonomousDatabaseRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal "hello world", request["autonomous_database_id"]
      assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::OracleDatabase::V1::AutonomousDatabase), request["autonomous_database"]
      assert_equal "hello world", request["request_id"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, create_autonomous_database_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.create_autonomous_database({ parent: parent, autonomous_database_id: autonomous_database_id, autonomous_database: autonomous_database, request_id: request_id }) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.create_autonomous_database parent: parent, autonomous_database_id: autonomous_database_id, autonomous_database: autonomous_database, request_id: request_id do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.create_autonomous_database ::Google::Cloud::OracleDatabase::V1::CreateAutonomousDatabaseRequest.new(parent: parent, autonomous_database_id: autonomous_database_id, autonomous_database: autonomous_database, request_id: request_id) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.create_autonomous_database({ parent: parent, autonomous_database_id: autonomous_database_id, autonomous_database: autonomous_database, request_id: request_id }, grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.create_autonomous_database(::Google::Cloud::OracleDatabase::V1::CreateAutonomousDatabaseRequest.new(parent: parent, autonomous_database_id: autonomous_database_id, autonomous_database: autonomous_database, request_id: request_id), grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, create_autonomous_database_client_stub.call_rpc_count
    end
  end

  def test_delete_autonomous_database
    # Create GRPC objects.
    grpc_response = ::Google::Longrunning::Operation.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    name = "hello world"
    request_id = "hello world"

    delete_autonomous_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :delete_autonomous_database, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::DeleteAutonomousDatabaseRequest, request
      assert_equal "hello world", request["name"]
      assert_equal "hello world", request["request_id"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, delete_autonomous_database_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.delete_autonomous_database({ name: name, request_id: request_id }) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.delete_autonomous_database name: name, request_id: request_id do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.delete_autonomous_database ::Google::Cloud::OracleDatabase::V1::DeleteAutonomousDatabaseRequest.new(name: name, request_id: request_id) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.delete_autonomous_database({ name: name, request_id: request_id }, grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.delete_autonomous_database(::Google::Cloud::OracleDatabase::V1::DeleteAutonomousDatabaseRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, delete_autonomous_database_client_stub.call_rpc_count
    end
  end

  def test_restore_autonomous_database
    # Create GRPC objects.
    grpc_response = ::Google::Longrunning::Operation.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    name = "hello world"
    restore_time = {}

    restore_autonomous_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :restore_autonomous_database, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::RestoreAutonomousDatabaseRequest, request
      assert_equal "hello world", request["name"]
      assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["restore_time"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, restore_autonomous_database_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.restore_autonomous_database({ name: name, restore_time: restore_time }) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.restore_autonomous_database name: name, restore_time: restore_time do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.restore_autonomous_database ::Google::Cloud::OracleDatabase::V1::RestoreAutonomousDatabaseRequest.new(name: name, restore_time: restore_time) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.restore_autonomous_database({ name: name, restore_time: restore_time }, grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.restore_autonomous_database(::Google::Cloud::OracleDatabase::V1::RestoreAutonomousDatabaseRequest.new(name: name, restore_time: restore_time), grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, restore_autonomous_database_client_stub.call_rpc_count
    end
  end

  def test_generate_autonomous_database_wallet
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::GenerateAutonomousDatabaseWalletResponse.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    name = "hello world"
    type = :GENERATE_TYPE_UNSPECIFIED
    is_regional = true
    password = "hello world"

    generate_autonomous_database_wallet_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :generate_autonomous_database_wallet, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::GenerateAutonomousDatabaseWalletRequest, request
      assert_equal "hello world", request["name"]
      assert_equal :GENERATE_TYPE_UNSPECIFIED, request["type"]
      assert_equal true, request["is_regional"]
      assert_equal "hello world", request["password"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, generate_autonomous_database_wallet_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.generate_autonomous_database_wallet({ name: name, type: type, is_regional: is_regional, password: password }) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.generate_autonomous_database_wallet name: name, type: type, is_regional: is_regional, password: password do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.generate_autonomous_database_wallet ::Google::Cloud::OracleDatabase::V1::GenerateAutonomousDatabaseWalletRequest.new(name: name, type: type, is_regional: is_regional, password: password) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.generate_autonomous_database_wallet({ name: name, type: type, is_regional: is_regional, password: password }, grpc_options) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.generate_autonomous_database_wallet(::Google::Cloud::OracleDatabase::V1::GenerateAutonomousDatabaseWalletRequest.new(name: name, type: type, is_regional: is_regional, password: password), grpc_options) do |response, operation|
        assert_equal grpc_response, response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, generate_autonomous_database_wallet_client_stub.call_rpc_count
    end
  end

  def test_list_autonomous_db_versions
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::ListAutonomousDbVersionsResponse.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    page_size = 42
    page_token = "hello world"

    list_autonomous_db_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :list_autonomous_db_versions, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::ListAutonomousDbVersionsRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal 42, request["page_size"]
      assert_equal "hello world", request["page_token"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, list_autonomous_db_versions_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.list_autonomous_db_versions({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.list_autonomous_db_versions parent: parent, page_size: page_size, page_token: page_token do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.list_autonomous_db_versions ::Google::Cloud::OracleDatabase::V1::ListAutonomousDbVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.list_autonomous_db_versions({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.list_autonomous_db_versions(::Google::Cloud::OracleDatabase::V1::ListAutonomousDbVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, list_autonomous_db_versions_client_stub.call_rpc_count
    end
  end

  def test_list_autonomous_database_character_sets
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::ListAutonomousDatabaseCharacterSetsResponse.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    page_size = 42
    page_token = "hello world"
    filter = "hello world"

    list_autonomous_database_character_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :list_autonomous_database_character_sets, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::ListAutonomousDatabaseCharacterSetsRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal 42, request["page_size"]
      assert_equal "hello world", request["page_token"]
      assert_equal "hello world", request["filter"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, list_autonomous_database_character_sets_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.list_autonomous_database_character_sets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.list_autonomous_database_character_sets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.list_autonomous_database_character_sets ::Google::Cloud::OracleDatabase::V1::ListAutonomousDatabaseCharacterSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.list_autonomous_database_character_sets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.list_autonomous_database_character_sets(::Google::Cloud::OracleDatabase::V1::ListAutonomousDatabaseCharacterSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, list_autonomous_database_character_sets_client_stub.call_rpc_count
    end
  end

  def test_list_autonomous_database_backups
    # Create GRPC objects.
    grpc_response = ::Google::Cloud::OracleDatabase::V1::ListAutonomousDatabaseBackupsResponse.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    parent = "hello world"
    filter = "hello world"
    page_size = 42
    page_token = "hello world"

    list_autonomous_database_backups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :list_autonomous_database_backups, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::ListAutonomousDatabaseBackupsRequest, request
      assert_equal "hello world", request["parent"]
      assert_equal "hello world", request["filter"]
      assert_equal 42, request["page_size"]
      assert_equal "hello world", request["page_token"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, list_autonomous_database_backups_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.list_autonomous_database_backups({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.list_autonomous_database_backups parent: parent, filter: filter, page_size: page_size, page_token: page_token do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.list_autonomous_database_backups ::Google::Cloud::OracleDatabase::V1::ListAutonomousDatabaseBackupsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.list_autonomous_database_backups({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.list_autonomous_database_backups(::Google::Cloud::OracleDatabase::V1::ListAutonomousDatabaseBackupsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation|
        assert_kind_of Gapic::PagedEnumerable, response
        assert_equal grpc_response, response.response
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, list_autonomous_database_backups_client_stub.call_rpc_count
    end
  end

  def test_stop_autonomous_database
    # Create GRPC objects.
    grpc_response = ::Google::Longrunning::Operation.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    name = "hello world"

    stop_autonomous_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :stop_autonomous_database, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::StopAutonomousDatabaseRequest, request
      assert_equal "hello world", request["name"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, stop_autonomous_database_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.stop_autonomous_database({ name: name }) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.stop_autonomous_database name: name do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.stop_autonomous_database ::Google::Cloud::OracleDatabase::V1::StopAutonomousDatabaseRequest.new(name: name) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.stop_autonomous_database({ name: name }, grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.stop_autonomous_database(::Google::Cloud::OracleDatabase::V1::StopAutonomousDatabaseRequest.new(name: name), grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, stop_autonomous_database_client_stub.call_rpc_count
    end
  end

  def test_start_autonomous_database
    # Create GRPC objects.
    grpc_response = ::Google::Longrunning::Operation.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    name = "hello world"

    start_autonomous_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :start_autonomous_database, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::StartAutonomousDatabaseRequest, request
      assert_equal "hello world", request["name"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, start_autonomous_database_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.start_autonomous_database({ name: name }) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.start_autonomous_database name: name do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.start_autonomous_database ::Google::Cloud::OracleDatabase::V1::StartAutonomousDatabaseRequest.new(name: name) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.start_autonomous_database({ name: name }, grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.start_autonomous_database(::Google::Cloud::OracleDatabase::V1::StartAutonomousDatabaseRequest.new(name: name), grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, start_autonomous_database_client_stub.call_rpc_count
    end
  end

  def test_restart_autonomous_database
    # Create GRPC objects.
    grpc_response = ::Google::Longrunning::Operation.new
    grpc_operation = GRPC::ActiveCall::Operation.new nil
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    grpc_options = {}

    # Create request parameters for a unary method.
    name = "hello world"

    restart_autonomous_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:|
      assert_equal :restart_autonomous_database, name
      assert_kind_of ::Google::Cloud::OracleDatabase::V1::RestartAutonomousDatabaseRequest, request
      assert_equal "hello world", request["name"]
      refute_nil options
    end

    Gapic::ServiceStub.stub :new, restart_autonomous_database_client_stub do
      # Create client
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end

      # Use hash object
      client.restart_autonomous_database({ name: name }) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use named arguments
      client.restart_autonomous_database name: name do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object
      client.restart_autonomous_database ::Google::Cloud::OracleDatabase::V1::RestartAutonomousDatabaseRequest.new(name: name) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use hash object with options
      client.restart_autonomous_database({ name: name }, grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Use protobuf object with options
      client.restart_autonomous_database(::Google::Cloud::OracleDatabase::V1::RestartAutonomousDatabaseRequest.new(name: name), grpc_options) do |response, operation|
        assert_kind_of Gapic::Operation, response
        assert_equal grpc_response, response.grpc_op
        assert_equal grpc_operation, operation
      end

      # Verify method calls
      assert_equal 5, restart_autonomous_database_client_stub.call_rpc_count
    end
  end

  def test_configure
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure

    client = block_config = config = nil
    dummy_stub = ClientStub.new nil, nil
    Gapic::ServiceStub.stub :new, dummy_stub do
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end
    end

    config = client.configure do |c|
      block_config = c
    end

    assert_same block_config, config
    assert_kind_of ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client::Configuration, config
  end

  def test_operations_client
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure

    client = nil
    dummy_stub = ClientStub.new nil, nil
    Gapic::ServiceStub.stub :new, dummy_stub do
      client = ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Client.new do |config|
        config.credentials = grpc_channel
      end
    end

    assert_kind_of ::Google::Cloud::OracleDatabase::V1::OracleDatabase::Operations, client.operations_client
  end
end
