github.com/prebid/prebid-server/v2@v2.18.0/privacy/writer_test.go (about)

     1  package privacy
     2  
     3  import (
     4  	"encoding/json"
     5  	"testing"
     6  
     7  	"github.com/prebid/openrtb/v20/openrtb2"
     8  	"github.com/stretchr/testify/assert"
     9  )
    10  
    11  func TestNilWriter(t *testing.T) {
    12  	request := &openrtb2.BidRequest{
    13  		ID:  "anyID",
    14  		Ext: json.RawMessage(`{"anyJson":"anyValue"}`),
    15  	}
    16  	expectedRequest := &openrtb2.BidRequest{
    17  		ID:  "anyID",
    18  		Ext: json.RawMessage(`{"anyJson":"anyValue"}`),
    19  	}
    20  
    21  	nilWriter := &NilPolicyWriter{}
    22  	nilWriter.Write(request)
    23  
    24  	assert.Equal(t, expectedRequest, request)
    25  }