2017-04-12 08:27:57 -04:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
2016-11-28 07:40:02 -08:00
|
|
|
// See License.txt for license information.
|
|
|
|
|
|
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"strings"
|
|
|
|
|
"testing"
|
2019-10-13 22:37:41 +03:00
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
2016-11-28 07:40:02 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestClusterStatsJson(t *testing.T) {
|
|
|
|
|
cluster := ClusterStats{Id: NewId(), TotalWebsocketConnections: 1, TotalReadDbConnections: 1}
|
|
|
|
|
json := cluster.ToJson()
|
|
|
|
|
result := ClusterStatsFromJson(strings.NewReader(json))
|
|
|
|
|
|
2019-10-13 22:37:41 +03:00
|
|
|
require.Equal(t, cluster.Id, result.Id, "Ids do not match")
|
2016-11-28 07:40:02 -08:00
|
|
|
}
|