@@ -23,7 +23,7 @@ import (
2323 "github.com/csi-addons/volume-replication-operator/pkg/client/fake"
2424
2525 replicationlib "github.com/csi-addons/spec/lib/go/replication"
26- "github.com/stretchr/testify/assert "
26+ "github.com/stretchr/testify/require "
2727)
2828
2929func TestEnableVolumeReplication (t * testing.T ) {
@@ -35,8 +35,8 @@ func TestEnableVolumeReplication(t *testing.T) {
3535 }
3636 client := mockedEnableReplication
3737 resp , err := client .EnableVolumeReplication ("" , "" , nil , nil )
38- assert .Equal (t , & replicationlib.EnableVolumeReplicationResponse {}, resp )
39- assert .Nil (t , err )
38+ require .Equal (t , & replicationlib.EnableVolumeReplicationResponse {}, resp )
39+ require .Nil (t , err )
4040
4141 // return error
4242 mockedEnableReplication = & fake.ReplicationClient {
@@ -46,8 +46,8 @@ func TestEnableVolumeReplication(t *testing.T) {
4646 }
4747 client = mockedEnableReplication
4848 resp , err = client .EnableVolumeReplication ("" , "" , nil , nil )
49- assert .Nil (t , resp )
50- assert .NotNil (t , err )
49+ require .Nil (t , resp )
50+ require .NotNil (t , err )
5151}
5252
5353func TestDisableVolumeReplication (t * testing.T ) {
@@ -59,8 +59,8 @@ func TestDisableVolumeReplication(t *testing.T) {
5959 }
6060 client := mockedDisableReplication
6161 resp , err := client .DisableVolumeReplication ("" , "" , nil , nil )
62- assert .Equal (t , & replicationlib.DisableVolumeReplicationResponse {}, resp )
63- assert .Nil (t , err )
62+ require .Equal (t , & replicationlib.DisableVolumeReplicationResponse {}, resp )
63+ require .Nil (t , err )
6464
6565 // return error
6666 mockedDisableReplication = & fake.ReplicationClient {
@@ -70,8 +70,8 @@ func TestDisableVolumeReplication(t *testing.T) {
7070 }
7171 client = mockedDisableReplication
7272 resp , err = client .DisableVolumeReplication ("" , "" , nil , nil )
73- assert .Nil (t , resp )
74- assert .NotNil (t , err )
73+ require .Nil (t , resp )
74+ require .NotNil (t , err )
7575}
7676
7777func TestPromoteVolume (t * testing.T ) {
@@ -85,8 +85,8 @@ func TestPromoteVolume(t *testing.T) {
8585 force := false
8686 client := mockedPromoteVolume
8787 resp , err := client .PromoteVolume ("" , "" , force , nil , nil )
88- assert .Equal (t , & replicationlib.PromoteVolumeResponse {}, resp )
89- assert .Nil (t , err )
88+ require .Equal (t , & replicationlib.PromoteVolumeResponse {}, resp )
89+ require .Nil (t , err )
9090
9191 // return error
9292 mockedPromoteVolume = & fake.ReplicationClient {
@@ -96,8 +96,8 @@ func TestPromoteVolume(t *testing.T) {
9696 }
9797 client = mockedPromoteVolume
9898 resp , err = client .PromoteVolume ("" , "" , force , nil , nil )
99- assert .Nil (t , resp )
100- assert .NotNil (t , err )
99+ require .Nil (t , resp )
100+ require .NotNil (t , err )
101101}
102102
103103func TestDemoteVolume (t * testing.T ) {
@@ -110,8 +110,8 @@ func TestDemoteVolume(t *testing.T) {
110110 }
111111 client := mockedDemoteVolume
112112 resp , err := client .DemoteVolume ("" , "" , nil , nil )
113- assert .Equal (t , & replicationlib.DemoteVolumeResponse {}, resp )
114- assert .Nil (t , err )
113+ require .Equal (t , & replicationlib.DemoteVolumeResponse {}, resp )
114+ require .Nil (t , err )
115115
116116 // return error
117117 mockedDemoteVolume = & fake.ReplicationClient {
@@ -121,8 +121,8 @@ func TestDemoteVolume(t *testing.T) {
121121 }
122122 client = mockedDemoteVolume
123123 resp , err = client .DemoteVolume ("" , "" , nil , nil )
124- assert .Nil (t , resp )
125- assert .NotNil (t , err )
124+ require .Nil (t , resp )
125+ require .NotNil (t , err )
126126}
127127
128128func TestResyncVolume (t * testing.T ) {
@@ -135,8 +135,8 @@ func TestResyncVolume(t *testing.T) {
135135 }
136136 client := mockedResyncVolume
137137 resp , err := client .ResyncVolume ("" , "" , nil , nil )
138- assert .Equal (t , & replicationlib.ResyncVolumeResponse {}, resp )
139- assert .Nil (t , err )
138+ require .Equal (t , & replicationlib.ResyncVolumeResponse {}, resp )
139+ require .Nil (t , err )
140140
141141 // return error
142142 mockedResyncVolume = & fake.ReplicationClient {
@@ -146,6 +146,6 @@ func TestResyncVolume(t *testing.T) {
146146 }
147147 client = mockedResyncVolume
148148 resp , err = client .ResyncVolume ("" , "" , nil , nil )
149- assert .Nil (t , resp )
150- assert .NotNil (t , err )
149+ require .Nil (t , resp )
150+ require .NotNil (t , err )
151151}
0 commit comments