diff --git a/metadata/report/consul/report_test.go b/metadata/report/consul/report_test.go
index 34ee29de945f2b9ac6978a55008048e62f4c6812..e07a7429f12bac0cfa4b2701d3e87ef25bcb077a 100644
--- a/metadata/report/consul/report_test.go
+++ b/metadata/report/consul/report_test.go
@@ -143,7 +143,7 @@ func (suite *consulMetadataReportTestSuite) testGetServiceDefinition() {
 
 func test1(t *testing.T) {
 	consulAgent := consul.NewConsulAgent(t, 8500)
-	defer consulAgent.Close()
+	defer consulAgent.Shutdown()
 
 	url := newProviderRegistryUrl("localhost", 8500)
 	mf := extension.GetMetadataReportFactory("consul")
diff --git a/registry/consul/utils_test.go b/registry/consul/utils_test.go
index 327dd95f7181907f6635c7fe89ef726bdcef5204..939352dc088faa2c32be8173d0aa6f4516dfe503 100644
--- a/registry/consul/utils_test.go
+++ b/registry/consul/utils_test.go
@@ -148,7 +148,7 @@ func (suite *consulRegistryTestSuite) close() {
 // register -> subscribe -> unregister
 func test1(t *testing.T) {
 	consulAgent := consul.NewConsulAgent(t, registryPort)
-	defer consulAgent.Close()
+	defer consulAgent.Shutdown()
 
 	server := newServer(providerHost, providerPort)
 	defer server.close()
@@ -165,10 +165,10 @@ func test1(t *testing.T) {
 	suite.testListener(remoting.EventTypeDel)
 }
 
-// subscribe -> register
+// subscribe -> register -> unregister
 func test2(t *testing.T) {
 	consulAgent := consul.NewConsulAgent(t, registryPort)
-	defer consulAgent.Close()
+	defer consulAgent.Shutdown()
 
 	server := newServer(providerHost, providerPort)
 	defer server.close()
@@ -181,6 +181,8 @@ func test2(t *testing.T) {
 	suite.testNewProviderRegistry()
 	suite.testRegister()
 	suite.testListener(remoting.EventTypeAdd)
+	suite.testUnregister()
+	suite.testListener(remoting.EventTypeDel)
 }
 
 func TestConsulRegistry(t *testing.T) {
diff --git a/remoting/consul/test_agent.go b/remoting/consul/test_agent.go
index 1744da7bd9992ae3cd376b22e9ea3a135dce2b16..f6ba336a95667fdf1d9b305e1844408c2501190a 100644
--- a/remoting/consul/test_agent.go
+++ b/remoting/consul/test_agent.go
@@ -18,8 +18,6 @@
 package consul
 
 import (
-	"io/ioutil"
-	"os"
 	"strconv"
 	"testing"
 )
@@ -30,35 +28,11 @@ import (
 
 // Consul agent, used for test, simulates
 // an embedded consul server.
-type ConsulAgent struct {
-	dataDir   string
-	testAgent *agent.TestAgent
-}
-
-func NewConsulAgent(t *testing.T, port int) *ConsulAgent {
-	dataDir, _ := ioutil.TempDir("./", "agent")
+func NewConsulAgent(t *testing.T, port int) *agent.TestAgent {
 	hcl := `
 		ports { 
 			http = ` + strconv.Itoa(port) + `
 		}
-		data_dir = "` + dataDir + `"
 	`
-	testAgent := &agent.TestAgent{Name: t.Name(), DataDir: dataDir, HCL: hcl}
-	testAgent.Start(t)
-
-	consulAgent := &ConsulAgent{
-		dataDir:   dataDir,
-		testAgent: testAgent,
-	}
-	return consulAgent
-}
-
-func (consulAgent *ConsulAgent) Close() error {
-	var err error
-
-	err = consulAgent.testAgent.Shutdown()
-	if err != nil {
-		return err
-	}
-	return os.RemoveAll(consulAgent.dataDir)
+	return agent.NewTestAgent(t, hcl)
 }
diff --git a/remoting/consul/test_agent_test.go b/remoting/consul/test_agent_test.go
index 8cf0ac6cd80e517ab7bc1b52cc7774a708082d5e..066e5e3c2dfca1e73451c54dc5519cccdaff6fb2 100644
--- a/remoting/consul/test_agent_test.go
+++ b/remoting/consul/test_agent_test.go
@@ -27,6 +27,6 @@ import (
 
 func TestNewConsulAgent(t *testing.T) {
 	consulAgent := NewConsulAgent(t, 8500)
-	err := consulAgent.Close()
+	err := consulAgent.Shutdown()
 	assert.NoError(t, err)
 }