Migrate assert (#12643)

This commit is contained in:
WonChul Heo
2019-10-11 21:25:31 +07:00
committed by Jesús Espino
parent 867027117e
commit 68fc1b6e5e

View File

@@ -6,6 +6,8 @@ package model
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func TestClusterInfoJson(t *testing.T) {
@@ -13,9 +15,7 @@ func TestClusterInfoJson(t *testing.T) {
json := cluster.ToJson()
result := ClusterInfoFromJson(strings.NewReader(json))
if cluster.IpAddress != result.IpAddress {
t.Fatal("Ids do not match")
}
assert.Equal(t, cluster.IpAddress, result.IpAddress, "Ids do not match")
}
func TestClusterInfosJson(t *testing.T) {
@@ -25,7 +25,5 @@ func TestClusterInfosJson(t *testing.T) {
json := ClusterInfosToJson(clusterInfos)
result := ClusterInfosFromJson(strings.NewReader(json))
if clusterInfos[0].IpAddress != result[0].IpAddress {
t.Fatal("Ids do not match")
}
assert.Equal(t, clusterInfos[0].IpAddress, result[0].IpAddress, "Ids do not match")
}