Use new consul test server functions
This commit is contained in:
parent
377aee0562
commit
535e0dff59
|
@ -14,12 +14,15 @@ import (
|
||||||
func TestConsulLocker(t *testing.T) {
|
func TestConsulLocker(t *testing.T) {
|
||||||
a := assert.New(t)
|
a := assert.New(t)
|
||||||
|
|
||||||
server := consultestutil.NewTestServer(t)
|
server, err := consultestutil.NewTestServer()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
defer server.Stop()
|
defer server.Stop()
|
||||||
|
|
||||||
client, err := consul.NewClient(&consul.Config{
|
conf := consul.DefaultConfig()
|
||||||
Address: server.HTTPAddr,
|
conf.Address = server.HTTPAddr
|
||||||
})
|
client, err := consul.NewClient(conf)
|
||||||
a.NoError(err)
|
a.NoError(err)
|
||||||
|
|
||||||
locker := New(client)
|
locker := New(client)
|
||||||
|
@ -38,7 +41,10 @@ func TestLockLost(t *testing.T) {
|
||||||
|
|
||||||
a := assert.New(t)
|
a := assert.New(t)
|
||||||
|
|
||||||
server := consultestutil.NewTestServer(t)
|
server, err := consultestutil.NewTestServer()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
client, err := consul.NewClient(&consul.Config{
|
client, err := consul.NewClient(&consul.Config{
|
||||||
Address: server.HTTPAddr,
|
Address: server.HTTPAddr,
|
||||||
|
|
Loading…
Reference in New Issue