mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
add service discovery endpoint test (#31373)
added a quick test for the service discovery endpoint
This commit is contained in:
parent
50d20c8ffe
commit
774dfb8b80
1 changed files with 17 additions and 0 deletions
|
|
@ -17316,3 +17316,20 @@ func createTestServerWithStatusCode(statusCode int) (*httptest.Server, func()) {
|
|||
|
||||
return server, cleanup
|
||||
}
|
||||
|
||||
func (s *integrationMDMTestSuite) TestServiceDiscovery() {
|
||||
t := s.T()
|
||||
|
||||
type serviceDiscoveryServer struct {
|
||||
Version string `json:"Version"`
|
||||
BaseURL string `json:"BaseURL"`
|
||||
}
|
||||
type serviceDiscoveryResponse struct {
|
||||
Servers []serviceDiscoveryServer `json:"Servers"`
|
||||
}
|
||||
|
||||
res := serviceDiscoveryResponse{}
|
||||
s.DoJSON("GET", "/mdm/apple/service_discovery", nil, http.StatusOK, &res)
|
||||
require.Contains(t, res.Servers[0].BaseURL, apple_mdm.AccountDrivenEnrollPath)
|
||||
require.Equal(t, "mdm-byod", res.Servers[0].Version)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue