github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/orderer/consensus/cluster_status_test.go (about) 1 /* 2 Copyright hechain. 2017 All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package consensus_test 8 9 import ( 10 "testing" 11 12 "github.com/hechain20/hechain/orderer/common/types" 13 "github.com/hechain20/hechain/orderer/consensus" 14 "github.com/stretchr/testify/require" 15 ) 16 17 func TestStaticStatusReporter(t *testing.T) { 18 staticSR := &consensus.StaticStatusReporter{ 19 ConsensusRelation: types.ConsensusRelationOther, 20 Status: types.StatusActive, 21 } 22 23 var sr consensus.StatusReporter = staticSR // make sure it implements this interface 24 cRel, status := sr.StatusReport() 25 require.Equal(t, types.ConsensusRelationOther, cRel) 26 require.Equal(t, types.StatusActive, status) 27 }