

package validation_test

import (
	"testing"

	"github.com/kubernetes-sigs/service-catalog/pkg/webhook/servicecatalog/servicebinding/validation"
	"github.com/kubernetes-sigs/service-catalog/pkg/webhookutil/tester"
)

func TestSpecValidationHandlerDecoderErrors(t *testing.T) {
	tester.DiscardLoggedMsg()

	for _, fn := range []func(t *testing.T, handler tester.TestDecoderHandler, kind string){
		tester.AssertHandlerReturnErrorIfReqObjIsMalformed,
		tester.AssertHandlerReturnErrorIfGVKMismatch,
	} {
		handler := validation.SpecValidationHandler{}
		fn(t, &handler, "ServiceBinding")
	}
}
