// runner returns a testing func that can be passed to t.Run.
runner returns a testing func that can be passed to t.Run.
// runner returns a testing func that can be passed to t . Run .
func (tc *testCase) runner(_ *testing.T, url string, ceClient *adaptertest.TestCloudEventsClient, nc chan resources.Status) func(t *testing.T) {
	return func(t *testing.T) {
		if tc.eventType == "" {
			t.Fatal("eventType is required for table tests")
		}
		body, _ := json.Marshal(tc.buildPayload)
		req, err := http.NewRequest(tc.httpMethod, url, bytes.NewReader(body))
		if err != nil {
			t.Fatal(err)
		}
		resp, err := http.DefaultClient.Do(req)
		if err != nil {
			t.Error(err)
		}
		defer resp.Body.Close()
		if tc.cloudEventSendExpected {
			if tc.wantCallbackExpected {
				tc.waitCallbackReport(t, nc)
			}
			tc.validateCESentPayload(t, ceClient)
		}
	}
}
func ( tc * testCase ) runner ( _ * testing . T , url string , ceClient * adaptertest . TestCloudEventsClient , nc chan resources . Status ) func ( t * testing . T ) { return func ( t * testing . T ) { if tc . eventType == " " { t . Fatal ( " " ) } body , _ := json . Marshal ( tc . buildPayload ) req , err := http . NewRequest ( tc . httpMethod , url , bytes . NewReader ( body ) ) if err != nil { t . Fatal ( err ) } resp , err := http . DefaultClient . Do ( req ) if err != nil { t . Error ( err ) } defer resp . Body . Close ( ) if tc . cloudEventSendExpected { if tc . wantCallbackExpected { tc . waitCallbackReport ( t , nc ) } tc . validateCESentPayload ( t , ceClient ) } } }
runner returns a testing func that can be passed to t.Run.
runner returns a testing func that can be passed to t . Run .