You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sts_exchange_test.go
    path of file: ./repos/google-cloud-go/auth/detect/internal/stsexchange
    
    the code of the file until where you have to start completion: // 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
//
//      http://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.

package stsexchange

import (
	"context"
	"encoding/json"
	"io"
	"net/http"
	"net/http/httptest"
	"net/url"
	"testing"

	"cloud.google.com/go/auth"
	"cloud.google.com/go/auth/internal"
	"github.com/google/go-cmp/cmp"
)

var (
	clientAuth = ClientAuthentication{
		AuthStyle:    auth.StyleInHeader,
		ClientID:     clientID,
		ClientSecret: clientSecret,
	}
	tokReq = TokenRequest{
		ActingParty: struct {
			ActorToken     string
			ActorTokenType string
		}{},
		GrantType:          GrantType,
		Resource:           "",
		Audience:           "32555940559.apps.googleusercontent.com",
		Scope:              []string{"https://www.googleapis.com/auth/devstorage.full_control"},
		RequestedTokenType: TokenType,
		SubjectToken:       "Sample.Subject.Token",
		SubjectTokenType:   jwtTokenType,
	}

	responseBody = `{"access_token":"Sample.Access.Token","issued_token_type":"urn:ietf:para
    
func TestExchangeToken_Opts(t *testing.T) {
	optsValues := [][]string{{"foo", "bar"}, {"cat", "pan"}}
	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		body, err := io.ReadAll(r.Body)
		if err != nil {
			t.Fatalf("io.ReadAll() = %v", err)
		}
		data, err := url.ParseQuery(string(body))
		if err != nil {
			t.Fatalf("url.ParseQuery() = %v", err)
		}
		strOpts, ok := data["options"]
		if !ok {
			t.Errorf(`server didn't receive an "options" field`)
		} else if len(strOpts) < 1 {
			t.Errorf(`"options" field has length 0`)
		}
		var opts map[string]interface{}
		err = json.Unmarshal([]byte(strOpts[0]), &opts)
		if err != nil {
			t.Fatalf(`couldn't parse received "options" field`)
		}
		if len(opts) < 2 {
			t.Errorf("too few options received")
		}

		val, ok := opts["one"]
		if !ok {
			t.Errorf("couldn't find first option parameter")
		} else {
			tOpts1, ok := val.(map[string]interface{})
			if !ok {
				t.Errorf("failed to assert the first option parameter as type testOpts")
			} else {
				if got, want := tOpts1["first"].(string), optsValues[0][0]; got != want {
					t.Errorf("got %v, want %v", got, want)
				}
				if got, want := tOpts1["second"].(string), optsValues[0][1]; got != want {
					t.Errorf("got %v, want %v", got, want)
				}
			}
		}

		val2, ok := opts["two"]
		if !ok {
			t.Errorf("couldn't find second option parameter")
		} else {
			tOpts2, ok := val2.(map[string]interface{})
			if !ok {
				t.Errorf("Failed to assert the second option parameter as type testOpts.")
			} else {
				if got, want := tOpts2["first"].(string), optsValues[1][0]; got != want {
					t.Errorf("got %v, want %v", got, want)
				}
				if got, want := tOpts2["second"].(string), optsValues[1][1]; got != want {
					t.Errorf("got %v, want %v", got, want)
				}
			}
		}
		// Send a proper reply so that no other errors crop up.
		w.Header().Set("Content-Type", "application/json")
		w.Write([]byte(responseBody))

	}))
	defer ts.Close()
	headers := http.Header{}
	headers.Set("Content-Type", "application/x-www-form-urlencoded")

	type testOpts struct {
		First  string `json:"first"`
		Second string `json:"second"`
	}
	firstOption := testOpts{optsValues[0][0], optsValues[0][1]}
	secondOption := testOpts{optsValues[1][0], optsValues[1][1]}
	inputOpts := make(map[string]interface{})
	inputOpts["one"] = firstOption
	inputOpts["two"] = secondOption

	ExchangeToken(context.Background(), &Options{
		Client:         internal.CloneDefaultClient(),
		Endpoint:       ts.URL,
		Request:        &tokReq,
		Authentication: clientAuth,
		Headers:        headers,
		ExtraOpts:      inputOpts,
	})
}