From: naman.gupta Date: Mon, 15 May 2023 07:58:17 +0000 (+0530) Subject: Adding testcases for Configuration. X-Git-Tag: 3.1.1~4 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=6522e76e305da05eff37bd8085db4d138b9501e8;p=ric-plt%2Fa1.git Adding testcases for Configuration. Adding testcase for Configuration. Signed-off-by: naman.gupta Change-Id: I18901dd232f35fdf81441dc415b5b714ced9bc89 --- diff --git a/config/configuration_test.go b/config/configuration_test.go new file mode 100644 index 0000000..3c83597 --- /dev/null +++ b/config/configuration_test.go @@ -0,0 +1,40 @@ +/* +================================================================================== + Copyright (c) 2023 Samsung + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + This source code is part of the near-RT RIC (RAN Intelligent Controller) + platform project (RICP). +================================================================================== +*/ +package config + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestParseConfigurationSuccess(t *testing.T) { + config := ParseConfiguration() + assert.Equal(t, "debug", config.Logging.LogLevel) + assert.Equal(t, "", config.Name) + assert.Equal(t, 65536, config.Rmr.MaxMsgSize) + + assert.Equal(t, 0, config.ThreadType) + assert.Equal(t, false, config.LowLatency) + assert.Equal(t, false, config.FastAck) + assert.Equal(t, 1, config.MaxRetryOnFailure) + assert.Equal(t, 4561, config.Port) +}