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: project_metadata_test.go
    path of file: ./repos/graphql-engine/cli/pkg/metadata
    
    the code of the file until where you have to start completion: package metadata

import (
	"context"
	"fmt"
	"io/ioutil"
	"net/http"
	"path/filepath"
	"strings"
	"testing"

	"github.com/hasura/graphql-engine/cli/v2/internal/errors"
	"github.com/hasura/graphql-engine/cli/v2/internal/hasura"
	"github.com/hasura/graphql-engine/cli/v2/pkg/migrate"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"

	"github.com/hasura/graphql-engine/cli/v2/internal/testutil"
)

func TestProjectMetadataOps_Apply(t *testing.T) {
	port, teardown := testutil.StartHasura(t, testutil.HasuraDockerImage)
	hgeEndpoint := fmt.Sprintf("http://localhost:%s", port)
	defer teardown()
	type fields struct {
		projectDirectory string
		endpointString   string
	}
	// Named for reuse below. We only care about the
    
func TestProjectMetadata_Reload(t *testing.T) {
	port, teardown := testutil.StartHasura(t, testutil.HasuraDockerImage)
	hgeEndpoint := fmt.Sprintf("http://localhost:%s", port)
	defer teardown()
	type fields struct {
		projectDirectory string
		endpointString   string
	}
	tests := []struct {
		name    string
		fields  fields
		want    string
		wantErr require.ErrorAssertionFunc
	}{
		{
			"can reload metadata",
			fields{
				projectDirectory: "testdata/projectv3",
				endpointString:   hgeEndpoint,
			},
			`{
				"is_consistent": true,
				"message": "success"
			}`,
			require.NoError,
		},
		// TODO: automate the following tests
		// following tests are currently ran manually by making use of https://github.com/Shopify/toxiproxy
		//{
		//	"can return expected error type when graphql engine connections fail",
		//	fields{
		//		projectDirectory: "testdata/projectv3",
		//		endpointString:   "http://localhost:12345/something",
		//	},
		//	`{"message": "success"}`,
		//	func(t require.TestingT, err error, i ...interface{}) {
		//		var e *url.Error
		//		require.Truef(t, errors.As(err, &e), "expected err to be an instance of %v but got %v", reflect.TypeOf(&url.Error{}), reflect.TypeOf(err))
		//	},
		//},
		// config.json
		// [
		//  {
		//    "name": "hasura",
		//    "listen": "[::]:18080",
		//    "upstream": "localhost:8080",
		//    "enabled": true
		//  }
		// ]
		//
		// 1. Simulate reset peer
		// $ toxiproxy-cli toxic add -t reset_peer hasura
		// 2. Simulate timeout
		// $ toxiproxy-cli toxic add -t timeout -a timeout=1 hasura
		//{
		//	"return expect error type when graphql engine connections reset",
		//	fields{
		//		projectDirectory: "testdata/projectv3",
		//		endpointString:   "http://localhost:18080",
		//	},
		//	`{"message": "success"}`,
		//	func(t require.TestingT, err error, i ...interface{}) {
		//		var e *url.Error
		//		require.Truef(t, errors.As(err, &e), "expected err to be an instance of %v but got %v", reflect.TypeOf(&url.Error{}), reflect.TypeOf(err))
		//	},
		//},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			p, err := NewProjectMetadata(tt.fields.projectDirectory, WithEndpoint(tt.fields.endpointString), WithAdminSecret(testutil.TestAdminSecret))
			tt.wantErr(t, err)
			if p != nil {
				got, err := p.Reload()

				tt.wantErr(t, err)
				gotb, err := ioutil.ReadAll(got)
				require.NoError(t, err)
				require.JSONEq(t, tt.want, string(gotb))
			}
		})
	}
}