Files
mostlymatter/model/cluster_info_test.go
2021-08-19 10:33:29 +02:00

22 строки
562 B
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package model
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func TestClusterInfosJson(t *testing.T) {
cluster := ClusterInfo{IPAddress: NewId(), Hostname: NewId()}
clusterInfos := make([]*ClusterInfo, 1)
clusterInfos[0] = &cluster
json := ClusterInfosToJson(clusterInfos)
result := ClusterInfosFromJson(strings.NewReader(json))
assert.Equal(t, clusterInfos[0].IPAddress, result[0].IPAddress, "Ids do not match")
}