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: http_source_test.go
    path of file: ./repos/storj/storagenode/trust
    
    the code of the file until where you have to start completion: // Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.

package trust_test

import (
	"context"
	"fmt"
	"net/http"
	"net/http/httptest"
	"testing"

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

	"storj.io/storj/storagenode/trust"
)

func TestHTTPSourceNew(t *testing.T) {
	for _, tt := range []struct {
		name    string
		httpURL string
		errs    []string
	}{
		{
			name:    "not a valid URL",
			httpURL: "://",
			errs: []string{
				`HTTP source: "://": not a URL: parse ://: missing protocol scheme`,
				`HTTP source: "://": not a URL: parse "://": missing proto
    
func TestHTTPSourceFetchEntries(t *testing.T) {
	url1 := makeSatelliteURL("127.0.0.1")
	url2 := makeSatelliteURL("domain.test")

	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		switch {
		case r.Method != "GET":
			http.Error(w, fmt.Sprintf("%s method not allowed", r.Method), http.StatusMethodNotAllowed)
		case r.URL.Path == "/good":
			fmt.Fprintf(w, `
				# Some comment
				%s
				%s
			`, url1.String(), url2.String())
		case r.URL.Path == "/bad":
			fmt.Fprintln(w, "BAD")
		case r.URL.Path == "/ugly":
			http.Error(w, "OHNO", http.StatusInternalServerError)
		}
	}))
	defer server.Close()

	goodURL := server.URL + "/good"
	badURL := server.URL + "/bad"
	uglyURL := server.URL + "/ugly"

	for _, tt := range []struct {
		name    string
		httpURL string
		err     string
		entries []trust.Entry
	}{
		{
			name:    "well-formed list was fetched",
			httpURL: goodURL,
			entries: []trust.Entry{
				{
					SatelliteURL:  url1,
					Authoritative: true,
				},
				{
					SatelliteURL:  url2,
					Authoritative: false,
				},
			},
		},
		{
			name:    "malformed list was fetched",
			httpURL: badURL,
			err:     fmt.Sprintf("HTTP source: cannot parse list at %q: invalid satellite URL: must contain an ID", badURL),
		},
		{
			name:    "endpoint returned unsuccessful status code",
			httpURL: uglyURL,
			err:     fmt.Sprintf(`HTTP source: %q: unexpected status code 500: "OHNO"`, uglyURL),
		},
	} {
		tt := tt // quiet linting
		t.Run(tt.name, func(t *testing.T) {
			source, err := trust.NewHTTPSource(tt.httpURL)
			require.NoError(t, err)
			entries, err := source.FetchEntries(context.Background())
			if tt.err != "" {
				require.EqualError(t, err, tt.err)
				return
			}
			require.NoError(t, err)
			assert.Equal(t, tt.entries, entries)
		})
	}
}