add service discovery endpoint test (#31373)

added a quick test for the service discovery endpoint
This commit is contained in:
Gabriel Hernandez 2025-07-30 11:43:03 +01:00 committed by GitHub
parent 50d20c8ffe
commit 774dfb8b80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
}