Removed TestExternalResolution as it wasn't needed, fixed TestReset so it expects the correct return value
@@ -120,31 +120,6 @@ func TestMonitorAlert(t *testing.T) {
creator.AssertCalled(t, "Warn", entity)
}
-func TestExternalResolution(t *testing.T) {
- assert := assert.New(t)
- store := &mockstore.MockStore{}
-
- entity := types.FixtureEntity("entity")
- entity.KeepaliveTimeout = 0
- entity.Deregister = false
-
- event := types.FixtureEvent("entity", "keepalive")
- event.Entity.KeepaliveTimeout = 0
-
- creator := &mockCreator{}
- creator.On("Warn", entity).Return(nil)
-
- store.On("UpdateFailingKeepalive", mock.Anything, entity, mock.AnythingOfType("int64")).Return(nil)
- monitor := &KeepaliveMonitor{
- Entity: event.Entity,
- Store: store,
- EventCreator: creator,
- }
- monitor.Start()
- time.Sleep(100 * time.Millisecond)
- assert.False(monitor.IsStopped())
-}
-
func TestReset(t *testing.T) {
assert := assert.New(t)
store := &mockstore.MockStore{}
@@ -166,5 +141,5 @@ func TestReset(t *testing.T) {
}
monitor.Reset(time.Now().Unix())
time.Sleep(100 * time.Millisecond)
- assert.True(monitor.IsStopped())
+ assert.False(monitor.IsStopped())
}
