Ω(metricsAccountant.ReceivedHeartbeats).Should(Equal(1))
			})

			It("bumps the freshness", func() {
				isFresh, _ := store.IsActualStateFresh(freshByTime)
				Ω(isFresh).Should(BeTrue())
			})
		})

		Context("when the save succeeds, but takes too long", func() {
			BeforeEach(func() {
				messageBus.Subscriptions["dea.heartbeat"][0].Callback(&yagnats.Message{
					Payload: heartbeat.ToJSON(),
				})

				conf.ListenerHeartbeatSyncIntervalInMilliseconds = 0
				forceHeartbeatSync()
			})

			It("should not bump the freshness", func() {
				isFresh, _ := store.IsActualStateFresh(freshByTime)
				Ω(isFresh).Should(BeFalse())
			})
		})

		Context("when the save fails", func() {
			BeforeEach(func() {
				store.BumpActualFreshness(timeProvider.Time())

				storeAdapter.SetErrInjector = fakestoreadapter.NewFakeStoreAdapterErrorInjector(app.InstanceAtIndex(0).InstanceGuid, errors.New("oops"))