@@ -58,21 +58,21 @@ var _ = Describe("AffinityGroup Unit Tests", func() {
5858 Context ("Fetch or Create Affinity group" , func () {
5959 It ("fetches an affinity group by Name" , func () {
6060 dummies .AffinityGroup .ID = "" // Force name fetching.
61- ags .EXPECT ().GetAffinityGroupByName (dummies .AffinityGroup .Name ).Return (& cloudstack.AffinityGroup {}, 1 , nil )
61+ ags .EXPECT ().GetAffinityGroupByName (dummies .AffinityGroup .Name , gomock . Any () ).Return (& cloudstack.AffinityGroup {}, 1 , nil )
6262
6363 Ω (client .GetOrCreateAffinityGroup (dummies .AffinityGroup )).Should (Succeed ())
6464 })
6565
6666 It ("fetches an affinity group by ID" , func () {
67- ags .EXPECT ().GetAffinityGroupByID (dummies .AffinityGroup .ID ).Return (& cloudstack.AffinityGroup {}, 1 , nil )
67+ ags .EXPECT ().GetAffinityGroupByID (dummies .AffinityGroup .ID , gomock . Any () ).Return (& cloudstack.AffinityGroup {}, 1 , nil )
6868
6969 Ω (client .GetOrCreateAffinityGroup (dummies .AffinityGroup )).Should (Succeed ())
7070 })
7171
7272 It ("creates an affinity group" , func () {
7373 // dummies.SetDummyDomainAndAccount()
7474 // dummies.SetDummyDomainID()
75- ags .EXPECT ().GetAffinityGroupByID (dummies .AffinityGroup .ID ).Return (nil , - 1 , fakeError )
75+ ags .EXPECT ().GetAffinityGroupByID (dummies .AffinityGroup .ID , gomock . Any () ).Return (nil , - 1 , fakeError )
7676 ags .EXPECT ().NewCreateAffinityGroupParams (dummies .AffinityGroup .Name , dummies .AffinityGroup .Type ).
7777 Return (& cloudstack.CreateAffinityGroupParams {})
7878 ags .EXPECT ().CreateAffinityGroup (ParamMatch (And (NameEquals (dummies .AffinityGroup .Name )))).
@@ -84,7 +84,7 @@ var _ = Describe("AffinityGroup Unit Tests", func() {
8484 It ("creates an affinity group if Name provided returns more than one affinity group" , func () {
8585 dummies .AffinityGroup .ID = "" // Force name fetching.
8686 agp := & cloudstack.CreateAffinityGroupParams {}
87- ags .EXPECT ().GetAffinityGroupByName (dummies .AffinityGroup .Name ).Return (& cloudstack.AffinityGroup {}, 2 , nil )
87+ ags .EXPECT ().GetAffinityGroupByName (dummies .AffinityGroup .Name , gomock . Any () ).Return (& cloudstack.AffinityGroup {}, 2 , nil )
8888 ags .EXPECT ().NewCreateAffinityGroupParams (gomock .Any (), gomock .Any ()).Return (agp )
8989 ags .EXPECT ().CreateAffinityGroup (agp ).Return (& cloudstack.CreateAffinityGroupResponse {}, nil )
9090
@@ -94,7 +94,7 @@ var _ = Describe("AffinityGroup Unit Tests", func() {
9494 It ("creates an affinity group if getting affinity group by name fails" , func () {
9595 dummies .AffinityGroup .ID = "" // Force name fetching.
9696 agp := & cloudstack.CreateAffinityGroupParams {}
97- ags .EXPECT ().GetAffinityGroupByName (dummies .AffinityGroup .Name ).Return (nil , - 1 , fakeError )
97+ ags .EXPECT ().GetAffinityGroupByName (dummies .AffinityGroup .Name , gomock . Any () ).Return (nil , - 1 , fakeError )
9898 ags .EXPECT ().NewCreateAffinityGroupParams (gomock .Any (), gomock .Any ()).Return (agp )
9999 ags .EXPECT ().CreateAffinityGroup (agp ).Return (& cloudstack.CreateAffinityGroupResponse {}, nil )
100100
@@ -103,7 +103,7 @@ var _ = Describe("AffinityGroup Unit Tests", func() {
103103
104104 It ("creates an affinity group if ID provided returns more than one affinity group" , func () {
105105 agp := & cloudstack.CreateAffinityGroupParams {}
106- ags .EXPECT ().GetAffinityGroupByID (dummies .AffinityGroup .ID ).Return (& cloudstack.AffinityGroup {}, 2 , nil )
106+ ags .EXPECT ().GetAffinityGroupByID (dummies .AffinityGroup .ID , gomock . Any () ).Return (& cloudstack.AffinityGroup {}, 2 , nil )
107107 ags .EXPECT ().NewCreateAffinityGroupParams (gomock .Any (), gomock .Any ()).Return (agp )
108108 ags .EXPECT ().CreateAffinityGroup (agp ).Return (& cloudstack.CreateAffinityGroupResponse {}, nil )
109109
@@ -112,7 +112,7 @@ var _ = Describe("AffinityGroup Unit Tests", func() {
112112
113113 It ("creates an affinity group if getting affinity group by ID fails" , func () {
114114 agp := & cloudstack.CreateAffinityGroupParams {}
115- ags .EXPECT ().GetAffinityGroupByID (dummies .AffinityGroup .ID ).Return (nil , - 1 , fakeError )
115+ ags .EXPECT ().GetAffinityGroupByID (dummies .AffinityGroup .ID , gomock . Any () ).Return (nil , - 1 , fakeError )
116116 ags .EXPECT ().NewCreateAffinityGroupParams (gomock .Any (), gomock .Any ()).Return (agp )
117117 ags .EXPECT ().CreateAffinityGroup (agp ).Return (& cloudstack.CreateAffinityGroupResponse {}, nil )
118118
@@ -164,7 +164,7 @@ var _ = Describe("AffinityGroup Unit Tests", func() {
164164 It ("Associate affinity group" , func () {
165165 uagp := & cloudstack.UpdateVMAffinityGroupParams {}
166166 vmp := & cloudstack.StartVirtualMachineParams {}
167- vms .EXPECT ().GetVirtualMachineByID (* dummies .CSMachine1 .Spec .InstanceID ).Return (& cloudstack.VirtualMachine {}, 1 , nil )
167+ vms .EXPECT ().GetVirtualMachineByID (* dummies .CSMachine1 .Spec .InstanceID , gomock . Any () ).Return (& cloudstack.VirtualMachine {}, 1 , nil )
168168 ags .EXPECT ().NewUpdateVMAffinityGroupParams (* dummies .CSMachine1 .Spec .InstanceID ).Return (uagp )
169169 vms .EXPECT ().NewStopVirtualMachineParams (* dummies .CSMachine1 .Spec .InstanceID ).Return (& cloudstack.StopVirtualMachineParams {})
170170 vms .EXPECT ().StopVirtualMachine (& cloudstack.StopVirtualMachineParams {}).Return (& cloudstack.StopVirtualMachineResponse {State : "Stopping" }, nil )
@@ -177,7 +177,7 @@ var _ = Describe("AffinityGroup Unit Tests", func() {
177177 It ("Disassociate affinity group" , func () {
178178 uagp := & cloudstack.UpdateVMAffinityGroupParams {}
179179 vmp := & cloudstack.StartVirtualMachineParams {}
180- vms .EXPECT ().GetVirtualMachineByID (* dummies .CSMachine1 .Spec .InstanceID ).Return (& cloudstack.VirtualMachine {}, 1 , nil )
180+ vms .EXPECT ().GetVirtualMachineByID (* dummies .CSMachine1 .Spec .InstanceID , gomock . Any () ).Return (& cloudstack.VirtualMachine {}, 1 , nil )
181181 ags .EXPECT ().NewUpdateVMAffinityGroupParams (* dummies .CSMachine1 .Spec .InstanceID ).Return (uagp )
182182 vms .EXPECT ().NewStopVirtualMachineParams (* dummies .CSMachine1 .Spec .InstanceID ).Return (& cloudstack.StopVirtualMachineParams {})
183183 vms .EXPECT ().StopVirtualMachine (& cloudstack.StopVirtualMachineParams {}).Return (& cloudstack.StopVirtualMachineResponse {State : "Stopping" }, nil )
0 commit comments