messageBus.Subscriptions["dea.heartbeat"][0].Callback(&yagnats.Message{ Payload: app.Heartbeat(1).ToJSON(), }) store.RevokeActualFreshness() timeProvider.IncrementBySeconds(conf.ActualFreshnessTTL()) messageBus.Subscriptions["dea.advertise"][0].Callback(&yagnats.Message{ Payload: []byte("doesn't matter"), }) }) It("Bumps the actual state freshness", func() { timeProvider.IncrementBySeconds(conf.ActualFreshnessTTL()) isFresh, _ := store.IsActualStateFresh(timeProvider.Time()) Ω(isFresh).Should(BeTrue()) }) }) Context("and a heartbeat was received recently", func() { BeforeEach(func() { messageBus.Subscriptions["dea.heartbeat"][0].Callback(&yagnats.Message{ Payload: app.Heartbeat(1).ToJSON(), }) store.RevokeActualFreshness() timeProvider.IncrementBySeconds(conf.ActualFreshnessTTL() - 1) messageBus.Subscriptions["dea.advertise"][0].Callback(&yagnats.Message{