@nsshunt/ststestrunner 1.1.160 → 1.1.162

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1510,6 +1510,7 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
1510
1510
  this.bundleBatch.entry = [];
1511
1511
  this.personRecords = [];
1512
1512
  }
1513
+ await Sleep(500);
1513
1514
  return personRecord;
1514
1515
  };
1515
1516
  };
@@ -1539,7 +1540,8 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
1539
1540
  const __snapshot1 = performance.now();
1540
1541
  const client = await this.GetClient();
1541
1542
  const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1542
- const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.GetRandomSequenceFromIteration(), "1");
1543
+ const prefix = this.runner.options.personPrefix;
1544
+ const personRecord = await this.GetPersonRecord(`${prefix}`, this.GetRandomSequenceFromIteration(), "1");
1543
1545
  const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1544
1546
  const retVal = await client.GetResource("Person", personRecord.id);
1545
1547
  const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
@@ -1547,15 +1549,14 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
1547
1549
  this.runner.instrumentData.requestCount++;
1548
1550
  const compPersonRecord = { ...personRecord };
1549
1551
  const loadedPersonRecorded = { ...retVal.body };
1550
- console.log(` ==> version id: [${loadedPersonRecorded.meta.versionId}]`);
1551
- console.log(` ==> tag: [${loadedPersonRecorded.meta.tag}]`);
1552
+ const loadedRecordVersion = loadedPersonRecorded.meta.versionId;
1552
1553
  delete compPersonRecord.meta;
1553
1554
  delete loadedPersonRecorded.meta;
1554
1555
  this.CheckReturnData(compPersonRecord, loadedPersonRecorded);
1555
1556
  const originalPersonRecord = retVal.body;
1556
1557
  if (originalPersonRecord && originalPersonRecord.text) {
1557
- originalPersonRecord.text.div = `Put record TestCaseFhir04 ${this.runner.iteration}`;
1558
- const retVal = await client.PutResource("Person", originalPersonRecord, `W/"1"`);
1558
+ originalPersonRecord.text.div = `Put record TestCaseFhir04 ${this.runner.iteration % this.GetMaxIteration(prefix)}`;
1559
+ const retVal = await client.PutResource("Person", originalPersonRecord, `W/"${loadedRecordVersion}"`);
1559
1560
  this._CheckOutputLongDurationError(__snapshot4, "await this.PutResource()");
1560
1561
  if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
1561
1562
  const updatedRecord = { ...retVal.body };
@@ -1572,31 +1573,6 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
1572
1573
  //#endregion
1573
1574
  //#region src/libmodule/testCaseFhir05.ts
1574
1575
  var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
1575
- PerformExecuteQuery = async () => {
1576
- const __snapshot1 = performance.now();
1577
- const client = await this.GetClient();
1578
- const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1579
- const originalPersonRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.GetRandomSequenceFromIteration(), "2");
1580
- const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1581
- if (originalPersonRecord && originalPersonRecord.text) {
1582
- originalPersonRecord.text.div = `Put record TestCaseFhir05 ${this.runner.iteration}`;
1583
- const retVal = await client.PutResource("Person", originalPersonRecord, `W/"2"`);
1584
- this._CheckOutputLongDurationError(__snapshot3, "await this.PutResource()");
1585
- if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
1586
- const updatedRecord = { ...retVal.body };
1587
- delete updatedRecord.meta;
1588
- delete originalPersonRecord.meta;
1589
- this.CheckReturnData(updatedRecord, originalPersonRecord);
1590
- return retVal.body;
1591
- } else {
1592
- this.runner.instrumentData.errorCount++;
1593
- return null;
1594
- }
1595
- };
1596
- };
1597
- //#endregion
1598
- //#region src/libmodule/testCaseFhir06.ts
1599
- var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
1600
1576
  PerformExecuteQuery = async () => {
1601
1577
  const __snapshot1 = performance.now();
1602
1578
  const client = await this.GetClient();
@@ -2280,28 +2256,30 @@ var fast_json_patch_default = Object.assign({}, core_exports, duplex_exports, {
2280
2256
  unescapePathComponent
2281
2257
  });
2282
2258
  //#endregion
2283
- //#region src/libmodule/testCaseFhir07.ts
2284
- var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
2259
+ //#region src/libmodule/testCaseFhir06.ts
2260
+ var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
2285
2261
  PerformExecuteQuery = async () => {
2286
2262
  const __snapshot1 = performance.now();
2287
2263
  const client = await this.GetClient();
2288
2264
  const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
2289
- const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.GetRandomSequenceFromIteration(), "3");
2265
+ const prefix = this.runner.options.personPrefix;
2266
+ const personRecord = await this.GetPersonRecord(`${prefix}`, this.GetRandomSequenceFromIteration(), "3");
2290
2267
  const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
2291
2268
  const retVal = await client.GetResource("Person", personRecord.id);
2292
2269
  const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
2293
2270
  if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2294
2271
  const resource = retVal.body;
2295
- const patchText = `Json Patched record TestCaseFhir07 ${this.runner.iteration}`;
2272
+ const loadedRecordVersion = resource.meta.versionId;
2273
+ const patchText = `Json Patched record TestCaseFhir07 ${this.runner.iteration % this.GetMaxIteration(prefix)}`;
2296
2274
  const observer = fast_json_patch_default.observe(resource);
2297
2275
  resource.text.div = patchText;
2298
2276
  const patchRecord = fast_json_patch_default.generate(observer);
2299
- const retValPatched = await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`);
2277
+ const retValPatched = await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"${loadedRecordVersion}"`);
2300
2278
  this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
2301
2279
  if (retValPatched.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2302
2280
  const retRecordCheck = { ...retValPatched.body };
2303
2281
  personRecord.text.div = patchText;
2304
- personRecord.meta.versionId = "4";
2282
+ personRecord.meta.versionId = (loadedRecordVersion + 1).toString();
2305
2283
  delete personRecord.meta.lastUpdated;
2306
2284
  delete retRecordCheck.meta.lastUpdated;
2307
2285
  this.CheckReturnData(personRecord, retRecordCheck);
@@ -2309,26 +2287,28 @@ var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
2309
2287
  };
2310
2288
  };
2311
2289
  //#endregion
2312
- //#region src/libmodule/testCaseFhir08.ts
2313
- var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
2290
+ //#region src/libmodule/testCaseFhir07.ts
2291
+ var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
2314
2292
  PerformExecuteQuery = async () => {
2315
2293
  const __snapshot1 = performance.now();
2316
2294
  const client = await this.GetClient();
2317
2295
  const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
2318
- const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.GetRandomSequenceFromIteration(), "4");
2296
+ const prefix = this.runner.options.personPrefix;
2297
+ const personRecord = await this.GetPersonRecord(`${prefix}`, this.GetRandomSequenceFromIteration(), "4");
2319
2298
  const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
2320
2299
  const retVal = await client.GetResource("Person", personRecord.id);
2321
2300
  const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
2322
2301
  if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2323
2302
  const resource = retVal.body;
2324
- const patchText = `Merge Patched record TestCaseFhir08 ${this.runner.iteration}`;
2303
+ const loadedRecordVersion = resource.meta.versionId;
2304
+ const patchText = `Merge Patched record TestCaseFhir08 ${this.runner.iteration & this.GetMaxIteration(prefix)}`;
2325
2305
  resource.text.div = patchText;
2326
- const retValPatched = await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`);
2306
+ const retValPatched = await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"${loadedRecordVersion}"`);
2327
2307
  this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
2328
2308
  if (retValPatched.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2329
2309
  const retRecordCheck = { ...retValPatched.body };
2330
2310
  personRecord.text.div = patchText;
2331
- personRecord.meta.versionId = "5";
2311
+ personRecord.meta.versionId = (loadedRecordVersion + 1).toString();
2332
2312
  delete personRecord.meta.lastUpdated;
2333
2313
  delete retRecordCheck.meta.lastUpdated;
2334
2314
  this.CheckReturnData(personRecord, retRecordCheck);
@@ -2336,24 +2316,29 @@ var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
2336
2316
  };
2337
2317
  };
2338
2318
  //#endregion
2339
- //#region src/libmodule/testCaseFhir09.ts
2340
- var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
2319
+ //#region src/libmodule/testCaseFhir08.ts
2320
+ var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
2341
2321
  PerformExecuteQuery = async () => {
2342
2322
  const __snapshot1 = performance.now();
2343
2323
  const client = await this.GetClient();
2344
2324
  const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
2345
- const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.GetRandomSequenceFromIteration(), "5");
2325
+ const prefix = this.runner.options.personPrefix;
2326
+ const personRecord = await this.GetPersonRecord(prefix, this.GetRandomSequenceFromIteration(), "5");
2346
2327
  const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
2347
- if (personRecord.text) try {
2348
- const retVal = await client.DeleteResource("Person", personRecord.id, `W/"5"`);
2349
- this._CheckOutputLongDurationError(__snapshot3, "await this.DeleteResource()");
2328
+ const retVal = await client.GetResource("Person", personRecord.id);
2329
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
2330
+ if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2331
+ const loadedRecordVersion = retVal.body.meta.versionId;
2332
+ try {
2333
+ const retVal = await client.DeleteResource("Person", personRecord.id, `W/"${loadedRecordVersion}"`);
2334
+ this._CheckOutputLongDurationError(__snapshot4, "await this.DeleteResource()");
2350
2335
  if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
2351
2336
  const deletedRetValCheck = {
2352
2337
  resourceType: "OperationOutcome",
2353
2338
  issue: [{
2354
2339
  severity: "error",
2355
2340
  code: "deleted",
2356
- diagnostics: `DeleteResource: Resource ${personRecord.id} version 6 has been deleted.`
2341
+ diagnostics: `DeleteResource: Resource ${personRecord.id} version ${loadedRecordVersion + 1} has been deleted.`
2357
2342
  }]
2358
2343
  };
2359
2344
  this.CheckReturnData(deletedRetValCheck, retVal.body);
@@ -2367,15 +2352,11 @@ var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
2367
2352
  } else throw error;
2368
2353
  } else throw error;
2369
2354
  }
2370
- else {
2371
- this.runner.instrumentData.errorCount++;
2372
- return null;
2373
- }
2374
2355
  };
2375
2356
  };
2376
2357
  //#endregion
2377
- //#region src/libmodule/testCaseFhir10.ts
2378
- var TestCaseFhir10 = class extends TestCaseFhirQueryBase {
2358
+ //#region src/libmodule/testCaseFhir09.ts
2359
+ var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
2379
2360
  PerformExecuteQuery = async () => {
2380
2361
  const __snapshot1 = performance.now();
2381
2362
  const client = await this.GetClient();
@@ -3262,7 +3243,6 @@ var AsyncRunnerFactory = class {
3262
3243
  case "TestCaseFhir07": return new TestCaseFhir07(runnerExecutionWorker, runner);
3263
3244
  case "TestCaseFhir08": return new TestCaseFhir08(runnerExecutionWorker, runner);
3264
3245
  case "TestCaseFhir09": return new TestCaseFhir09(runnerExecutionWorker, runner);
3265
- case "TestCaseFhir10": return new TestCaseFhir10(runnerExecutionWorker, runner);
3266
3246
  case "TestCaseFhir20": return new TestCaseFhir20(runnerExecutionWorker, runner);
3267
3247
  }
3268
3248
  return null;