@@ -191,12 +191,6 @@ func (suite *AttachFunctionTestSuite) TestAttachFunction_SuccessfulCreation() {
191191 []string {inputCollectionID }, (* string )(nil ), tenantID , databaseName , (* int32 )(nil ), (* int32 )(nil ), false ).
192192 Return ([]* dbmodel.CollectionAndMetadata {{Collection : & dbmodel.Collection {ID : inputCollectionID }}}, nil ).Once ()
193193
194- // Check output collection doesn't exist
195- suite .mockMetaDomain .On ("CollectionDb" , mock .Anything ).Return (suite .mockCollectionDb ).Once ()
196- suite .mockCollectionDb .On ("GetCollections" ,
197- []string (nil ), & outputCollectionName , tenantID , databaseName , (* int32 )(nil ), (* int32 )(nil ), false ).
198- Return ([]* dbmodel.CollectionAndMetadata {}, nil ).Once ()
199-
200194 // Insert attached function with lowest_live_nonce = NULL
201195 suite .mockMetaDomain .On ("AttachedFunctionDb" , mock .Anything ).Return (suite .mockAttachedFunctionDb ).Once ()
202196 suite .mockAttachedFunctionDb .On ("Insert" , mock .MatchedBy (func (attachedFunction * dbmodel.AttachedFunction ) bool {
@@ -225,7 +219,7 @@ func (suite *AttachFunctionTestSuite) TestAttachFunction_SuccessfulCreation() {
225219
226220 suite .NoError (err )
227221 suite .NotNil (response )
228- suite .NotEmpty (response .Id )
222+ suite .NotEmpty (response .AttachedFunction . Id )
229223
230224 // Verify all mocks were called as expected
231225 suite .mockMetaDomain .AssertExpectations (suite .T ())
@@ -317,7 +311,7 @@ func (suite *AttachFunctionTestSuite) TestAttachFunction_IdempotentRequest_Alrea
317311 // Assertions
318312 suite .NoError (err )
319313 suite .NotNil (response )
320- suite .Equal (existingAttachedFunctionID .String (), response .Id )
314+ suite .Equal (existingAttachedFunctionID .String (), response .AttachedFunction . Id )
321315
322316 // Verify no writes occurred (no Insert, no heap Push)
323317 // Note: Transaction IS called for idempotency check, but no writes happen inside it
@@ -390,11 +384,6 @@ func (suite *AttachFunctionTestSuite) TestAttachFunction_RecoveryFlow() {
390384 []string {inputCollectionID }, (* string )(nil ), tenantID , databaseName , (* int32 )(nil ), (* int32 )(nil ), false ).
391385 Return ([]* dbmodel.CollectionAndMetadata {{Collection : & dbmodel.Collection {ID : inputCollectionID }}}, nil ).Once ()
392386
393- suite .mockMetaDomain .On ("CollectionDb" , mock .Anything ).Return (suite .mockCollectionDb ).Once ()
394- suite .mockCollectionDb .On ("GetCollections" ,
395- []string (nil ), & outputCollectionName , tenantID , databaseName , (* int32 )(nil ), (* int32 )(nil ), false ).
396- Return ([]* dbmodel.CollectionAndMetadata {}, nil ).Once ()
397-
398387 suite .mockMetaDomain .On ("AttachedFunctionDb" , mock .Anything ).Return (suite .mockAttachedFunctionDb ).Once ()
399388 suite .mockAttachedFunctionDb .On ("Insert" , mock .Anything ).Return (nil ).Once ()
400389
@@ -408,7 +397,7 @@ func (suite *AttachFunctionTestSuite) TestAttachFunction_RecoveryFlow() {
408397 response1 , err1 := suite .coordinator .AttachFunction (ctx , request )
409398 suite .NoError (err1 )
410399 suite .NotNil (response1 )
411- suite .NotEmpty (response1 .Id )
400+ suite .NotEmpty (response1 .AttachedFunction . Id )
412401
413402 // ========== GetAttachedFunctionByName: Should Return ErrAttachedFunctionNotReady ==========
414403
@@ -453,7 +442,7 @@ func (suite *AttachFunctionTestSuite) TestAttachFunction_RecoveryFlow() {
453442 response2 , err2 := suite .coordinator .AttachFunction (ctx , request )
454443 suite .NoError (err2 )
455444 suite .NotNil (response2 )
456- suite .Equal (incompleteAttachedFunctionID .String (), response2 .Id )
445+ suite .Equal (incompleteAttachedFunctionID .String (), response2 .AttachedFunction . Id )
457446
458447 // Verify transaction was called in both attempts (idempotency check happens in transaction)
459448 suite .mockTxImpl .AssertNumberOfCalls (suite .T (), "Transaction" , 2 ) // First attempt + recovery attempt
0 commit comments