Skip to content

Commit

Permalink
Fixed unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
charliecon committed Jul 26, 2024
1 parent 3db95a8 commit 2d4fb78
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package routing_queue_conditional_group_routing
import (
"context"
"net/http"
"os"
"terraform-provider-genesyscloud/genesyscloud/provider"
featureToggles "terraform-provider-genesyscloud/genesyscloud/util/feature_toggles"
"testing"

"github.com/google/go-cmp/cmp"
Expand All @@ -18,6 +20,17 @@ func TestUnitResourceRoutingQueueConditionalGroupRoutingUpdate(t *testing.T) {
tRules := generateRuleData()
tId := tQueueId + "/rules"

if !featureToggles.CSGToggleExists() {
if err := os.Setenv(featureToggles.CSGToggleName(), "true"); err != nil {
t.Errorf("failed to set env var: %v", err)
}
defer func(key string) {
if err := os.Unsetenv(key); err != nil {
t.Logf("failed to unset env var: %v", err)
}
}(featureToggles.CSGToggleName())
}

groupRoutingProxy := &routingQueueConditionalGroupRoutingProxy{}
groupRoutingProxy.updateRoutingQueueConditionRoutingAttr = func(ctx context.Context, p *routingQueueConditionalGroupRoutingProxy, queueId string, rules *[]platformclientv2.Conditionalgrouproutingrule) (*[]platformclientv2.Conditionalgrouproutingrule, *platformclientv2.APIResponse, error) {
equal := cmp.Equal(tRules, *rules)
Expand Down

0 comments on commit 2d4fb78

Please sign in to comment.