Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions nfregistration/nf_registration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func TestNfRegistrationService_WhenConfigChanged_ThenRegisterNFSuccessAndStartTi
registered := append([]models.PlmnId(nil), registrations...)
registrationMu.Unlock()
if !reflect.DeepEqual(registered, newConfig) {
t.Errorf("Expected %+v config, received %+v", newConfig, registered)
t.Errorf("expected %+v config, received %+v", newConfig, registered)
}
}

Expand Down Expand Up @@ -274,10 +274,10 @@ func TestNfRegistrationService_ConfigChanged_RetryIfRegisterNFFails(t *testing.T

waitForCondition(t, retryTime+3*time.Second, func() bool {
return called.Load() >= 2
}, "Expected to retry register to NRF")
}, "expected to retry register to NRF")

if called.Load() < 2 {
t.Error("Expected to retry register to NRF")
t.Error("expected to retry register to NRF")
}
t.Logf("Tried %v times", called.Load())
}
Expand Down Expand Up @@ -339,10 +339,10 @@ func TestNfRegistrationService_WhenConfigChanged_ThenPreviousRegistrationIsCance
}

if !reflect.DeepEqual(firstRegistration.config, firstConfig) {
t.Errorf("Expected %+v config, received %+v", firstConfig, firstRegistration.config)
t.Errorf("expected %+v config, received %+v", firstConfig, firstRegistration.config)
}
if !reflect.DeepEqual(secondRegistration.config, secondConfig) {
t.Errorf("Expected %+v config, received %+v", secondConfig, secondRegistration.config)
t.Errorf("expected %+v config, received %+v", secondConfig, secondRegistration.config)
}
}

Expand Down Expand Up @@ -480,7 +480,7 @@ func TestStartKeepAliveTimer_UsesProfileTimerOnlyWhenGreaterThanZero(t *testing.

startKeepAliveTimer(tc.profileTime, nil)
if tc.expectedDuration != capturedDuration {
t.Errorf("Expected %v duration, got %v", tc.expectedDuration, capturedDuration)
t.Errorf("expected %v duration, got %v", tc.expectedDuration, capturedDuration)
}
})
}
Expand Down
10 changes: 5 additions & 5 deletions polling/nf_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestStartPollingService_Success(t *testing.T) {
select {
case result := <-pollingChan:
if !reflect.DeepEqual(result, expectedConfig) {
t.Errorf("Expected %+v, got %+v", expectedConfig, result)
t.Errorf("expected %+v, got %+v", expectedConfig, result)
}
case <-time.After(100 * time.Millisecond):
t.Errorf("Timeout waiting for PLMN config")
Expand Down Expand Up @@ -132,15 +132,15 @@ func TestHandlePolledPlmnConfig_ConfigChanged_ConfigurationIsUpdatedAndSendToCha
poller.handlePolledPlmnConfig(tc.newPlmnConfig)

if !reflect.DeepEqual(poller.currentPlmnConfig, tc.newPlmnConfig) {
t.Errorf("Expected PLMN config to be updated to %v, got %v", tc.newPlmnConfig, poller.currentPlmnConfig)
t.Errorf("expected PLMN config to be updated to %v, got %v", tc.newPlmnConfig, poller.currentPlmnConfig)
}
select {
case receivedPlmnConfig := <-ch:
if !reflect.DeepEqual(receivedPlmnConfig, tc.newPlmnConfig) {
t.Errorf("Expected config %v, got %v", tc.newPlmnConfig, receivedPlmnConfig)
t.Errorf("expected config %v, got %v", tc.newPlmnConfig, receivedPlmnConfig)
}
case <-time.After(100 * time.Millisecond):
t.Errorf("Expected config to be sent to channel, but it was not")
t.Errorf("expected config to be sent to channel, but it was not")
}
})
}
Expand Down Expand Up @@ -170,7 +170,7 @@ func TestHandlePolledPlmnConfig_ConfigDidNotChanged_ConfigIsNotSendToChannel(t *
poller.handlePolledPlmnConfig(tc.newPlmnConfig)

if !reflect.DeepEqual(poller.currentPlmnConfig, tc.newPlmnConfig) {
t.Errorf("Expected PLMN list to remain unchanged, got %v", poller.currentPlmnConfig)
t.Errorf("expected PLMN list to remain unchanged, got %v", poller.currentPlmnConfig)
}

select {
Expand Down
Loading