Ω(func() { listener.Start() }).ShouldNot(Panic()) Ω(metricsAccountant.TrackedActualStateListenerStoreUsageFraction).Should(Equal(-1.0)) }) }) Context("When it receives a dea advertisement over the message bus", func() { Context("and no heartbeat has been received recently", func() { BeforeEach(func() { 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()) }) })