...

Source file src/edge-infra.dev/pkg/edge/datasync/shoot/config/configProvider_test.go

Documentation: edge-infra.dev/pkg/edge/datasync/shoot/config

     1  package config_test
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  
     7  	"github.com/stretchr/testify/require"
     8  
     9  	"edge-infra.dev/pkg/edge/datasync/shoot/config"
    10  )
    11  
    12  func TestGetTargetTopic(t *testing.T) {
    13  	os.Setenv("TOPICS_MAPPING", `[{"source": "public", "target": "public_target"}, {"source": "tlogs", "target": "tlogs_target"}]`)
    14  
    15  	res := config.GetTargetTopic("public")
    16  	require.Equal(t, "public_target", res)
    17  
    18  	res = config.GetTargetTopic("tlogs")
    19  	require.Equal(t, "tlogs_target", res)
    20  }
    21  

View as plain text