github.com/prebid/prebid-server/v2@v2.18.0/hooks/empty_plan_test.go (about)

     1  package hooks
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestEmptyPlanBuilder(t *testing.T) {
    10  	planBuilder := EmptyPlanBuilder{}
    11  	endpoint := "/openrtb2/auction"
    12  	message := "Empty plan builder should always return empty hook execution plan for %s stage."
    13  
    14  	assert.Len(t, planBuilder.PlanForEntrypointStage(endpoint), 0, message, StageEntrypoint)
    15  	assert.Len(t, planBuilder.PlanForRawAuctionStage(endpoint, nil), 0, message, StageRawAuctionRequest)
    16  	assert.Len(t, planBuilder.PlanForProcessedAuctionStage(endpoint, nil), 0, message, StageProcessedAuctionRequest)
    17  	assert.Len(t, planBuilder.PlanForBidderRequestStage(endpoint, nil), 0, message, StageBidderRequest)
    18  	assert.Len(t, planBuilder.PlanForRawBidderResponseStage(endpoint, nil), 0, message, StageRawBidderResponse)
    19  	assert.Len(t, planBuilder.PlanForAllProcessedBidResponsesStage(endpoint, nil), 0, message, StageAllProcessedBidResponses)
    20  	assert.Len(t, planBuilder.PlanForAuctionResponseStage(endpoint, nil), 0, message, StageAuctionResponse)
    21  }