diff --git a/internal/http/check_test.go b/internal/http/check_test.go index 8df913c..86074a0 100644 --- a/internal/http/check_test.go +++ b/internal/http/check_test.go @@ -69,7 +69,6 @@ type httpTest struct { type httpIntParams struct { checkRunner CheckerHandleRun - checkCleaner func(resourceToClean interface{}, ctx context.Context, target, assetType, optJSON string) resourceToClean interface{} checkName string config *config.Config @@ -160,10 +159,6 @@ func TestIntegrationHttpMode(t *testing.T) { }, }, resourceToClean: map[string]string{"key": "initial"}, - checkCleaner: func(resource interface{}, ctx context.Context, target, assetType, opt string) { - r := resource.(map[string]string) - r["key"] = "cleaned" - }, }, wantResourceState: map[string]string{"key": "cleaned"}, want: map[string]agent.State{ @@ -230,14 +225,8 @@ func TestIntegrationHttpMode(t *testing.T) { tt := tt t.Run(tt.name, func(t2 *testing.T) { conf := tt.args.config - var cleaner func(ctx context.Context, target, assetType, opts string) - if tt.args.checkCleaner != nil { - cleaner = func(ctx context.Context, target, assetType, opts string) { - tt.args.checkCleaner(tt.args.resourceToClean, ctx, target, assetType, opts) - } - } l := logging.BuildRootLog("httpCheck") - c := NewCheckFromHandlerWithConfig(tt.args.checkName, tt.args.checkRunner, cleaner, conf, l) + c := NewCheckFromHandlerWithConfig(tt.args.checkName, tt.args.checkRunner, nil, conf, l) go c.RunAndServe() client := &http.Client{} url := fmt.Sprintf("http://localhost:%d/run", *tt.args.config.Port) @@ -330,12 +319,6 @@ func TestIntegrationHttpMode(t *testing.T) { t.Errorf("Unable to unmarshal response: %v", err) return } - - // Compare resource to clean up state with wanted state. - diff := cmp.Diff(tt.wantResourceState, tt.args.resourceToClean) - if diff != "" { - t.Errorf("Error want resource to clean state != got. Diff %s", diff) - } n.resp = r }(key, i, job) }