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.go46
1 files changed, 23 insertions, 23 deletions
diff --git a/internal/discovery/discovery_test.go b/internal/discovery/discovery_test.go
index 2ea18e1..c2bbf44 100644
--- a/internal/discovery/discovery_test.go
+++ b/internal/discovery/discovery_test.go
@@ -90,12 +90,12 @@ func TestSecureLocationList(t *testing.T) {
Version: 1,
List: []Server{
// institute access server, this should not be found
- {CountryCode: "", Type: "institute_access"},
+ {Server: discotypes.Server{Type: "institute_access"}, CountryCode: ""},
// secure internet servers, these should be found
- {CountryCode: "b", Type: "secure_internet"},
- {CountryCode: "c", Type: "secure_internet"},
+ {Server: discotypes.Server{Type: "secure_internet"}, CountryCode: "b"},
+ {Server: discotypes.Server{Type: "secure_internet"}, CountryCode: "c"},
// Unexpected type, this should not be found
- {CountryCode: "d", Type: "test"},
+ {Server: discotypes.Server{Type: "test"}, CountryCode: "d"},
},
},
}
@@ -115,11 +115,11 @@ func TestServerByURL(t *testing.T) {
Version: 1,
List: []Server{
// institute access server
- Server{BaseURL: "a", Type: "institute_access"},
+ {Server: discotypes.Server{BaseURL: "a", Type: "institute_access"}},
// secure internet servers
- Server{BaseURL: "b", Type: "secure_internet"},
+ {Server: discotypes.Server{BaseURL: "b", Type: "secure_internet"}},
// Unexpected type, this should not be found
- Server{BaseURL: "d", Type: "test"},
+ {Server: discotypes.Server{BaseURL: "d", Type: "test"}},
},
},
}
@@ -150,16 +150,16 @@ func TestServerByURL(t *testing.T) {
// TestServerByCountryCode tests the function for getting a server by the country code
func TestServerByCountryCode(t *testing.T) {
- s1 := discotypes.Server{CountryCode: "a", Type: "secure_internet"}
+ s1 := Server{Server: discotypes.Server{Type: "secure_internet"}, CountryCode: "a"}
d := Discovery{
- ServerList: discotypes.Servers{
+ ServerList: Servers{
Version: 1,
- List: []discotypes.Server{
+ List: []Server{
// secure internet server
s1,
// Unexpected types, these should not be found
- {CountryCode: "b", Type: "institute_access"},
- {CountryCode: "c", Type: "test"},
+ {Server: discotypes.Server{Type: "institute_access"}, CountryCode: "b"},
+ {Server: discotypes.Server{Type: "test"}, CountryCode: "c"},
},
},
}
@@ -187,10 +187,10 @@ func TestServerByCountryCode(t *testing.T) {
func TestOrgByID(t *testing.T) {
o1 := discotypes.Organization{OrgID: "a"}
d := Discovery{
- OrganizationList: discotypes.Organizations{
+ OrganizationList: Organizations{
Version: 1,
- List: []discotypes.Organization{
- o1,
+ List: []Organization{
+ {Organization: o1},
},
},
}
@@ -209,21 +209,21 @@ func TestOrgByID(t *testing.T) {
// TestSecureHomeArgs tests the function for getting an organization and matching secure internet server by organization ID
func TestSecureHomeArgs(t *testing.T) {
- o1 := discotypes.Organization{OrgID: "id", SecureInternetHome: "a"}
+ o1 := Organization{Organization: discotypes.Organization{OrgID: "id"}, SecureInternetHome: "a"}
s1 := discotypes.Server{BaseURL: "a", Type: "secure_internet"}
d := Discovery{
- OrganizationList: discotypes.Organizations{
+ OrganizationList: Organizations{
Version: 1,
- List: []discotypes.Organization{
- {OrgID: "id2", SecureInternetHome: "c"},
+ List: []Organization{
+ {Organization: discotypes.Organization{OrgID: "id2"}, SecureInternetHome: "c"},
o1,
},
},
- ServerList: discotypes.Servers{
+ ServerList: Servers{
Version: 1,
- List: []discotypes.Server{
- s1,
- {BaseURL: "b"},
+ List: []Server{
+ {Server: s1},
+ {Server: discotypes.Server{BaseURL: "b"}},
},
},
}