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: req_resp_decoder_test.go
    path of file: ./repos/kin-openapi/openapi3filter
    
    the code of the file until where you have to start completion: package openapi3filter

import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"io"
	"mime/multipart"
	"net/http"
	"net/textproto"
	"net/url"
	"reflect"
	"strings"
	"testing"

	"github.com/stretchr/testify/require"

	"github.com/getkin/kin-openapi/openapi3"
	legacyrouter "github.com/getkin/kin-openapi/routers/legacy"
)

func TestDecodeParameter(t *testing.T) {
	var (
		explode   = openapi3.BoolPtr(true)
		noExplode = openapi3.BoolPtr(false)
		arrayOf   = func(items *openapi3.SchemaRef) *openapi3.SchemaRef {
			return &openapi3.SchemaRef{Value: &openapi3.Schema{Type: &openapi3.Types{"array"}, Items: items}}
		}
		objectOf = func(args ...interface{}) *openapi3.SchemaRef {
			s := &openapi3.SchemaRef{Value: &openapi3.Schema{Type: &openapi3.Types{"object"}, Properties: make(map[string]*openapi3.SchemaRef)}}
			if len(args)%2 != 0 {
				panic("invalid arguments. must be an even number of arguments")
			}
			for i := 0; i < len(args)/2; i++ {
				propName := args[i*2].(string)
				propSchema := args[i*2+1].(*openapi3.SchemaRef)
				s.Value.Properties[propName] = propSchema
			}
			return s
		}

		integerSchema                          = &openapi3.SchemaRef{Valu
    
func TestRegisterAndUnregisterBodyDecoder(t *testing.T) {
	var decoder BodyDecoder
	decoder = func(body io.Reader, h http.Header, schema *openapi3.SchemaRef, encFn EncodingFn) (decoded interface{}, err error) {
		var data []byte
		if data, err = io.ReadAll(body); err != nil {
			return
		}
		return strings.Split(string(data), ","), nil
	}
	contentType := "application/csv"
	h := make(http.Header)
	h.Set(headerCT, contentType)

	originalDecoder := RegisteredBodyDecoder(contentType)
	require.Nil(t, originalDecoder)

	RegisterBodyDecoder(contentType, decoder)
	require.Equal(t, fmt.Sprintf("%v", decoder), fmt.Sprintf("%v", RegisteredBodyDecoder(contentType)))

	body := strings.NewReader("foo,bar")
	schema := openapi3.NewArraySchema().WithItems(openapi3.NewStringSchema()).NewRef()
	encFn := func(string) *openapi3.Encoding { return nil }
	_, got, err := decodeBody(body, h, schema, encFn)

	require.NoError(t, err)
	require.Equal(t, []string{"foo", "bar"}, got)

	UnregisterBodyDecoder(contentType)

	originalDecoder = RegisteredBodyDecoder(contentType)
	require.Nil(t, originalDecoder)

	_, _, err = decodeBody(body, h, schema, encFn)
	require.Equal(t, &ParseError{
		Kind:   KindUnsupportedFormat,
		Reason: prefixUnsupportedCT + ` "application/csv"`,
	}, err)
}