@webex/internal-plugin-dss 3.0.0-next.10 → 3.0.0-next.12
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.
- package/dist/dss.js +1 -1
- package/package.json +8 -8
- package/test/unit/spec/dss.ts +59 -51
package/dist/dss.js
CHANGED
package/package.json
CHANGED
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@webex/common": "3.0.0-next.
|
|
24
|
-
"@webex/common-timers": "3.0.0-next.
|
|
25
|
-
"@webex/internal-plugin-mercury": "3.0.0-next.
|
|
26
|
-
"@webex/webex-core": "3.0.0-next.
|
|
23
|
+
"@webex/common": "3.0.0-next.8",
|
|
24
|
+
"@webex/common-timers": "3.0.0-next.8",
|
|
25
|
+
"@webex/internal-plugin-mercury": "3.0.0-next.10",
|
|
26
|
+
"@webex/webex-core": "3.0.0-next.8",
|
|
27
27
|
"lodash": "^4.17.21",
|
|
28
28
|
"uuid": "^3.3.2"
|
|
29
29
|
},
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@webex/eslint-config-legacy": "0.0.0",
|
|
34
34
|
"@webex/jest-config-legacy": "0.0.0",
|
|
35
35
|
"@webex/legacy-tools": "0.0.0",
|
|
36
|
-
"@webex/test-helper-chai": "3.0.0-next.
|
|
37
|
-
"@webex/test-helper-mock-webex": "3.0.0-next.
|
|
38
|
-
"@webex/test-helper-test-users": "3.0.0-next.
|
|
36
|
+
"@webex/test-helper-chai": "3.0.0-next.8",
|
|
37
|
+
"@webex/test-helper-mock-webex": "3.0.0-next.8",
|
|
38
|
+
"@webex/test-helper-test-users": "3.0.0-next.8",
|
|
39
39
|
"eslint": "^8.24.0",
|
|
40
40
|
"prettier": "^2.7.1",
|
|
41
41
|
"sinon": "^9.2.4"
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"test:style": "eslint ./src/**/*.*",
|
|
50
50
|
"test:unit": "webex-legacy-tools test --unit --runner jest"
|
|
51
51
|
},
|
|
52
|
-
"version": "3.0.0-next.
|
|
52
|
+
"version": "3.0.0-next.12"
|
|
53
53
|
}
|
package/test/unit/spec/dss.ts
CHANGED
|
@@ -620,22 +620,24 @@ describe('plugin-dss', () => {
|
|
|
620
620
|
});
|
|
621
621
|
|
|
622
622
|
it('fails with default timeout when mercury does not respond', async () => {
|
|
623
|
-
|
|
623
|
+
const {promise} = await testMakeRequest({
|
|
624
624
|
method: 'lookup',
|
|
625
625
|
resource: '/lookup/orgid/userOrgId/identities',
|
|
626
626
|
params: {id: 'id1', shouldBatch: false},
|
|
627
627
|
bodyParams: {lookupValues: ['id1']},
|
|
628
|
-
}).then(async ({promise}) => {
|
|
629
|
-
promise.catch((err) => {
|
|
630
|
-
expect(err.toString()).equal(
|
|
631
|
-
'DssTimeoutError: The DSS did not respond within 6000 ms.' +
|
|
632
|
-
'\n Request Id: randomid' +
|
|
633
|
-
'\n Resource: /lookup/orgid/userOrgId/identities' +
|
|
634
|
-
'\n Params: {"lookupValues":["id1"]}'
|
|
635
|
-
);
|
|
636
|
-
});
|
|
637
|
-
await clock.tickAsync(6000);
|
|
638
628
|
});
|
|
629
|
+
|
|
630
|
+
promise.catch(() => {}); // to prevent the test from failing due to unhandled promise rejection
|
|
631
|
+
|
|
632
|
+
await clock.tickAsync(6000);
|
|
633
|
+
|
|
634
|
+
return assert.isRejected(
|
|
635
|
+
promise,
|
|
636
|
+
'The DSS did not respond within 6000 ms.' +
|
|
637
|
+
'\n Request Id: randomid' +
|
|
638
|
+
'\n Resource: /lookup/orgid/userOrgId/identities' +
|
|
639
|
+
'\n Params: {"lookupValues":["id1"]}'
|
|
640
|
+
);
|
|
639
641
|
});
|
|
640
642
|
|
|
641
643
|
it('does not fail with timeout when mercury response in time', async () => {
|
|
@@ -719,22 +721,24 @@ describe('plugin-dss', () => {
|
|
|
719
721
|
});
|
|
720
722
|
|
|
721
723
|
it('fails with default timeout when mercury does not respond', async () => {
|
|
722
|
-
|
|
724
|
+
const {promise} = await testMakeRequest({
|
|
723
725
|
method: 'lookupByEmail',
|
|
724
726
|
resource: '/lookup/orgid/userOrgId/emails',
|
|
725
727
|
params: {email: 'email1'},
|
|
726
728
|
bodyParams: {lookupValues: ['email1']},
|
|
727
|
-
}).then(async ({promise}) => {
|
|
728
|
-
promise.catch((err) => {
|
|
729
|
-
expect(err.toString()).equal(
|
|
730
|
-
'DssTimeoutError: The DSS did not respond within 6000 ms.' +
|
|
731
|
-
'\n Request Id: randomid' +
|
|
732
|
-
'\n Resource: /lookup/orgid/userOrgId/emails' +
|
|
733
|
-
'\n Params: {"lookupValues":["email1"]}'
|
|
734
|
-
);
|
|
735
|
-
});
|
|
736
|
-
await clock.tickAsync(6000);
|
|
737
729
|
});
|
|
730
|
+
|
|
731
|
+
promise.catch(() => {}); // to prevent the test from failing due to unhandled promise rejection
|
|
732
|
+
|
|
733
|
+
await clock.tickAsync(6000);
|
|
734
|
+
|
|
735
|
+
return assert.isRejected(
|
|
736
|
+
promise,
|
|
737
|
+
'The DSS did not respond within 6000 ms.' +
|
|
738
|
+
'\n Request Id: randomid' +
|
|
739
|
+
'\n Resource: /lookup/orgid/userOrgId/emails' +
|
|
740
|
+
'\n Params: {"lookupValues":["email1"]}'
|
|
741
|
+
);
|
|
738
742
|
});
|
|
739
743
|
|
|
740
744
|
it('does not fail with timeout when mercury response in time', async () => {
|
|
@@ -813,7 +817,7 @@ describe('plugin-dss', () => {
|
|
|
813
817
|
});
|
|
814
818
|
|
|
815
819
|
it('fails with default timeout when mercury does not respond', async () => {
|
|
816
|
-
|
|
820
|
+
const {promise} = await testMakeRequest({
|
|
817
821
|
method: 'search',
|
|
818
822
|
resource: '/search/orgid/userOrgId/entities',
|
|
819
823
|
params: {
|
|
@@ -826,17 +830,19 @@ describe('plugin-dss', () => {
|
|
|
826
830
|
resultSize: 100,
|
|
827
831
|
queryString: 'query',
|
|
828
832
|
},
|
|
829
|
-
}).then(async ({promise}) => {
|
|
830
|
-
promise.catch((err) => {
|
|
831
|
-
expect(err.toString()).equal(
|
|
832
|
-
'DssTimeoutError: The DSS did not respond within 6000 ms.' +
|
|
833
|
-
'\n Request Id: randomid' +
|
|
834
|
-
'\n Resource: /search/orgid/userOrgId/entities' +
|
|
835
|
-
'\n Params: {"queryString":"query","resultSize":100,"requestedTypes":["PERSON","ROBOT"]}'
|
|
836
|
-
);
|
|
837
|
-
});
|
|
838
|
-
await clock.tickAsync(6000);
|
|
839
833
|
});
|
|
834
|
+
|
|
835
|
+
promise.catch(() => {}); // to prevent the test from failing due to unhandled promise rejection
|
|
836
|
+
|
|
837
|
+
await clock.tickAsync(6000);
|
|
838
|
+
|
|
839
|
+
return assert.isRejected(
|
|
840
|
+
promise,
|
|
841
|
+
'The DSS did not respond within 6000 ms.' +
|
|
842
|
+
'\n Request Id: randomid' +
|
|
843
|
+
'\n Resource: /search/orgid/userOrgId/entities' +
|
|
844
|
+
'\n Params: {"queryString":"query","resultSize":100,"requestedTypes":["PERSON","ROBOT"]}'
|
|
845
|
+
);
|
|
840
846
|
});
|
|
841
847
|
|
|
842
848
|
it('does not fail with timeout when mercury response in time', async () => {
|
|
@@ -871,7 +877,7 @@ describe('plugin-dss', () => {
|
|
|
871
877
|
});
|
|
872
878
|
|
|
873
879
|
it('fails with timeout when request only partially resolved', async () => {
|
|
874
|
-
|
|
880
|
+
const {requestId, promise} = await testMakeRequest({
|
|
875
881
|
method: 'search',
|
|
876
882
|
resource: '/search/orgid/userOrgId/entities',
|
|
877
883
|
params: {
|
|
@@ -884,24 +890,26 @@ describe('plugin-dss', () => {
|
|
|
884
890
|
resultSize: 100,
|
|
885
891
|
queryString: 'query',
|
|
886
892
|
},
|
|
887
|
-
}).then(async ({requestId, promise}) => {
|
|
888
|
-
mercuryCallbacks['event:directory.search'](
|
|
889
|
-
createData(requestId, 2, true, 'directoryEntities', ['data2'])
|
|
890
|
-
);
|
|
891
|
-
mercuryCallbacks['event:directory.search'](
|
|
892
|
-
createData(requestId, 0, false, 'directoryEntities', ['data0'])
|
|
893
|
-
);
|
|
894
|
-
|
|
895
|
-
promise.catch((err) => {
|
|
896
|
-
expect(err.toString()).equal(
|
|
897
|
-
'DssTimeoutError: The DSS did not respond within 6000 ms.' +
|
|
898
|
-
'\n Request Id: randomid' +
|
|
899
|
-
'\n Resource: /search/orgid/userOrgId/entities' +
|
|
900
|
-
'\n Params: {"queryString":"query","resultSize":100,"requestedTypes":["PERSON","ROBOT"]}'
|
|
901
|
-
);
|
|
902
|
-
});
|
|
903
|
-
await clock.tickAsync(6000);
|
|
904
893
|
});
|
|
894
|
+
|
|
895
|
+
mercuryCallbacks['event:directory.search'](
|
|
896
|
+
createData(requestId, 2, true, 'directoryEntities', ['data2'])
|
|
897
|
+
);
|
|
898
|
+
mercuryCallbacks['event:directory.search'](
|
|
899
|
+
createData(requestId, 0, false, 'directoryEntities', ['data0'])
|
|
900
|
+
);
|
|
901
|
+
|
|
902
|
+
promise.catch(() => {}); // to prevent the test from failing due to unhandled promise rejection
|
|
903
|
+
|
|
904
|
+
await clock.tickAsync(6000);
|
|
905
|
+
|
|
906
|
+
return assert.isRejected(
|
|
907
|
+
promise,
|
|
908
|
+
'The DSS did not respond within 6000 ms.' +
|
|
909
|
+
'\n Request Id: randomid' +
|
|
910
|
+
'\n Resource: /search/orgid/userOrgId/entities' +
|
|
911
|
+
'\n Params: {"queryString":"query","resultSize":100,"requestedTypes":["PERSON","ROBOT"]}'
|
|
912
|
+
);
|
|
905
913
|
});
|
|
906
914
|
});
|
|
907
915
|
|