From 99659e9014c1493ff27c873845325c5f578c3691 Mon Sep 17 00:00:00 2001 From: foostan Date: Tue, 27 Jan 2015 18:10:56 +0900 Subject: [PATCH] Add tests to remove service/check without an ID --- command/agent/agent_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/command/agent/agent_test.go b/command/agent/agent_test.go index 0a702263f..da098d6eb 100644 --- a/command/agent/agent_test.go +++ b/command/agent/agent_test.go @@ -247,6 +247,11 @@ func TestAgent_RemoveService(t *testing.T) { t.Fatalf("should have errored") } + // Remove without an ID + if err := agent.RemoveService("", false); err == nil { + t.Fatalf("should have errored") + } + // Removing a service with a single check works { srv := &structs.NodeService{ @@ -406,6 +411,11 @@ func TestAgent_RemoveCheck(t *testing.T) { t.Fatalf("err: %v", err) } + // Remove without an ID + if err := agent.RemoveCheck("", false); err == nil { + t.Fatalf("should have errored") + } + health := &structs.HealthCheck{ Node: "foo", CheckID: "mem",