X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dmaap-mediator-producer%2Finternal%2Fconfig%2Fconfig_test.go;h=90d3c0368283f2e7d1479687db6b5e40363a7ae7;hb=3deeefa87a81f8724520ce0e3a55d88a5d328204;hp=fc64e575a3032016208ab6345503cc31f0b523d1;hpb=f1cee0f81c6bc482f73182c8f4c903e8376381e8;p=nonrtric.git diff --git a/dmaap-mediator-producer/internal/config/config_test.go b/dmaap-mediator-producer/internal/config/config_test.go index fc64e575..90d3c036 100644 --- a/dmaap-mediator-producer/internal/config/config_test.go +++ b/dmaap-mediator-producer/internal/config/config_test.go @@ -36,8 +36,9 @@ func TestNew_envVarsSetConfigContainSetValues(t *testing.T) { os.Setenv("INFO_PRODUCER_HOST", "producerHost") os.Setenv("INFO_PRODUCER_PORT", "8095") os.Setenv("INFO_COORD_ADDR", "infoCoordAddr") - os.Setenv("MR_HOST", "mrHost") - os.Setenv("MR_PORT", "3908") + os.Setenv("DMAAP_MR_ADDR", "mrHost:3908") + os.Setenv("PRODUCER_CERT_PATH", "cert") + os.Setenv("PRODUCER_KEY_PATH", "key") t.Cleanup(func() { os.Clearenv() }) @@ -46,8 +47,9 @@ func TestNew_envVarsSetConfigContainSetValues(t *testing.T) { InfoProducerHost: "producerHost", InfoProducerPort: 8095, InfoCoordinatorAddress: "infoCoordAddr", - MRHost: "mrHost", - MRPort: 3908, + DMaaPMRAddress: "mrHost:3908", + ProducerCertPath: "cert", + ProducerKeyPath: "key", } got := New() @@ -68,9 +70,10 @@ func TestNew_faultyIntValueSetConfigContainDefaultValueAndWarnInLog(t *testing.T LogLevel: log.InfoLevel, InfoProducerHost: "", InfoProducerPort: 8085, - InfoCoordinatorAddress: "http://enrichmentservice:8083", - MRHost: "http://message-router.onap", - MRPort: 3904, + InfoCoordinatorAddress: "https://enrichmentservice:8434", + DMaaPMRAddress: "https://message-router.onap:3905", + ProducerCertPath: "security/producer.crt", + ProducerKeyPath: "security/producer.key", } if got := New(); !reflect.DeepEqual(got, &wantConfig) { t.Errorf("New() = %v, want %v", got, &wantConfig) @@ -94,9 +97,10 @@ func TestNew_envFaultyLogLevelConfigContainDefaultValues(t *testing.T) { LogLevel: log.InfoLevel, InfoProducerHost: "", InfoProducerPort: 8085, - InfoCoordinatorAddress: "http://enrichmentservice:8083", - MRHost: "http://message-router.onap", - MRPort: 3904, + InfoCoordinatorAddress: "https://enrichmentservice:8434", + DMaaPMRAddress: "https://message-router.onap:3905", + ProducerCertPath: "security/producer.crt", + ProducerKeyPath: "security/producer.key", } got := New()