diff --git a/protos/ledger/rwset/kvrwset/tests/kv_rwset_test.go b/protos/ledger/rwset/kvrwset/tests/kv_rwset_test.go index 7da05ec3645..de7ea9015c1 100644 --- a/protos/ledger/rwset/kvrwset/tests/kv_rwset_test.go +++ b/protos/ledger/rwset/kvrwset/tests/kv_rwset_test.go @@ -22,8 +22,8 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/protos/ledger/rwset/kvrwset" + "github.com/stretchr/testify/assert" ) const ( @@ -35,12 +35,12 @@ const ( // v1.0. This is to make sure that any incompatible changes does not go uncaught. func TestKVRWSetV1BackwardCompatible(t *testing.T) { protoBytes, err := ioutil.ReadFile(binaryTestFileName) - testutil.AssertNoError(t, err, "") + assert.NoError(t, err) kvrwset1 := &kvrwset.KVRWSet{} - testutil.AssertNoError(t, proto.Unmarshal(protoBytes, kvrwset1), "") + assert.NoError(t, proto.Unmarshal(protoBytes, kvrwset1)) kvrwset2 := constructSampleKVRWSet() t.Logf("kvrwset1=%s, kvrwset2=%s", spew.Sdump(kvrwset1), spew.Sdump(kvrwset2)) - testutil.AssertEquals(t, kvrwset1, kvrwset2) + assert.Equal(t, kvrwset2, kvrwset1) } // testPrepareBinaryFileSampleKVRWSetV1 constructs a proto message for kvrwset and marshals its bytes to file 'kvrwsetV1ProtoBytes'. @@ -49,8 +49,8 @@ func TestKVRWSetV1BackwardCompatible(t *testing.T) { // using golang test framwork func testPrepareBinaryFileSampleKVRWSetV1(t *testing.T) { b, err := proto.Marshal(constructSampleKVRWSet()) - testutil.AssertNoError(t, err, "") - testutil.AssertNoError(t, ioutil.WriteFile(binaryTestFileName, b, 0775), "") + assert.NoError(t, err) + assert.NoError(t, ioutil.WriteFile(binaryTestFileName, b, 0775)) } func constructSampleKVRWSet() *kvrwset.KVRWSet { diff --git a/protos/ledger/rwset/tests/rwset_test.go b/protos/ledger/rwset/tests/rwset_test.go index 63610c1806f..575e7790f40 100644 --- a/protos/ledger/rwset/tests/rwset_test.go +++ b/protos/ledger/rwset/tests/rwset_test.go @@ -22,8 +22,8 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/protos/ledger/rwset" + "github.com/stretchr/testify/assert" ) const ( @@ -35,12 +35,12 @@ const ( // v1.0. This is to make sure that any incompatible changes does not go uncaught. func TestRWSetV1BackwardCompatible(t *testing.T) { protoBytes, err := ioutil.ReadFile(binaryTestFileName) - testutil.AssertNoError(t, err, "") + assert.NoError(t, err) rwset1 := &rwset.TxReadWriteSet{} - testutil.AssertNoError(t, proto.Unmarshal(protoBytes, rwset1), "") + assert.NoError(t, proto.Unmarshal(protoBytes, rwset1)) rwset2 := constructSampleRWSet() t.Logf("rwset1=%s, rwset2=%s", spew.Sdump(rwset1), spew.Sdump(rwset2)) - testutil.AssertEquals(t, rwset1, rwset2) + assert.Equal(t, rwset2, rwset1) } // testPrepareBinaryFileSampleRWSetV1 constructs a proto message for kvrwset and marshals its bytes to file 'rwsetV1ProtoBytes'. @@ -49,8 +49,8 @@ func TestRWSetV1BackwardCompatible(t *testing.T) { // using golang test framwork func testPrepareBinaryFileSampleRWSetV1(t *testing.T) { b, err := proto.Marshal(constructSampleRWSet()) - testutil.AssertNoError(t, err, "") - testutil.AssertNoError(t, ioutil.WriteFile(binaryTestFileName, b, 0775), "") + assert.NoError(t, err) + assert.NoError(t, ioutil.WriteFile(binaryTestFileName, b, 0775)) } func constructSampleRWSet() *rwset.TxReadWriteSet {