From df35a4658e3b0dbb71773c83a2dc8f675fca1b19 Mon Sep 17 00:00:00 2001 From: Emanuele Gallone Date: Thu, 10 Mar 2022 11:43:59 +0100 Subject: [PATCH] Refactor --- pkg/pfcpsim/session/qer_builder.go | 18 +++++++++--------- pkg/pfcpsim/session/qer_builder_test.go | 15 ++++++++++++++- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/pkg/pfcpsim/session/qer_builder.go b/pkg/pfcpsim/session/qer_builder.go index 0dfa242..42a88b9 100644 --- a/pkg/pfcpsim/session/qer_builder.go +++ b/pkg/pfcpsim/session/qer_builder.go @@ -6,16 +6,16 @@ package session import "github.com/wmnsk/go-pfcp/ie" type qerBuilder struct { - method IEMethod - qerID uint32 - qfi uint8 - isMbrSet bool - ulMbr uint64 - dlMbr uint64 - isGbrSet bool - ulGbr uint64 + method IEMethod + qerID uint32 + qfi uint8 + isMbrSet bool + ulMbr uint64 + dlMbr uint64 + isGbrSet bool + ulGbr uint64 dlGbr uint64 - gateStatus GateStatus + gateStatus uint8 isIDSet bool } diff --git a/pkg/pfcpsim/session/qer_builder_test.go b/pkg/pfcpsim/session/qer_builder_test.go index fa4f521..be7de69 100644 --- a/pkg/pfcpsim/session/qer_builder_test.go +++ b/pkg/pfcpsim/session/qer_builder_test.go @@ -54,7 +54,20 @@ func TestQERBuilder(t *testing.T) { ie.NewQFI(2), ie.NewGateStatus(0, 0), ), - description: "Valid Create QER", + description: "Valid Create QER with gate open", + }, + { + input: NewQERBuilder(). + WithID(1). + WithMethod(Create). + WithQFI(2). + WithGateStatus(ie.GateStatusClosed), + expected: ie.NewCreateQER( + ie.NewQERID(1), + ie.NewQFI(2), + ie.NewGateStatus(1, 1), + ), + description: "Valid Create QER with Gate closed", }, { input: NewQERBuilder().