summaryrefslogtreecommitdiff
path: root/internal/discovery/discovery_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/discovery/discovery_test.go')
-rw-r--r--internal/discovery/discovery_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/internal/discovery/discovery_test.go b/internal/discovery/discovery_test.go
index 08c5ef8..802123a 100644
--- a/internal/discovery/discovery_test.go
+++ b/internal/discovery/discovery_test.go
@@ -23,7 +23,7 @@ func TestServers(t *testing.T) {
}
d := &Discovery{httpClient: c}
// get servers
- _, fresh, err := d.Servers(context.Background())
+ _, fresh, err := d.Servers(context.Background(), false)
if !fresh {
t.Fatalf("Did not obtain the server list fresh")
}
@@ -51,7 +51,7 @@ func TestServers(t *testing.T) {
SupportContact: []string{"mailto:test@example.org"},
}
// conditional requests: this should not be fetched fresh
- _, fresh, err = d.Servers(context.Background())
+ _, fresh, err = d.Servers(context.Background(), false)
if fresh {
t.Fatalf("Obtained the server list fresh with conditional requests")
}
@@ -60,7 +60,7 @@ func TestServers(t *testing.T) {
}
// mock conditional requests
d.ServerList.UpdateHeader = time.Time{}
- s1, fresh, err := d.Servers(context.Background())
+ s1, fresh, err := d.Servers(context.Background(), false)
if !fresh {
t.Fatalf("Did not obtain the server list fresh with mocked conditional request and mocked entry")
}
@@ -74,7 +74,7 @@ func TestServers(t *testing.T) {
// Shutdown the server
s.Close()
// Test if we get the same cached copy
- s2, fresh, err := d.Servers(context.Background())
+ s2, fresh, err := d.Servers(context.Background(), false)
// We should not get an error as the timestamp is not expired
if fresh {
t.Fatalf("The server list was obtained fresh")
@@ -90,7 +90,7 @@ func TestServers(t *testing.T) {
// we should return the previous with an error
d.ServerList.Timestamp = time.Now().Add(-1 * time.Hour)
- s3, fresh, err := d.Servers(context.Background())
+ s3, fresh, err := d.Servers(context.Background(), false)
if fresh {
t.Fatalf("Server list was gotten fresh")
}
@@ -115,7 +115,7 @@ func TestOrganizations(t *testing.T) {
}
d := &Discovery{httpClient: c}
// get servers
- _, fresh, err := d.Organizations(context.Background())
+ _, fresh, err := d.Organizations(context.Background(), false)
if !fresh {
t.Fatalf("The organization list was not obtained fresh")
}
@@ -145,7 +145,7 @@ func TestOrganizations(t *testing.T) {
},
}
- _, fresh, err = d.Organizations(context.Background())
+ _, fresh, err = d.Organizations(context.Background(), false)
if fresh {
t.Fatalf("Obtained the organization list fresh with conditional requests")
}
@@ -154,7 +154,7 @@ func TestOrganizations(t *testing.T) {
}
// mock conditional requests
d.OrganizationList.UpdateHeader = time.Time{}
- s1, fresh, err := d.Organizations(context.Background())
+ s1, fresh, err := d.Organizations(context.Background(), false)
if !fresh {
t.Fatalf("Did not obtain the organization list fresh after inserting a mock entry, faking expiry and mocking conditional request")
}
@@ -169,7 +169,7 @@ func TestOrganizations(t *testing.T) {
s.Close()
// Test if we get the same cached copy
// We should not get an error as the timestamp is not zero
- s2, fresh, err := d.Organizations(context.Background())
+ s2, fresh, err := d.Organizations(context.Background(), false)
if fresh {
t.Fatalf("The organization list is freshly obtained")
}