@@ -1056,6 +1056,38 @@ func Test_Report_FormatReport(t *testing.T) {
10561056 billingClient .AssertExpectations (t )
10571057 })
10581058
1059+ t .Run ("includes orgID in metadata" , func (t * testing.T ) {
1060+ t .Parallel ()
1061+
1062+ testOrgID := "org-123"
1063+ labels := map [string ]string {
1064+ platform .KeyWorkflowOwner : "accountId" ,
1065+ platform .KeyWorkflowID : "workflowId" ,
1066+ platform .KeyWorkflowVersion : workflowV2 ,
1067+ platform .KeyWorkflowExecutionID : "workflowExecutionId" ,
1068+ platform .KeyDonID : "42" ,
1069+ platform .KeyDonF : "1" ,
1070+ platform .KeyDonN : "3" ,
1071+ platform .KeyP2PID : "peerId" ,
1072+ platform .KeyTriggerID : "triggerId" ,
1073+ platform .KeyOrganizationID : testOrgID ,
1074+ }
1075+
1076+ billingClient := mocks .NewBillingClient (t )
1077+ billingClient .EXPECT ().GetWorkflowExecutionRates (mock .Anything , mock .Anything ).
1078+ Return (& billing.GetWorkflowExecutionRatesResponse {}, nil )
1079+
1080+ report , err := NewReport (t .Context (), labels , logger .Nop (), billingClient , defaultMetrics (t ), dummyRegistryAddress , dummyChainSelector , workflowV2 )
1081+ require .NoError (t , err )
1082+
1083+ billingClient .EXPECT ().ReserveCredits (mock .Anything , mock .Anything ).Return (& successReserveResponse , nil )
1084+ require .NoError (t , report .Reserve (t .Context ()))
1085+
1086+ meteringReport := report .FormatReport ()
1087+ require .Equal (t , testOrgID , meteringReport .Metadata .OrgID )
1088+ billingClient .AssertExpectations (t )
1089+ })
1090+
10591091 t .Run ("contains all step data" , func (t * testing.T ) {
10601092 t .Parallel ()
10611093
0 commit comments