github.com/chenbh/concourse/v6@v6.4.2/atc/integration/concurrent_request_limits_test.go (about)

     1  package integration_test
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/chenbh/concourse/v6/atc"
     7  	"github.com/chenbh/concourse/v6/atc/wrappa"
     8  	. "github.com/onsi/ginkgo"
     9  	. "github.com/onsi/gomega"
    10  )
    11  
    12  var _ = Describe("Concurrent request limits", func() {
    13  	BeforeEach(func() {
    14  		cmd.ConcurrentRequestLimits = map[wrappa.LimitedRoute]int{
    15  			wrappa.LimitedRoute(atc.ListAllJobs): 0,
    16  		}
    17  	})
    18  
    19  	It("disables ListAllJobs requests", func() {
    20  		client := login(atcURL, "test", "test")
    21  		httpClient := client.HTTPClient()
    22  		request, _ := http.NewRequest(
    23  			"GET",
    24  			client.URL()+"/api/v1/jobs",
    25  			nil,
    26  		)
    27  
    28  		response, _ := httpClient.Do(request)
    29  
    30  		Expect(response.StatusCode).To(Equal(http.StatusNotImplemented))
    31  	})
    32  })