diff --git a/clients/imodelhub/src/imodelhub/CheckpointsV2.ts b/clients/imodelhub/src/imodelhub/CheckpointsV2.ts index f48230501b12..b9f915c5f4cd 100644 --- a/clients/imodelhub/src/imodelhub/CheckpointsV2.ts +++ b/clients/imodelhub/src/imodelhub/CheckpointsV2.ts @@ -115,8 +115,8 @@ export class CheckpointV2Query extends WsgQuery { * This query returns a closest CheckpointV2 that will reach target ChangeSet by only merging forward. This resets all previously set filters. * @returns This query. */ - public precedingCheckpoint(targetChangeSetId: string): this { - this.filter(`PrecedingCheckpoint-backward-ChangeSet.Id+eq+'${targetChangeSetId}'`); + public precedingCheckpointV2(targetChangeSetId: string): this { + this.filter(`PrecedingCheckpointV2-backward-ChangeSet.Id+eq+'${targetChangeSetId}'`); return this; } diff --git a/common/api/imodelhub-client.api.md b/common/api/imodelhub-client.api.md index 18324d2d1387..e75a60315921 100644 --- a/common/api/imodelhub-client.api.md +++ b/common/api/imodelhub-client.api.md @@ -322,7 +322,7 @@ export class CheckpointV2Handler { export class CheckpointV2Query extends WsgQuery { byChangeSetId(changeSetId: string): this; byState(state: CheckpointV2State): this; - precedingCheckpoint(targetChangeSetId: string): this; + precedingCheckpointV2(targetChangeSetId: string): this; selectContainerAccessKey(): this; selectFailureInfo(): this; } diff --git a/common/changes/@bentley/imodelhub-client-tests/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json b/common/changes/@bentley/imodelhub-client-tests/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json new file mode 100644 index 000000000000..b856db696ca0 --- /dev/null +++ b/common/changes/@bentley/imodelhub-client-tests/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@bentley/imodelhub-client-tests", + "comment": "Test fixes to setup mock with the new PrecedingCheckpointV2 relationship", + "type": "none" + } + ], + "packageName": "@bentley/imodelhub-client-tests", + "email": "70565417+austeja-bentley@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@bentley/imodelhub-client/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json b/common/changes/@bentley/imodelhub-client/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json new file mode 100644 index 000000000000..77edf4b5aff3 --- /dev/null +++ b/common/changes/@bentley/imodelhub-client/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@bentley/imodelhub-client", + "comment": "PrecedingCheckpointv2 usage in CheckpointV2Handler", + "type": "none" + } + ], + "packageName": "@bentley/imodelhub-client", + "email": "70565417+austeja-bentley@users.noreply.github.com" +} \ No newline at end of file diff --git a/full-stack-tests/imodelhub-client/src/imodelhub/CheckpointV2.test.ts b/full-stack-tests/imodelhub-client/src/imodelhub/CheckpointV2.test.ts index c66f54050e03..a7d652224a3e 100644 --- a/full-stack-tests/imodelhub-client/src/imodelhub/CheckpointV2.test.ts +++ b/full-stack-tests/imodelhub-client/src/imodelhub/CheckpointV2.test.ts @@ -179,8 +179,8 @@ describe("iModelHub CheckpointV2Handler", () => { }); async function verifyPrecedingCheckpointV2(changeSetId: string, expectedPrecedingChangeSetId: string) { - mockGetCheckpointV2(imodelId, `?$filter=PrecedingCheckpoint-backward-ChangeSet.Id+eq+%27${changeSetId}%27`, mockCheckpointV2(expectedPrecedingChangeSetId, CheckpointV2State.Successful, "1")); - const checkpoints = await iModelClient.checkpointsV2.get(requestContext, imodelId, new CheckpointV2Query().precedingCheckpoint(changeSetId)); + mockGetCheckpointV2(imodelId, `?$filter=PrecedingCheckpointV2-backward-ChangeSet.Id+eq+%27${changeSetId}%27`, mockCheckpointV2(expectedPrecedingChangeSetId, CheckpointV2State.Successful, "1")); + const checkpoints = await iModelClient.checkpointsV2.get(requestContext, imodelId, new CheckpointV2Query().precedingCheckpointV2(changeSetId)); chai.assert(checkpoints); chai.expect(checkpoints.length).to.be.equal(1); chai.expect(checkpoints[0].changeSetId).to.be.equal(expectedPrecedingChangeSetId);