Beispiel #1
0
			})
		})
	})

	Describe("VerifySynced", func() {
		BeforeEach(func() {
			consulRPCClient.StatsReturns(map[string]map[string]string{
				"raft": map[string]string{
					"commit_index":   "2",
					"last_log_index": "2",
				},
			}, nil)
		})

		It("verifies the sync state of the raft log", func() {
			Expect(client.VerifySynced()).To(Succeed())
			Expect(consulRPCClient.StatsCallCount()).To(Equal(1))
			Expect(logger.Messages).To(ContainSequence([]fakes.LoggerMessage{
				{
					Action: "agent-client.verify-synced.stats.request",
				},
				{
					Action: "agent-client.verify-synced.stats.response",
					Data: []lager.Data{{
						"commit_index":   "2",
						"last_log_index": "2",
					}},
				},
				{
					Action: "agent-client.verify-synced.synced",
				},