1package command
2
3import (
4	"strings"
5	"testing"
6
7	"github.com/mitchellh/cli"
8)
9
10func TestOperator_Autopilot_GetConfig_Implements(t *testing.T) {
11	t.Parallel()
12	var _ cli.Command = &OperatorRaftListCommand{}
13}
14
15func TestOperatorAutopilotGetConfigCommand(t *testing.T) {
16	t.Parallel()
17	s, _, addr := testServer(t, false, nil)
18	defer s.Shutdown()
19
20	ui := new(cli.MockUi)
21	c := &OperatorAutopilotGetCommand{Meta: Meta{Ui: ui}}
22	args := []string{"-address=" + addr}
23
24	code := c.Run(args)
25	if code != 0 {
26		t.Fatalf("bad: %d. %#v", code, ui.ErrorWriter.String())
27	}
28	output := strings.TrimSpace(ui.OutputWriter.String())
29	if !strings.Contains(output, "CleanupDeadServers = true") {
30		t.Fatalf("bad: %s", output)
31	}
32}
33