X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=common%2Futils_test.go;fp=common%2Futils_test.go;h=2364467280eb02b242c844610378ff37fc1e1284;hb=3519d193f64372d84b638179e2d050ba3f9dc3ca;hp=640362c23c892468516e5e481e1f63b06e254cac;hpb=3910f469611577225239aceaf65abfa0962c586b;p=ric-plt%2Fnodeb-rnib.git diff --git a/common/utils_test.go b/common/utils_test.go index 640362c..2364467 100644 --- a/common/utils_test.go +++ b/common/utils_test.go @@ -124,4 +124,25 @@ func TestValidateAndBuildCellNamePciKeySuccess(t *testing.T){ assert.Contains(t, key, delimiter) assert.Contains(t, key, prefix) assert.Contains(t, key, "270f") +} + + +func TestValidateAndBuildRanLoadInformationKeySuccess(t *testing.T) { + name := "name" + prefix := "LOAD" + delimiter := ":" + key, err := ValidateAndBuildRanLoadInformationKey(name) + if err != nil{ + t.Errorf("#utils_test.TestValidateAndBuildNodeBNameKey - failed to validate key parameter") + } + assert.Contains(t, key, name) + assert.Contains(t, key, delimiter) + assert.Contains(t, key, prefix) +} + +func TestValidateAndBuildRanLoadInformationKeyFailure(t *testing.T) { + name := "" + _, err := ValidateAndBuildRanLoadInformationKey(name) + assert.NotNil(t, err) + assert.Equal(t, VALIDATION_ERROR, err.GetCode()) } \ No newline at end of file