Skip to content

Commit 7970115

Browse files
authored
Merge pull request #6 from Intelligent-Systems-Lab/feat/embedded-ees
Feat/embedded ees
2 parents 9109171 + dc9c21b commit 7970115

5 files changed

Lines changed: 51 additions & 368 deletions

File tree

.github/workflows/golangci-lint.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
uses: golangci/golangci-lint-action@v9
2525
with:
2626
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
27-
2827
version: v2.11.4
2928

3029
# Optional: working directory, useful for monorepos

bin/golangci-lint

24.4 MB
Binary file not shown.

internal/ees/aggregator.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ func (aggregator *Aggregator) TickOnce(ctx context.Context) (int, error) {
170170
// we MUST send a zero-value report to fulfill the "immediate" requirement
171171
// and then delete the subscription.
172172
if subscription.Mode == ModeOnDemand && (!hasReports || len(sessionMap) == 0) {
173-
aggregator.logger.Infof("ees ONE_TIME subscription %s has no buffered data, sending zero-value report", subscription.ID)
173+
aggregator.logger.Infof("ees ONE_TIME subscription %s has no buffered data, "+
174+
"sending zero-value report", subscription.ID)
174175

175176
// Try to find active sessions for this UE to provide at least some identity info
176177
zeroReports := aggregator.generateZeroReports(subscription)

internal/ees/api_test.go

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ func TestHandleCreateSubscription(t *testing.T) {
4242

4343
body, err := json.Marshal(reqBody)
4444
require.NoError(t, err)
45-
req := httptest.NewRequestWithContext(context.Background(), http.MethodPost, "/nupf-ee/v1/ee-subscriptions", bytes.NewReader(body))
45+
req := httptest.NewRequestWithContext(
46+
context.Background(),
47+
http.MethodPost,
48+
"/nupf-ee/v1/ee-subscriptions",
49+
bytes.NewReader(body),
50+
)
4651
rr := httptest.NewRecorder()
4752

4853
server.handleCreateSubscription(rr, req)
@@ -71,7 +76,12 @@ func TestHandleCreateSubscription(t *testing.T) {
7176

7277
body, err := json.Marshal(reqBody)
7378
require.NoError(t, err)
74-
req := httptest.NewRequestWithContext(context.Background(), http.MethodPost, "/nupf-ee/v1/ee-subscriptions", bytes.NewReader(body))
79+
req := httptest.NewRequestWithContext(
80+
context.Background(),
81+
http.MethodPost,
82+
"/nupf-ee/v1/ee-subscriptions",
83+
bytes.NewReader(body),
84+
)
7585
rr := httptest.NewRecorder()
7686

7787
server.handleCreateSubscription(rr, req)
@@ -89,7 +99,12 @@ func TestHandleCreateSubscription(t *testing.T) {
8999

90100
body, err := json.Marshal(reqBody)
91101
require.NoError(t, err)
92-
req := httptest.NewRequestWithContext(context.Background(), http.MethodPost, "/nupf-ee/v1/ee-subscriptions", bytes.NewReader(body))
102+
req := httptest.NewRequestWithContext(
103+
context.Background(),
104+
http.MethodPost,
105+
"/nupf-ee/v1/ee-subscriptions",
106+
bytes.NewReader(body),
107+
)
93108
rr := httptest.NewRecorder()
94109

95110
server.handleCreateSubscription(rr, req)
@@ -112,7 +127,12 @@ func TestHandleCreateSubscription(t *testing.T) {
112127

113128
body, err := json.Marshal(reqBody)
114129
require.NoError(t, err)
115-
req := httptest.NewRequestWithContext(context.Background(), http.MethodPost, "/nupf-ee/v1/ee-subscriptions", bytes.NewReader(body))
130+
req := httptest.NewRequestWithContext(
131+
context.Background(),
132+
http.MethodPost,
133+
"/nupf-ee/v1/ee-subscriptions",
134+
bytes.NewReader(body),
135+
)
116136
rr := httptest.NewRecorder()
117137

118138
server.handleCreateSubscription(rr, req)
@@ -134,7 +154,12 @@ func TestHandleCreateSubscription(t *testing.T) {
134154
id, err := store.CreateSubscription(sub)
135155
require.NoError(t, err)
136156

137-
req := httptest.NewRequestWithContext(context.Background(), http.MethodDelete, "/nupf-ee/v1/ee-subscriptions/"+id, nil)
157+
req := httptest.NewRequestWithContext(
158+
context.Background(),
159+
http.MethodDelete,
160+
"/nupf-ee/v1/ee-subscriptions/"+id,
161+
nil,
162+
)
138163
rr := httptest.NewRecorder()
139164

140165
server.handleDeleteSubscriptionByID(rr, req)
@@ -144,4 +169,3 @@ func TestHandleCreateSubscription(t *testing.T) {
144169
assert.False(t, ok)
145170
})
146171
}
147-

0 commit comments

Comments
 (0)