X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fmodels%2Fric_service_query_message_test.go;h=281f679860673f103f75ae4808ae7da680de3786;hb=0f06f71ca88aeedf1239fdc0f3f4cb7fa0ab9823;hp=3ed2fbc18a2913292575a1776467ff5cd9544d81;hpb=0234dab067e255d03eddc5c49c18cef4834546f7;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/models/ric_service_query_message_test.go b/E2Manager/models/ric_service_query_message_test.go index 3ed2fbc..281f679 100644 --- a/E2Manager/models/ric_service_query_message_test.go +++ b/E2Manager/models/ric_service_query_message_test.go @@ -23,9 +23,10 @@ import ( "e2mgr/models" "e2mgr/utils" "encoding/xml" + "testing" + "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities" "github.com/stretchr/testify/assert" - "testing" ) func getTestRicServiceQueryRanFunctions(t *testing.T) []*entities.RanFunction { @@ -47,7 +48,15 @@ func TestRicServiceQueryMessageSuccess(t *testing.T) { serviceQuery := models.NewRicServiceQueryMessage(ranFunctionList) initMsg := serviceQuery.E2APPDU.InitiatingMessage - assert.Equal(t, "6", initMsg.ProcedureCode) - assert.Equal(t, "9", initMsg.Value.RICServiceQuery.ProtocolIEs.RICServiceQueryIEs[0].Id) - assert.Equal(t, 3, len(initMsg.Value.RICServiceQuery.ProtocolIEs.RICServiceQueryIEs[0].Value.RANFunctionIdList.ProtocolIESingleContainer)) + assert.Equal(t, models.ProcedureCode_id_RICserviceQuery, initMsg.ProcedureCode) + assert.Equal(t, models.ProtocolIE_ID_id_TransactionID, initMsg.Value.RICServiceQuery.ProtocolIEs.RICServiceQueryIEs[0].Id) + assert.Equal(t, models.ProtocolIE_ID_id_RANfunctionsAccepted, initMsg.Value.RICServiceQuery.ProtocolIEs.RICServiceQueryIEs[1].Id) + assert.Equal(t, 3, len(initMsg.Value.RICServiceQuery.ProtocolIEs.RICServiceQueryIEs[1].Value.(models.RICServiceQueryRANFunctionIdList).RANFunctionIdList.ProtocolIESingleContainer)) +} + +func TestTransactionIdServiceQuery(t *testing.T) { + ranFunctionList := getTestRicServiceQueryRanFunctions(t) + serviceQuery := models.NewRicServiceQueryMessage(ranFunctionList) + txIE := serviceQuery.E2APPDU.InitiatingMessage.Value.RICServiceQuery.ProtocolIEs.RICServiceQueryIEs[0].Value.(models.RICServiceQueryTransactionID) + assert.NotEmpty(t, txIE.TransactionID, "transaction ID should not be empty") }