@@ -148,7 +148,7 @@ void testDoCommitAppendSnapshotsInitialVersion() throws IOException {
148148 properties .put (
149149 CatalogConstants .SNAPSHOTS_REFS_KEY ,
150150 SnapshotsUtil .serializeMap (
151- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (
151+ IcebergTestUtil .createMainBranchRefPointingTo (
152152 testSnapshots .get (testSnapshots .size () - 1 ))));
153153
154154 TableMetadata metadata = BASE_TABLE_METADATA .replaceProperties (properties );
@@ -193,7 +193,7 @@ void testDoCommitAppendSnapshotsExistingVersion() throws IOException {
193193 properties .put (
194194 CatalogConstants .SNAPSHOTS_REFS_KEY ,
195195 SnapshotsUtil .serializeMap (
196- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (
196+ IcebergTestUtil .createMainBranchRefPointingTo (
197197 testSnapshots .get (testSnapshots .size () - 1 ))));
198198 properties .put (getCanonicalFieldName ("tableLocation" ), TEST_LOCATION );
199199
@@ -248,7 +248,7 @@ void testDoCommitAppendAndDeleteSnapshots() throws IOException {
248248 properties .put (
249249 CatalogConstants .SNAPSHOTS_REFS_KEY ,
250250 SnapshotsUtil .serializeMap (
251- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (
251+ IcebergTestUtil .createMainBranchRefPointingTo (
252252 newSnapshots .get (newSnapshots .size () - 1 ))));
253253 properties .put (getCanonicalFieldName ("tableLocation" ), TEST_LOCATION );
254254
@@ -438,7 +438,7 @@ void testDoCommitDeleteSnapshots() throws IOException {
438438 properties .put (
439439 CatalogConstants .SNAPSHOTS_REFS_KEY ,
440440 SnapshotsUtil .serializeMap (
441- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (
441+ IcebergTestUtil .createMainBranchRefPointingTo (
442442 testSnapshots .get (testSnapshots .size () - 1 ))));
443443 properties .put (getCanonicalFieldName ("tableLocation" ), TEST_LOCATION );
444444
@@ -640,7 +640,7 @@ void testDoCommitSnapshotsValidationThrowsException() throws IOException {
640640 properties .put (
641641 CatalogConstants .SNAPSHOTS_REFS_KEY ,
642642 SnapshotsUtil .serializeMap (
643- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (
643+ IcebergTestUtil .createMainBranchRefPointingTo (
644644 testSnapshots .get (1 )))); // But main refs snapshot 1
645645 properties .put (getCanonicalFieldName ("tableLocation" ), TEST_LOCATION );
646646 metadata = metadata .replaceProperties (properties );
@@ -727,7 +727,7 @@ void testDoCommitAppendStageOnlySnapshotsExistingVersion() throws IOException {
727727 properties .put (
728728 CatalogConstants .SNAPSHOTS_REFS_KEY ,
729729 SnapshotsUtil .serializeMap (
730- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (newSnapshots .get (0 ))));
730+ IcebergTestUtil .createMainBranchRefPointingTo (newSnapshots .get (0 ))));
731731 properties .put (getCanonicalFieldName ("tableLocation" ), TEST_LOCATION );
732732
733733 TableMetadata metadata = base .replaceProperties (properties );
@@ -771,7 +771,7 @@ void testAppendSnapshotsWithOldSnapshots() throws IOException {
771771 properties .put (
772772 CatalogConstants .SNAPSHOTS_REFS_KEY ,
773773 SnapshotsUtil .serializeMap (
774- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (snapshots .get (snapshots .size () - 1 ))));
774+ IcebergTestUtil .createMainBranchRefPointingTo (snapshots .get (snapshots .size () - 1 ))));
775775
776776 TableMetadata newMetadata = baseMetadata .replaceProperties (properties );
777777
@@ -790,7 +790,7 @@ void testAppendSnapshotsWithOldSnapshots() throws IOException {
790790 propertiesWithFuture .put (
791791 CatalogConstants .SNAPSHOTS_REFS_KEY ,
792792 SnapshotsUtil .serializeMap (
793- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (snapshots .get (snapshots .size () - 1 ))));
793+ IcebergTestUtil .createMainBranchRefPointingTo (snapshots .get (snapshots .size () - 1 ))));
794794
795795 TableMetadata newMetadataWithFuture = baseMetadata .replaceProperties (propertiesWithFuture );
796796 openHouseInternalTableOperations .snapshotDiffApplier .applySnapshots (
@@ -823,7 +823,7 @@ void testDoCommitCherryPickSnapshotBaseUnchanged() throws IOException {
823823 properties .put (
824824 CatalogConstants .SNAPSHOTS_REFS_KEY ,
825825 SnapshotsUtil .serializeMap (
826- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (testWapSnapshots .get (0 ))));
826+ IcebergTestUtil .createMainBranchRefPointingTo (testWapSnapshots .get (0 ))));
827827 properties .put (getCanonicalFieldName ("tableLocation" ), TEST_LOCATION );
828828
829829 TableMetadata metadata = base .replaceProperties (properties );
@@ -864,7 +864,7 @@ void testDoCommitCherryPickSnapshotBaseChanged() throws IOException {
864864 properties .put (
865865 CatalogConstants .SNAPSHOTS_REFS_KEY ,
866866 SnapshotsUtil .serializeMap (
867- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (
867+ IcebergTestUtil .createMainBranchRefPointingTo (
868868 testWapSnapshots .get (2 )))); // new snapshot
869869 properties .put (getCanonicalFieldName ("tableLocation" ), TEST_LOCATION );
870870
@@ -905,7 +905,7 @@ void testDoCommitCherryPickFirstSnapshot() throws IOException {
905905 properties .put (
906906 CatalogConstants .SNAPSHOTS_REFS_KEY ,
907907 SnapshotsUtil .serializeMap (
908- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (testWapSnapshots .get (0 ))));
908+ IcebergTestUtil .createMainBranchRefPointingTo (testWapSnapshots .get (0 ))));
909909 properties .put (getCanonicalFieldName ("tableLocation" ), TEST_LOCATION );
910910
911911 TableMetadata metadata = base .replaceProperties (properties );
@@ -1475,7 +1475,7 @@ void testDeleteSnapshotWithNoReference() throws IOException {
14751475 properties .put (
14761476 CatalogConstants .SNAPSHOTS_REFS_KEY ,
14771477 SnapshotsUtil .serializeMap (
1478- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (referencedSnapshot )));
1478+ IcebergTestUtil .createMainBranchRefPointingTo (referencedSnapshot )));
14791479
14801480 TableMetadata newMetadata = baseMetadata .replaceProperties (properties );
14811481
@@ -1537,7 +1537,7 @@ void testDeleteEmptySnapshotList() throws IOException {
15371537 SnapshotsUtil .serializedSnapshots (baseMetadata .snapshots ()));
15381538 properties .put (
15391539 CatalogConstants .SNAPSHOTS_REFS_KEY ,
1540- SnapshotsUtil .serializeMap (IcebergTestUtil .obtainSnapshotRefsFromSnapshot (lastSnapshot )));
1540+ SnapshotsUtil .serializeMap (IcebergTestUtil .createMainBranchRefPointingTo (lastSnapshot )));
15411541
15421542 TableMetadata newMetadata = baseMetadata .replaceProperties (properties );
15431543
@@ -1583,7 +1583,7 @@ void testDeleteNullSnapshotList() throws IOException {
15831583 SnapshotsUtil .serializedSnapshots (baseMetadata .snapshots ()));
15841584 properties .put (
15851585 CatalogConstants .SNAPSHOTS_REFS_KEY ,
1586- SnapshotsUtil .serializeMap (IcebergTestUtil .obtainSnapshotRefsFromSnapshot (lastSnapshot )));
1586+ SnapshotsUtil .serializeMap (IcebergTestUtil .createMainBranchRefPointingTo (lastSnapshot )));
15871587
15881588 TableMetadata newMetadata = baseMetadata .replaceProperties (properties );
15891589
@@ -1633,7 +1633,7 @@ void testDeleteNonExistentSnapshot() throws IOException {
16331633 SnapshotsUtil .serializedSnapshots (baseMetadata .snapshots ()));
16341634 properties .put (
16351635 CatalogConstants .SNAPSHOTS_REFS_KEY ,
1636- SnapshotsUtil .serializeMap (IcebergTestUtil .obtainSnapshotRefsFromSnapshot (lastSnapshot )));
1636+ SnapshotsUtil .serializeMap (IcebergTestUtil .createMainBranchRefPointingTo (lastSnapshot )));
16371637
16381638 TableMetadata newMetadata = baseMetadata .replaceProperties (properties );
16391639
@@ -1721,7 +1721,7 @@ void testDeleteSnapshotMetricsRecordedBranch() throws IOException {
17211721 properties .put (
17221722 CatalogConstants .SNAPSHOTS_REFS_KEY ,
17231723 SnapshotsUtil .serializeMap (
1724- IcebergTestUtil .obtainSnapshotRefsFromSnapshot (referencedSnapshot )));
1724+ IcebergTestUtil .createMainBranchRefPointingTo (referencedSnapshot )));
17251725
17261726 TableMetadata newMetadata = baseMetadata .replaceProperties (properties );
17271727
@@ -1768,7 +1768,7 @@ void testDeleteSnapshotMetricsRecordedNonExistent() throws IOException {
17681768 SnapshotsUtil .serializedSnapshots (finalBaseMetadata .snapshots ()));
17691769 properties .put (
17701770 CatalogConstants .SNAPSHOTS_REFS_KEY ,
1771- SnapshotsUtil .serializeMap (IcebergTestUtil .obtainSnapshotRefsFromSnapshot (lastSnapshot )));
1771+ SnapshotsUtil .serializeMap (IcebergTestUtil .createMainBranchRefPointingTo (lastSnapshot )));
17721772
17731773 TableMetadata newMetadata = finalBaseMetadata .replaceProperties (properties );
17741774
0 commit comments