Ω(request.Header.Get("Authorization")).Should(Equal(expectedAuth)) }) It("should request a batch size with an empty bulk token", func() { query := httpClient.LastRequest().URL.Query() Ω(query.Get("batch_size")).Should(Equal(fmt.Sprintf("%d", conf.DesiredStateBatchSize))) Ω(query.Get("bulk_token")).Should(Equal("{}")) }) assertFailure := func(expectedMessage string, numRequests int) { It("should stop requesting batches", func() { Ω(httpClient.Requests).Should(HaveLen(numRequests)) }) It("should not bump the freshness", func() { fresh, _ := store.IsDesiredStateFresh() Ω(fresh).Should(BeFalse()) }) It("should send an error down the result channel", func(done Done) { result := <-resultChan Ω(result.Success).Should(BeFalse()) Ω(result.Message).Should(Equal(expectedMessage)) Ω(result.Error).Should(HaveOccurred()) close(done) }, 1.0) } Context("when a response with desired state is received", func() { var ( a1 appfixture.AppFixture