From 05243b35cd08610b957a4ca1eb4ef862bb140145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Tis=C3=A4ter?= Date: Wed, 7 May 2014 23:51:15 +0200 Subject: [PATCH] Move argument structs back in original position --- command/agent/catalog_endpoint_test.go | 18 +++++++----------- consul/catalog_endpoint_test.go | 9 ++++----- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/command/agent/catalog_endpoint_test.go b/command/agent/catalog_endpoint_test.go index 9ae11c4dbf..c9e094dcb8 100644 --- a/command/agent/catalog_endpoint_test.go +++ b/command/agent/catalog_endpoint_test.go @@ -20,16 +20,14 @@ func TestCatalogRegister(t *testing.T) { testutil.WaitForLeader(t, srv.agent.RPC) // Register node - args := &structs.RegisterRequest{ - Datacenter: "dc1", - Node: "foo", - Address: "127.0.0.1", - } - req, err := http.NewRequest("GET", "/v1/catalog/register", nil) if err != nil { t.Fatalf("err: %v", err) } + args := &structs.RegisterRequest{ + Node: "foo", + Address: "127.0.0.1", + } req.Body = encodeReq(args) obj, err := srv.CatalogRegister(nil, req) @@ -52,15 +50,13 @@ func TestCatalogDeregister(t *testing.T) { testutil.WaitForLeader(t, srv.agent.RPC) // Register node - args := &structs.DeregisterRequest{ - Datacenter: "dc1", - Node: "foo", - } - req, err := http.NewRequest("GET", "/v1/catalog/deregister", nil) if err != nil { t.Fatalf("err: %v", err) } + args := &structs.DeregisterRequest{ + Node: "foo", + } req.Body = encodeReq(args) obj, err := srv.CatalogDeregister(nil, req) diff --git a/consul/catalog_endpoint_test.go b/consul/catalog_endpoint_test.go index 4c5a2c70b4..149651de6b 100644 --- a/consul/catalog_endpoint_test.go +++ b/consul/catalog_endpoint_test.go @@ -257,11 +257,6 @@ func TestCatalogListNodes_StaleRaad(t *testing.T) { testutil.WaitForLeader(t, client1.Call) testutil.WaitForLeader(t, client2.Call) - args := structs.DCSpecificRequest{ - Datacenter: "dc1", - QueryOptions: structs.QueryOptions{AllowStale: true}, - } - // Use the follower as the client var client *rpc.Client if !s1.IsLeader() { @@ -276,6 +271,10 @@ func TestCatalogListNodes_StaleRaad(t *testing.T) { s2.fsm.State().EnsureNode(1, structs.Node{"foo", "127.0.0.1"}) } + args := structs.DCSpecificRequest{ + Datacenter: "dc1", + QueryOptions: structs.QueryOptions{AllowStale: true}, + } var out structs.IndexedNodes if err := client.Call("Catalog.ListNodes", &args, &out); err != nil { t.Fatalf("err: %v", err)