Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UOE-10590: Read Profile MetaData from DB #820

Merged
merged 12 commits into from
Jun 18, 2024
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ format:
formatcheck:
./scripts/format.sh -f false

mockgen: mockgeninstall mockgendb mockgencache mockgenmetrics mockgenlogger mockgenpublisherfeature
mockgen: mockgeninstall mockgendb mockgencache mockgenmetrics mockgenlogger mockgenpublisherfeature mockgenprofilemetadata

# export GOPATH=~/go ; GOBIN=~/go/bin; export PATH=$PATH:$GOBIN
mockgeninstall:
Expand Down Expand Up @@ -68,3 +68,7 @@ mockgenlogger:
mockgenpublisherfeature:
mkdir -p modules/pubmatic/openwrap/publisherfeature
mockgen github.com/PubMatic-OpenWrap/prebid-server/v2/modules/pubmatic/openwrap/publisherfeature Feature > modules/pubmatic/openwrap/publisherfeature/mock/mock.go

mockgenprofilemetadata:
mkdir -p modules/pubmatic/openwrap/profilemetadata/mock
mockgen github.com/PubMatic-OpenWrap/prebid-server/v2/modules/pubmatic/openwrap/profilemetadata ProfileMetaData > modules/pubmatic/openwrap/profilemetadata/mock/mock.go
6 changes: 3 additions & 3 deletions modules/pubmatic/openwrap/beforevalidationhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ func (m OpenWrap) handleBeforeValidationHook(

//set the profile MetaData for logging and tracking
rCtx.ProfileType = getProfileType(partnerConfigMap)
rCtx.ProfileTypePlatform = getProfileTypePlatform(partnerConfigMap)
rCtx.ProfileTypePlatform = getProfileTypePlatform(partnerConfigMap, m.profileMetaData)
rCtx.AppPlatform = getAppPlatform(partnerConfigMap)
rCtx.AppIntegrationPath = ptrutil.ToPtr(getAppIntegrationPath(partnerConfigMap))
rCtx.AppSubIntegrationPath = ptrutil.ToPtr(getAppSubIntegrationPath(partnerConfigMap))
rCtx.AppIntegrationPath = ptrutil.ToPtr(getAppIntegrationPath(partnerConfigMap, m.profileMetaData))
rCtx.AppSubIntegrationPath = ptrutil.ToPtr(getAppSubIntegrationPath(partnerConfigMap, m.profileMetaData))

// To check if VAST unwrap needs to be enabled for given request
if isVastUnwrapEnabled(rCtx.PartnerConfigMap, m.cfg.Features.VASTUnwrapPercent) {
Expand Down
51 changes: 39 additions & 12 deletions modules/pubmatic/openwrap/beforevalidationhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/prebid/prebid-server/v2/modules/pubmatic/openwrap/models/adunitconfig"
modelsAdunitConfig "github.com/prebid/prebid-server/v2/modules/pubmatic/openwrap/models/adunitconfig"
"github.com/prebid/prebid-server/v2/modules/pubmatic/openwrap/models/nbr"
mock_profilemetadata "github.com/prebid/prebid-server/v2/modules/pubmatic/openwrap/profilemetadata/mock"
mock_feature "github.com/prebid/prebid-server/v2/modules/pubmatic/openwrap/publisherfeature/mock"
"github.com/prebid/prebid-server/v2/openrtb_ext"
"github.com/prebid/prebid-server/v2/util/ptrutil"
Expand Down Expand Up @@ -2124,6 +2125,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockCache := mock_cache.NewMockCache(ctrl)
mockEngine := mock_metrics.NewMockMetricsEngine(ctrl)
mockFeature := mock_feature.NewMockFeature(ctrl)
mockProfileMetaData := mock_profilemetadata.NewMockProfileMetaData(ctrl)
adapters.InitBidders("./static/bidder-params/")

type fields struct {
Expand Down Expand Up @@ -2438,6 +2440,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherRequests(rctx.Endpoint, "5890", rctx.Platform)
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: hookstage.HookResult[hookstage.BeforeValidationRequestPayload]{
Reject: true,
Expand Down Expand Up @@ -2496,6 +2499,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherRequests(rctx.Endpoint, "5890", rctx.Platform)
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: hookstage.HookResult[hookstage.BeforeValidationRequestPayload]{
Reject: true,
Expand Down Expand Up @@ -2544,6 +2548,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherRequests(rctx.Endpoint, "5890", rctx.Platform)
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: hookstage.HookResult[hookstage.BeforeValidationRequestPayload]{
Reject: true,
Expand Down Expand Up @@ -2591,6 +2596,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherRequests(rctx.Endpoint, "5890", rctx.Platform)
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: hookstage.HookResult[hookstage.BeforeValidationRequestPayload]{
Reject: true,
Expand Down Expand Up @@ -2641,6 +2647,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherRequests(models.EndpointWebS2S, "5890", rctx.Platform)
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: hookstage.HookResult[hookstage.BeforeValidationRequestPayload]{
Reject: true,
Expand Down Expand Up @@ -2687,6 +2694,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherRequests(rctx.Endpoint, "5890", rctx.Platform)
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: hookstage.HookResult[hookstage.BeforeValidationRequestPayload]{
Reject: true,
Expand Down Expand Up @@ -2777,6 +2785,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordImpDisabledViaConfigStats(models.ImpTypeBanner, "5890", "1234")
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: hookstage.HookResult[hookstage.BeforeValidationRequestPayload]{
Reject: true,
Expand Down Expand Up @@ -2881,6 +2890,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordImpDisabledViaConfigStats(models.ImpTypeBanner, "5890", "1234")
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: hookstage.HookResult[hookstage.BeforeValidationRequestPayload]{
Reject: false,
Expand Down Expand Up @@ -2959,6 +2969,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherRequests(rctx.Endpoint, "5890", rctx.Platform)
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: hookstage.HookResult[hookstage.BeforeValidationRequestPayload]{
Reject: true,
Expand Down Expand Up @@ -3070,6 +3081,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPlatformPublisherPartnerReqStats(rctx.Platform, "5890", "dm-alias")
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: hookstage.HookResult[hookstage.BeforeValidationRequestPayload]{
Reject: false,
Expand Down Expand Up @@ -3162,6 +3174,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPlatformPublisherPartnerReqStats(rctx.Platform, "5890", "appnexus")
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: hookstage.HookResult[hookstage.BeforeValidationRequestPayload]{
Reject: false,
Expand Down Expand Up @@ -3323,6 +3336,7 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
mockFeature.EXPECT().IsAmpMultiformatEnabled(5890).Return(true)
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: hookstage.HookResult[hookstage.BeforeValidationRequestPayload]{
Reject: false,
Expand All @@ -3342,10 +3356,11 @@ func TestOpenWrapHandleBeforeValidationHook(t *testing.T) {
tt.setup()
}
m := OpenWrap{
cfg: tt.fields.cfg,
cache: tt.fields.cache,
metricEngine: tt.fields.metricEngine,
pubFeatures: mockFeature,
cfg: tt.fields.cfg,
cache: tt.fields.cache,
metricEngine: tt.fields.metricEngine,
pubFeatures: mockFeature,
profileMetaData: mockProfileMetaData,
}

bidrequest := &openrtb2.BidRequest{}
Expand Down Expand Up @@ -3501,6 +3516,7 @@ func TestVASTUnwrap_handleBeforeValidationHook(t *testing.T) {
mockCache := mock_cache.NewMockCache(ctrl)
mockEngine := mock_metrics.NewMockMetricsEngine(ctrl)
mockFeature := mock_feature.NewMockFeature(ctrl)
mockProfileMetaData := mock_profilemetadata.NewMockProfileMetaData(ctrl)

type fields struct {
cfg config.Config
Expand Down Expand Up @@ -3582,6 +3598,7 @@ func TestVASTUnwrap_handleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherProfileRequests("5890", "1234")
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: want{
rctx: &models.RequestCtx{
Expand Down Expand Up @@ -3643,6 +3660,7 @@ func TestVASTUnwrap_handleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherProfileRequests("5890", "1234")
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: want{
rctx: &models.RequestCtx{
Expand Down Expand Up @@ -3709,6 +3727,7 @@ func TestVASTUnwrap_handleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherProfileRequests("5890", "1234")
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: want{
rctx: &models.RequestCtx{
Expand Down Expand Up @@ -3776,6 +3795,7 @@ func TestVASTUnwrap_handleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherProfileRequests("5890", "1234")
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: want{
rctx: &models.RequestCtx{
Expand Down Expand Up @@ -3838,6 +3858,7 @@ func TestVASTUnwrap_handleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherProfileRequests("5890", "1234")
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: want{
rctx: &models.RequestCtx{
Expand All @@ -3858,10 +3879,11 @@ func TestVASTUnwrap_handleBeforeValidationHook(t *testing.T) {

adapters.InitBidders("./static/bidder-params/")
m := OpenWrap{
cfg: tt.fields.cfg,
cache: tt.fields.cache,
metricEngine: tt.fields.metricEngine,
pubFeatures: mockFeature,
cfg: tt.fields.cfg,
cache: tt.fields.cache,
metricEngine: tt.fields.metricEngine,
pubFeatures: mockFeature,
profileMetaData: mockProfileMetaData,
}
tt.args.payload.BidRequest = &openrtb2.BidRequest{}
json.Unmarshal(tt.args.bidrequest, tt.args.payload.BidRequest)
Expand All @@ -3881,6 +3903,7 @@ func TestImpBidCtx_handleBeforeValidationHook(t *testing.T) {
mockCache := mock_cache.NewMockCache(ctrl)
mockEngine := mock_metrics.NewMockMetricsEngine(ctrl)
mockFeature := mock_feature.NewMockFeature(ctrl)
mockProfileMetaData := mock_profilemetadata.NewMockProfileMetaData(ctrl)
type fields struct {
cfg config.Config
cache cache.Cache
Expand Down Expand Up @@ -3940,6 +3963,7 @@ func TestImpBidCtx_handleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherInvalidProfileImpressions("5890", rctx.ProfileIDStr, gomock.Any())
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: want{
rctx: &models.RequestCtx{
Expand Down Expand Up @@ -3993,6 +4017,7 @@ func TestImpBidCtx_handleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherInvalidProfileImpressions("5890", rctx.ProfileIDStr, gomock.Any())
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: want{
rctx: &models.RequestCtx{
Expand Down Expand Up @@ -4047,6 +4072,7 @@ func TestImpBidCtx_handleBeforeValidationHook(t *testing.T) {
mockEngine.EXPECT().RecordPublisherRequests(rctx.Endpoint, "5890", rctx.Platform)
mockFeature.EXPECT().IsTBFFeatureEnabled(gomock.Any(), gomock.Any()).Return(false)
mockFeature.EXPECT().IsAnalyticsTrackingThrottled(gomock.Any(), gomock.Any()).Return(false, false)
mockProfileMetaData.EXPECT().GetProfileTypePlatform(gomock.Any()).Return(0, false)
},
want: want{
error: false,
Expand Down Expand Up @@ -4163,10 +4189,11 @@ func TestImpBidCtx_handleBeforeValidationHook(t *testing.T) {
}
adapters.InitBidders("./static/bidder-params/")
m := OpenWrap{
cfg: tt.fields.cfg,
cache: tt.fields.cache,
metricEngine: tt.fields.metricEngine,
pubFeatures: mockFeature,
cfg: tt.fields.cfg,
cache: tt.fields.cache,
metricEngine: tt.fields.metricEngine,
pubFeatures: mockFeature,
profileMetaData: mockProfileMetaData,
}
tt.args.payload.BidRequest = &openrtb2.BidRequest{}
json.Unmarshal(tt.args.bidrequest, tt.args.payload.BidRequest)
Expand Down
3 changes: 3 additions & 0 deletions modules/pubmatic/openwrap/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ type Cache interface {

GetFSCThresholdPerDSP() (map[int]int, error)
GetPublisherFeatureMap() (map[int]map[int]models.FeatureData, error)
GetProfileTypePlatform() (map[string]int, error)
AvinashKapre marked this conversation as resolved.
Show resolved Hide resolved
GetAppIntegrationPath() (map[string]int, error)
GetAppSubIntegrationPath() (map[string]int, error)

Set(key string, value interface{})
Get(key string) (interface{}, bool)
Expand Down
19 changes: 19 additions & 0 deletions modules/pubmatic/openwrap/cache/gocache/app_integration_path.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package gocache

import (
"fmt"

"github.com/prebid/prebid-server/v2/modules/pubmatic/openwrap/models"
)

var errorAppIntegrationPathUpdate = "[ErrorAppIntegrationPathUpdate]:%w"

// We are not saving data in cache here
func (c *cache) GetAppIntegrationPath() (map[string]int, error) {
AppIntegrationPathMap, err := c.db.GetAppIntegrationPath()
if err != nil {
c.metricEngine.RecordDBQueryFailure(models.AppIntegrationPathQuery, "", "")
return AppIntegrationPathMap, fmt.Errorf(errorAppIntegrationPathUpdate, err)
}
return AppIntegrationPathMap, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package gocache

import (
"errors"
"sync"
"testing"

"github.com/golang/mock/gomock"
gocache "github.com/patrickmn/go-cache"
"github.com/prebid/prebid-server/v2/modules/pubmatic/openwrap/config"
"github.com/prebid/prebid-server/v2/modules/pubmatic/openwrap/database"
mock_database "github.com/prebid/prebid-server/v2/modules/pubmatic/openwrap/database/mock"
mock_metrics "github.com/prebid/prebid-server/v2/modules/pubmatic/openwrap/metrics/mock"
"github.com/prebid/prebid-server/v2/modules/pubmatic/openwrap/models"
"github.com/stretchr/testify/assert"
)

func Test_cache_GetAppIntegrationPath(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

mockDatabase := mock_database.NewMockDatabase(ctrl)
mockEngine := mock_metrics.NewMockMetricsEngine(ctrl)
type fields struct {
Map sync.Map
cache *gocache.Cache
cfg config.Cache
db database.Database
}
tests := []struct {
name string
fields fields
want map[string]int
wantErr bool
setup func()
}{
{
name: "Valid Data present in DB, return same",
want: map[string]int{
"app_int_1": 1,
"app_int_2": 2,
},
setup: func() {
mockDatabase.EXPECT().GetAppIntegrationPath().Return(map[string]int{
"app_int_1": 1,
"app_int_2": 2,
}, nil)
},
fields: fields{
cache: gocache.New(100, 100),
db: mockDatabase,
cfg: config.Cache{
CacheDefaultExpiry: 1000,
},
},
wantErr: false,
},
{
name: "Error In DB, Set Empty",
want: map[string]int{},
setup: func() {
mockDatabase.EXPECT().GetAppIntegrationPath().Return(map[string]int{}, errors.New("QUERY FAILD"))
mockEngine.EXPECT().RecordDBQueryFailure(models.AppIntegrationPathQuery, "", "").Return()
},
fields: fields{
cache: gocache.New(100, 100),
db: mockDatabase,
cfg: config.Cache{
CacheDefaultExpiry: 1000,
},
},
wantErr: true,
},
}
for ind := range tests {
tt := &tests[ind]
t.Run(tt.name, func(t *testing.T) {
tt.setup()
c := &cache{
cache: tt.fields.cache,
cfg: tt.fields.cfg,
db: tt.fields.db,
metricEngine: mockEngine,
}
got, err := c.GetAppIntegrationPath()
if (err != nil) != tt.wantErr {
t.Errorf("cache.GetAppIntegrationPath() error = %v, wantErr %v", err, tt.wantErr)
return
}
assert.Equal(t, tt.want, got)

})
}
}
Loading
Loading