@@ -1495,7 +1495,7 @@ func TestConnectionWithDeduplicateRule(t *testing.T) {
14951495 t .Logf ("Successfully created and verified connection with deduplicate rule: %s" , conn .ID )
14961496}
14971497
1498- // TestConnectionWithMultipleRules tests creating a connection with multiple rules and verifies logical ordering
1498+ // TestConnectionWithMultipleRules tests creating a connection with multiple rules and verifies they follow flag order
14991499func TestConnectionWithMultipleRules (t * testing.T ) {
15001500 if testing .Short () {
15011501 t .Skip ("Skipping acceptance test in short mode" )
@@ -1508,8 +1508,7 @@ func TestConnectionWithMultipleRules(t *testing.T) {
15081508 sourceName := "test-src-multi-" + timestamp
15091509 destName := "test-dst-multi-" + timestamp
15101510
1511- // Note: Rules are created in logical order (deduplicate -> transform -> filter -> delay -> retry)
1512- // This order matches the API's default ordering for proper data flow through the pipeline.
1511+ // Rules built from --rule-* flags follow the position of each rule type's first flag
15131512 var conn Connection
15141513 err := cli .RunJSON (& conn ,
15151514 "gateway" , "connection" , "create" ,
@@ -1541,23 +1540,23 @@ func TestConnectionWithMultipleRules(t *testing.T) {
15411540 require .NotEmpty (t , getConn .Rules , "Connection should have rules" )
15421541 require .Len (t , getConn .Rules , 3 , "Connection should have exactly three rules" )
15431542
1544- // Verify logical order: filter -> delay -> retry (deduplicate/transform not present in this test)
1545- assert .Equal (t , "filter" , getConn .Rules [0 ]["type" ], "First rule should be filter (logical order)" )
1546- assert .Equal (t , "delay " , getConn .Rules [1 ]["type" ], "Second rule should be delay (logical order)" )
1547- assert .Equal (t , "retry " , getConn .Rules [2 ]["type" ], "Third rule should be retry (logical order)" )
1543+ // Verify flag order: filter -> retry -> delay
1544+ assert .Equal (t , "filter" , getConn .Rules [0 ]["type" ], "First rule should be filter (flag order)" )
1545+ assert .Equal (t , "retry " , getConn .Rules [1 ]["type" ], "Second rule should be retry (flag order)" )
1546+ assert .Equal (t , "delay " , getConn .Rules [2 ]["type" ], "Third rule should be delay (flag order)" )
15481547
15491548 // Verify filter rule details
15501549 assertFilterRuleFieldMatches (t , getConn .Rules [0 ]["body" ], `{"type":"payment"}` , "body" )
15511550
15521551 // Verify delay rule details
1553- assert .Equal (t , float64 (1000 ), getConn .Rules [1 ]["delay" ], "Delay should be 1000 milliseconds" )
1552+ assert .Equal (t , float64 (1000 ), getConn .Rules [2 ]["delay" ], "Delay should be 1000 milliseconds" )
15541553
15551554 // Verify retry rule details
1556- assert .Equal (t , "exponential" , getConn .Rules [2 ]["strategy" ], "Retry strategy should be exponential" )
1557- assert .Equal (t , float64 (5 ), getConn .Rules [2 ]["count" ], "Retry count should be 5" )
1558- assert .Equal (t , float64 (60000 ), getConn .Rules [2 ]["interval" ], "Retry interval should be 60000" )
1555+ assert .Equal (t , "exponential" , getConn .Rules [1 ]["strategy" ], "Retry strategy should be exponential" )
1556+ assert .Equal (t , float64 (5 ), getConn .Rules [1 ]["count" ], "Retry count should be 5" )
1557+ assert .Equal (t , float64 (60000 ), getConn .Rules [1 ]["interval" ], "Retry interval should be 60000" )
15591558
1560- t .Logf ("Successfully created and verified connection with multiple rules in logical order: %s" , conn .ID )
1559+ t .Logf ("Successfully created and verified connection with multiple rules in flag order: %s" , conn .ID )
15611560}
15621561
15631562// TestConnectionWithRateLimiting tests creating a connection with rate limiting
0 commit comments