@@ -25,27 +25,29 @@ var _ = Describe("actual-lrp-groups-for-guid", func() {
2525 })
2626
2727 JustBeforeEach (func () {
28+ //lint:ignore SA1019 - deprecated model used for testing deprecated functionality
29+ request := & models.ActualLRPGroupsByProcessGuidRequest {
30+ ProcessGuid : "random-guid" ,
31+ }
32+ //lint:ignore SA1019 - deprecated model used for testing deprecated functionality
33+ response := & models.ActualLRPGroupsResponse {
34+ //lint:ignore SA1019 - deprecated model used for testing deprecated functionality
35+ ActualLrpGroups : []* models.ActualLRPGroup {
36+ {
37+ Instance : & models.ActualLRP {
38+ State : "running" ,
39+ },
40+ },
41+ },
42+ }
2843 bbsServer .AppendHandlers (
2944 ghttp .CombineHandlers (
3045 ghttp .VerifyRequest ("POST" , "/v1/actual_lrp_groups/list_by_process_guid" ),
3146 func (w http.ResponseWriter , req * http.Request ) {
3247 time .Sleep (time .Duration (serverTimeout ) * time .Second )
3348 },
34- //lint:ignore SA1019 - deprecated model used for testing deprecated functionality
35- ghttp .VerifyProtoRepresenting (& models.ActualLRPGroupsByProcessGuidRequest {
36- ProcessGuid : "random-guid" ,
37- }),
38- //lint:ignore SA1019 - deprecated model used for testing deprecated functionality
39- ghttp .RespondWithProto (200 , & models.ActualLRPGroupsResponse {
40- //lint:ignore SA1019 - deprecated model used for testing deprecated functionality
41- ActualLrpGroups : []* models.ActualLRPGroup {
42- {
43- Instance : & models.ActualLRP {
44- State : "running" ,
45- },
46- },
47- },
48- }),
49+ ghttp .VerifyProtoRepresenting (request .ToProto ()),
50+ ghttp .RespondWithProto (200 , response .ToProto ()),
4951 ),
5052 )
5153 })
@@ -81,16 +83,17 @@ var _ = Describe("actual-lrp-groups-for-guid", func() {
8183
8284 Context ("when the server returns an error" , func () {
8385 BeforeEach (func () {
86+ response := & models.DomainsResponse {
87+ Error : & models.Error {
88+ Type : models .Error_Deadlock ,
89+ Message : "the request failed due to deadlock" ,
90+ },
91+ Domains : nil ,
92+ }
8493 bbsServer .AppendHandlers (
8594 ghttp .CombineHandlers (
8695 ghttp .VerifyRequest ("POST" , "/v1/actual_lrp_groups/list_by_process_guid" ),
87- ghttp .RespondWithProto (500 , & models.DomainsResponse {
88- Error : & models.Error {
89- Type : models .Error_Deadlock ,
90- Message : "the request failed due to deadlock" ,
91- },
92- Domains : nil ,
93- }),
96+ ghttp .RespondWithProto (500 , response .ToProto ()),
9497 ),
9598 )
9699 })
@@ -112,28 +115,30 @@ var _ = Describe("actual-lrp-groups-for-guid", func() {
112115
113116 Context ("when passing index as filter" , func () {
114117 BeforeEach (func () {
118+ //lint:ignore SA1019 - deprecated model used for testing deprecated functionality
119+ request := & models.ActualLRPGroupByProcessGuidAndIndexRequest {
120+ ProcessGuid : "test-process-guid" ,
121+ Index : 1 ,
122+ }
123+ //lint:ignore SA1019 - deprecated model used for testing deprecated functionality
124+ response := & models.ActualLRPGroupsResponse {
125+ //lint:ignore SA1019 - deprecated model used for testing deprecated functionality
126+ ActualLrpGroups : []* models.ActualLRPGroup {
127+ {
128+ Instance : & models.ActualLRP {
129+ ActualLrpKey : models.ActualLRPKey {
130+ Index : 1 ,
131+ },
132+ State : "running" ,
133+ },
134+ },
135+ },
136+ }
115137 bbsServer .AppendHandlers (
116138 ghttp .CombineHandlers (
117139 ghttp .VerifyRequest ("POST" , "/v1/actual_lrp_groups/get_by_process_guid_and_index" ),
118- //lint:ignore SA1019 - deprecated model used for testing deprecated functionality
119- ghttp .VerifyProtoRepresenting (& models.ActualLRPGroupByProcessGuidAndIndexRequest {
120- ProcessGuid : "test-process-guid" ,
121- Index : 1 ,
122- }),
123- //lint:ignore SA1019 - deprecated model used for testing deprecated functionality
124- ghttp .RespondWithProto (200 , & models.ActualLRPGroupsResponse {
125- //lint:ignore SA1019 - deprecated model used for testing deprecated functionality
126- ActualLrpGroups : []* models.ActualLRPGroup {
127- {
128- Instance : & models.ActualLRP {
129- ActualLRPKey : models.ActualLRPKey {
130- Index : 1 ,
131- },
132- State : "running" ,
133- },
134- },
135- },
136- }),
140+ ghttp .VerifyProtoRepresenting (request .ToProto ()),
141+ ghttp .RespondWithProto (200 , response .ToProto ()),
137142 ),
138143 )
139144 })
0 commit comments