# frozen_string_literal: true

# Copyright 2023 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/discovery_engine/v1beta/document_service"

class ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::ClientPathsTest < Minitest::Test
  class DummyStub
    def endpoint
      "endpoint.example.com"
    end
  
    def universe_domain
      "example.com"
    end

    def stub_logger
      nil
    end

    def logger
      nil
    end
  end

  def test_branch_path
    grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    ::Gapic::ServiceStub.stub :new, DummyStub.new do
      client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Client.new do |config|
        config.credentials = grpc_channel
      end

      path = client.branch_path project: "value0", location: "value1", data_store: "value2", branch: "value3"
      assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3", path

      path = client.branch_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4"
      assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4", path
    end
  end

  def test_document_path
    grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    ::Gapic::ServiceStub.stub :new, DummyStub.new do
      client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Client.new do |config|
        config.credentials = grpc_channel
      end

      path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4"
      assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path

      path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5"
      assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path
    end
  end

  def test_fhir_resource_path
    grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    ::Gapic::ServiceStub.stub :new, DummyStub.new do
      client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Client.new do |config|
        config.credentials = grpc_channel
      end

      path = client.fhir_resource_path project: "value0", location: "value1", dataset: "value2", fhir_store: "value3", resource_type: "value4", fhir_resource_id: "value5"
      assert_equal "projects/value0/locations/value1/datasets/value2/fhirStores/value3/fhir/value4/value5", path
    end
  end

  def test_fhir_store_path
    grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    ::Gapic::ServiceStub.stub :new, DummyStub.new do
      client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Client.new do |config|
        config.credentials = grpc_channel
      end

      path = client.fhir_store_path project: "value0", location: "value1", dataset: "value2", fhir_store: "value3"
      assert_equal "projects/value0/locations/value1/datasets/value2/fhirStores/value3", path
    end
  end
end
