}) Context("when the freshness bump fails", func() { BeforeEach(func() { store.BumpActualFreshnessError = errors.New("oops") }) It("logs about the failed freshness bump", func() { Ω(logger.LoggedSubjects).Should(ContainElement("Could not update actual freshness")) }) }) }) Context("when the save fails", func() { BeforeEach(func() { store.SaveActualStateError = errors.New("oops") }) It("does not bump the freshness", func() { Ω(store.ActualIsFresh).Should(BeFalse()) }) It("logs about the failed save", func() { Ω(logger.LoggedSubjects).Should(ContainElement(ContainSubstring("Could not put instance heartbeats in store"))) }) }) }) Context("When it fails to parse the heartbeat message", func() { BeforeEach(func() { messageBus.Subscriptions["dea.heartbeat"][0].Callback([]byte("ß"))