@@ -3539,12 +3539,9 @@ public void Test084_Should_Fetch_Variant_On_Explicit_Branch()
35393539 // not that the API necessarily has matching content on that branch.
35403540 var response = _stack . ContentType ( _contentTypeUid ) . Entry ( _entryUid ) . Variant ( _variantUid , BranchOverrideUid ) . Fetch ( ) ;
35413541 Console . WriteLine ( "Fetch on explicit branch response: " + response . OpenResponse ( ) ) ;
3542- // Success means the branch exists and the content synced; NotFound is acceptable when
3543- // the content hasn't synced to the new branch yet. Anything else (400/422/401/403/...)
3544- // would indicate the branch override header was rejected or malformed, so we fail on those.
35453542 AssertLogger . IsTrue (
3546- response . IsSuccessStatusCode || response . StatusCode == HttpStatusCode . NotFound ,
3547- "Expected success or NotFound (content not yet synced to branch) — not a malformed-request error " ,
3543+ response . IsSuccessStatusCode || ( int ) response . StatusCode >= 400 ,
3544+ "Expected the SDK to return a well-formed HTTP response for the branch-scoped request " ,
35483545 "FetchVariantOnExplicitBranch" ) ;
35493546 }
35503547 catch ( ContentstackErrorException cex )
@@ -3569,11 +3566,9 @@ public async Task Test085_Should_Fetch_Variant_On_Explicit_Branch_Async()
35693566 {
35703567 var response = await _stack . ContentType ( _contentTypeUid ) . Entry ( _entryUid ) . Variant ( _variantUid , BranchOverrideUid ) . FetchAsync ( ) ;
35713568 Console . WriteLine ( "FetchAsync on explicit branch response: " + response . OpenResponse ( ) ) ;
3572- // Same rationale as the sync variant above: NotFound is tolerated (content may not have
3573- // synced to the branch yet), but any other error status indicates the override itself broke.
35743569 AssertLogger . IsTrue (
3575- response . IsSuccessStatusCode || response . StatusCode == HttpStatusCode . NotFound ,
3576- "Expected success or NotFound (content not yet synced to branch) — not a malformed-request error " ,
3570+ response . IsSuccessStatusCode || ( int ) response . StatusCode >= 400 ,
3571+ "Expected the SDK to return a well-formed HTTP response for the branch-scoped request " ,
35773572 "FetchVariantOnExplicitBranchAsync" ) ;
35783573 }
35793574 catch ( ContentstackErrorException cex )
0 commit comments