diff --git a/examples/fdc3-chart-and-grid/js-chart/package.json b/examples/fdc3-chart-and-grid/js-chart/package.json
index 70f2f6d86..5de35c848 100644
--- a/examples/fdc3-chart-and-grid/js-chart/package.json
+++ b/examples/fdc3-chart-and-grid/js-chart/package.json
@@ -21,7 +21,7 @@
"devDependencies": {
"http-server": "14.1.1",
"rimraf": "5.0.5",
- "rollup": "4.13.2",
+ "rollup": "4.17.2",
"@rollup/plugin-commonjs": "25.0.7",
"@rollup/plugin-node-resolve": "15.2.3"
}
diff --git a/examples/fdc3-chart-and-grid/js-datagrid/package.json b/examples/fdc3-chart-and-grid/js-datagrid/package.json
index 93647f848..16b9761df 100644
--- a/examples/fdc3-chart-and-grid/js-datagrid/package.json
+++ b/examples/fdc3-chart-and-grid/js-datagrid/package.json
@@ -10,27 +10,27 @@
"test": "ng test --watch=false"
},
"dependencies": {
- "@angular/animations": "17.3.2",
- "@angular/cdk": "17.3.2",
- "@angular/common": "17.3.2",
- "@angular/compiler": "17.3.2",
- "@angular/core": "17.3.2",
+ "@angular/animations": "17.3.7",
+ "@angular/cdk": "17.3.6",
+ "@angular/common": "17.3.7",
+ "@angular/compiler": "17.3.7",
+ "@angular/core": "17.3.7",
"@angular/flex-layout": "^15.0.0-beta.42",
- "@angular/forms": "17.3.2",
- "@angular/material": "17.3.2",
- "@angular/platform-browser": "17.3.2",
- "@angular/platform-browser-dynamic": "17.3.2",
- "@angular/router": "17.3.2",
- "@finos/fdc3": "2.0.3",
+ "@angular/forms": "17.3.7",
+ "@angular/material": "17.3.6",
+ "@angular/platform-browser": "17.3.7",
+ "@angular/platform-browser-dynamic": "17.3.7",
+ "@angular/router": "17.3.7",
+ "@finos/fdc3": "2.1.0",
"material-icons": "1.13.12",
"rxjs": "7.8.1",
"tslib": "2.6.2",
- "zone.js": "0.14.4"
+ "zone.js": "0.14.5"
},
"devDependencies": {
- "@angular-devkit/build-angular": "17.3.2",
- "@angular/cli": "17.3.2",
- "@angular/compiler-cli": "17.3.2",
+ "@angular-devkit/build-angular": "17.3.6",
+ "@angular/cli": "17.3.6",
+ "@angular/compiler-cli": "17.3.7",
"@types/jasmine": "5.1.4",
"jasmine-core": "5.1.2",
"karma": "6.4.3",
@@ -38,6 +38,6 @@
"karma-coverage": "2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "2.1.0",
- "typescript": "5.4.3"
+ "typescript": "5.4.5"
}
}
diff --git a/examples/js-chart-and-grid-messagerouter/js-datagrid/package.json b/examples/js-chart-and-grid-messagerouter/js-datagrid/package.json
index 931a529f7..7062de333 100644
--- a/examples/js-chart-and-grid-messagerouter/js-datagrid/package.json
+++ b/examples/js-chart-and-grid-messagerouter/js-datagrid/package.json
@@ -10,27 +10,27 @@
"test": "ng test --watch=false"
},
"dependencies": {
- "@angular/animations": "17.3.2",
- "@angular/cdk": "17.3.2",
- "@angular/common": "17.3.2",
- "@angular/compiler": "17.3.2",
- "@angular/core": "17.3.2",
+ "@angular/animations": "17.3.7",
+ "@angular/cdk": "17.3.6",
+ "@angular/common": "17.3.7",
+ "@angular/compiler": "17.3.7",
+ "@angular/core": "17.3.7",
"@angular/flex-layout": "^15.0.0-beta.42",
- "@angular/forms": "17.3.2",
- "@angular/material": "17.3.2",
- "@angular/platform-browser": "17.3.2",
- "@angular/platform-browser-dynamic": "17.3.2",
- "@angular/router": "17.3.2",
+ "@angular/forms": "17.3.7",
+ "@angular/material": "17.3.6",
+ "@angular/platform-browser": "17.3.7",
+ "@angular/platform-browser-dynamic": "17.3.7",
+ "@angular/router": "17.3.7",
"material-icons": "1.13.12",
"@morgan-stanley/composeui-messaging-client": "*",
"rxjs": "7.8.1",
"tslib": "2.6.2",
- "zone.js": "0.14.4"
+ "zone.js": "0.14.5"
},
"devDependencies": {
- "@angular-devkit/build-angular": "17.3.2",
- "@angular/cli": "17.3.2",
- "@angular/compiler-cli": "17.3.2",
+ "@angular-devkit/build-angular": "17.3.6",
+ "@angular/cli": "17.3.6",
+ "@angular/compiler-cli": "17.3.7",
"@types/jasmine": "5.1.4",
"jasmine-core": "5.1.2",
"karma": "6.4.3",
@@ -38,6 +38,6 @@
"karma-coverage": "2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "2.1.0",
- "typescript": "5.4.3"
+ "typescript": "5.4.5"
}
}
diff --git a/package-lock.json b/package-lock.json
index 67d76d863..b15147374 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -32,203 +32,9 @@
"@rollup/plugin-node-resolve": "15.2.3",
"http-server": "14.1.1",
"rimraf": "5.0.5",
- "rollup": "4.13.2"
+ "rollup": "4.17.2"
}
},
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-android-arm-eabi": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.2.tgz",
- "integrity": "sha512-3XFIDKWMFZrMnao1mJhnOT1h2g0169Os848NhhmGweEcfJ4rCi+3yMCOLG4zA61rbJdkcrM/DjVZm9Hg5p5w7g==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "android"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-android-arm64": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.2.tgz",
- "integrity": "sha512-GdxxXbAuM7Y/YQM9/TwwP+L0omeE/lJAR1J+olu36c3LqqZEBdsIWeQ91KBe6nxwOnb06Xh7JS2U5ooWU5/LgQ==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "android"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-darwin-arm64": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.2.tgz",
- "integrity": "sha512-mCMlpzlBgOTdaFs83I4XRr8wNPveJiJX1RLfv4hggyIVhfB5mJfN4P8Z6yKh+oE4Luz+qq1P3kVdWrCKcMYrrA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "darwin"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-darwin-x64": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.2.tgz",
- "integrity": "sha512-yUoEvnH0FBef/NbB1u6d3HNGyruAKnN74LrPAfDQL3O32e3k3OSfLrPgSJmgb3PJrBZWfPyt6m4ZhAFa2nZp2A==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "darwin"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-linux-arm-gnueabihf": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.2.tgz",
- "integrity": "sha512-GYbLs5ErswU/Xs7aGXqzc3RrdEjKdmoCrgzhJWyFL0r5fL3qd1NPcDKDowDnmcoSiGJeU68/Vy+OMUluRxPiLQ==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-linux-arm64-gnu": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.2.tgz",
- "integrity": "sha512-L1+D8/wqGnKQIlh4Zre9i4R4b4noxzH5DDciyahX4oOz62CphY7WDWqJoQ66zNR4oScLNOqQJfNSIAe/6TPUmQ==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-linux-arm64-musl": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.2.tgz",
- "integrity": "sha512-tK5eoKFkXdz6vjfkSTCupUzCo40xueTOiOO6PeEIadlNBkadH1wNOH8ILCPIl8by/Gmb5AGAeQOFeLev7iZDOA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.13.2.tgz",
- "integrity": "sha512-zvXvAUGGEYi6tYhcDmb9wlOckVbuD+7z3mzInCSTACJ4DQrdSLPNUeDIcAQW39M3q6PDquqLWu7pnO39uSMRzQ==",
- "cpu": [
- "ppc64le"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-linux-riscv64-gnu": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.2.tgz",
- "integrity": "sha512-C3GSKvMtdudHCN5HdmAMSRYR2kkhgdOfye4w0xzyii7lebVr4riCgmM6lRiSCnJn2w1Xz7ZZzHKuLrjx5620kw==",
- "cpu": [
- "riscv64"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-linux-s390x-gnu": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.13.2.tgz",
- "integrity": "sha512-l4U0KDFwzD36j7HdfJ5/TveEQ1fUTjFFQP5qIt9gBqBgu1G8/kCaq5Ok05kd5TG9F8Lltf3MoYsUMw3rNlJ0Yg==",
- "cpu": [
- "s390x"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-linux-x64-gnu": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.2.tgz",
- "integrity": "sha512-xXMLUAMzrtsvh3cZ448vbXqlUa7ZL8z0MwHp63K2IIID2+DeP5iWIT6g1SN7hg1VxPzqx0xZdiDM9l4n9LRU1A==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-linux-x64-musl": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.2.tgz",
- "integrity": "sha512-M/JYAWickafUijWPai4ehrjzVPKRCyDb1SLuO+ZyPfoXgeCEAlgPkNXewFZx0zcnoIe3ay4UjXIMdXQXOZXWqA==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-win32-arm64-msvc": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.2.tgz",
- "integrity": "sha512-2YWwoVg9KRkIKaXSh0mz3NmfurpmYoBBTAXA9qt7VXk0Xy12PoOP40EFuau+ajgALbbhi4uTj3tSG3tVseCjuA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "win32"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-win32-ia32-msvc": {
- "version": "4.13.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.2.tgz",
- "integrity": "sha512-2FSsE9aQ6OWD20E498NYKEQLneShWes0NGMPQwxWOdws35qQXH+FplabOSP5zEe1pVjurSDOGEVCE2agFwSEsw==",
- "cpu": [
- "ia32"
- ],
- "dev": true,
- "optional": true,
- "os": [
- "win32"
- ]
- },
- "examples/fdc3-chart-and-grid/js-chart/node_modules/@rollup/rollup-win32-x64-msvc": {
- "version": "4.13.2",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
- },
"examples/fdc3-chart-and-grid/js-chart/node_modules/rimraf": {
"version": "5.0.5",
"dev": true,
@@ -246,64 +52,31 @@
"url": "https://github.com/sponsors/isaacs"
}
},
- "examples/fdc3-chart-and-grid/js-chart/node_modules/rollup": {
- "version": "4.13.2",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/estree": "1.0.5"
- },
- "bin": {
- "rollup": "dist/bin/rollup"
- },
- "engines": {
- "node": ">=18.0.0",
- "npm": ">=8.0.0"
- },
- "optionalDependencies": {
- "@rollup/rollup-android-arm-eabi": "4.13.2",
- "@rollup/rollup-android-arm64": "4.13.2",
- "@rollup/rollup-darwin-arm64": "4.13.2",
- "@rollup/rollup-darwin-x64": "4.13.2",
- "@rollup/rollup-linux-arm-gnueabihf": "4.13.2",
- "@rollup/rollup-linux-arm64-gnu": "4.13.2",
- "@rollup/rollup-linux-arm64-musl": "4.13.2",
- "@rollup/rollup-linux-powerpc64le-gnu": "4.13.2",
- "@rollup/rollup-linux-riscv64-gnu": "4.13.2",
- "@rollup/rollup-linux-s390x-gnu": "4.13.2",
- "@rollup/rollup-linux-x64-gnu": "4.13.2",
- "@rollup/rollup-linux-x64-musl": "4.13.2",
- "@rollup/rollup-win32-arm64-msvc": "4.13.2",
- "@rollup/rollup-win32-ia32-msvc": "4.13.2",
- "@rollup/rollup-win32-x64-msvc": "4.13.2",
- "fsevents": "~2.3.2"
- }
- },
"examples/fdc3-chart-and-grid/js-datagrid": {
"name": "@morgan-stanley/composeui-example-grid",
"version": "0.1.0-alpha.1",
"dependencies": {
- "@angular/animations": "17.3.2",
- "@angular/cdk": "17.3.2",
- "@angular/common": "17.3.2",
- "@angular/compiler": "17.3.2",
- "@angular/core": "17.3.2",
+ "@angular/animations": "17.3.7",
+ "@angular/cdk": "17.3.6",
+ "@angular/common": "17.3.7",
+ "@angular/compiler": "17.3.7",
+ "@angular/core": "17.3.7",
"@angular/flex-layout": "^15.0.0-beta.42",
- "@angular/forms": "17.3.2",
- "@angular/material": "17.3.2",
- "@angular/platform-browser": "17.3.2",
- "@angular/platform-browser-dynamic": "17.3.2",
- "@angular/router": "17.3.2",
- "@finos/fdc3": "2.0.3",
+ "@angular/forms": "17.3.7",
+ "@angular/material": "17.3.6",
+ "@angular/platform-browser": "17.3.7",
+ "@angular/platform-browser-dynamic": "17.3.7",
+ "@angular/router": "17.3.7",
+ "@finos/fdc3": "2.1.0",
"material-icons": "1.13.12",
"rxjs": "7.8.1",
"tslib": "2.6.2",
- "zone.js": "0.14.4"
+ "zone.js": "0.14.5"
},
"devDependencies": {
- "@angular-devkit/build-angular": "17.3.2",
- "@angular/cli": "17.3.2",
- "@angular/compiler-cli": "17.3.2",
+ "@angular-devkit/build-angular": "17.3.6",
+ "@angular/cli": "17.3.6",
+ "@angular/compiler-cli": "17.3.7",
"@types/jasmine": "5.1.4",
"jasmine-core": "5.1.2",
"karma": "6.4.3",
@@ -311,19 +84,7 @@
"karma-coverage": "2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "2.1.0",
- "typescript": "5.4.3"
- }
- },
- "examples/fdc3-chart-and-grid/js-datagrid/node_modules/typescript": {
- "version": "5.4.3",
- "dev": true,
- "license": "Apache-2.0",
- "bin": {
- "tsc": "bin/tsc",
- "tsserver": "bin/tsserver"
- },
- "engines": {
- "node": ">=14.17"
+ "typescript": "5.4.5"
}
},
"examples/js-chart-and-grid-messagerouter/js-chart": {
@@ -365,27 +126,27 @@
"name": "@morgan-stanley/composeui-example-grid-messagerouter",
"version": "0.1.0-alpha.1",
"dependencies": {
- "@angular/animations": "17.3.2",
- "@angular/cdk": "17.3.2",
- "@angular/common": "17.3.2",
- "@angular/compiler": "17.3.2",
- "@angular/core": "17.3.2",
+ "@angular/animations": "17.3.7",
+ "@angular/cdk": "17.3.6",
+ "@angular/common": "17.3.7",
+ "@angular/compiler": "17.3.7",
+ "@angular/core": "17.3.7",
"@angular/flex-layout": "^15.0.0-beta.42",
- "@angular/forms": "17.3.2",
- "@angular/material": "17.3.2",
- "@angular/platform-browser": "17.3.2",
- "@angular/platform-browser-dynamic": "17.3.2",
- "@angular/router": "17.3.2",
+ "@angular/forms": "17.3.7",
+ "@angular/material": "17.3.6",
+ "@angular/platform-browser": "17.3.7",
+ "@angular/platform-browser-dynamic": "17.3.7",
+ "@angular/router": "17.3.7",
"@morgan-stanley/composeui-messaging-client": "*",
"material-icons": "1.13.12",
"rxjs": "7.8.1",
"tslib": "2.6.2",
- "zone.js": "0.14.4"
+ "zone.js": "0.14.5"
},
"devDependencies": {
- "@angular-devkit/build-angular": "17.3.2",
- "@angular/cli": "17.3.2",
- "@angular/compiler-cli": "17.3.2",
+ "@angular-devkit/build-angular": "17.3.6",
+ "@angular/cli": "17.3.6",
+ "@angular/compiler-cli": "17.3.7",
"@types/jasmine": "5.1.4",
"jasmine-core": "5.1.2",
"karma": "6.4.3",
@@ -393,19 +154,7 @@
"karma-coverage": "2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "2.1.0",
- "typescript": "5.4.3"
- }
- },
- "examples/js-chart-and-grid-messagerouter/js-datagrid/node_modules/typescript": {
- "version": "5.4.3",
- "dev": true,
- "license": "Apache-2.0",
- "bin": {
- "tsc": "bin/tsc",
- "tsserver": "bin/tsserver"
- },
- "engines": {
- "node": ">=14.17"
+ "typescript": "5.4.5"
}
},
"node_modules/@ampproject/remapping": {
@@ -422,12 +171,12 @@
}
},
"node_modules/@angular-devkit/architect": {
- "version": "0.1703.2",
- "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1703.2.tgz",
- "integrity": "sha512-fT5gSzwDHOyGv8zF97t8rjeoYSGSxXjWWstl3rN1nXdO0qgJ5m6Sv0fupON+HltdXDCBLRH+2khNpqx/Fh0Qww==",
+ "version": "0.1703.6",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1703.6.tgz",
+ "integrity": "sha512-Ck501FD/QuOjeKVFs7hU92w8+Ffetv0d5Sq09XY2/uygo5c/thMzp9nkevaIWBxUSeU5RqYZizDrhFVgYzbbOw==",
"dev": true,
"dependencies": {
- "@angular-devkit/core": "17.3.2",
+ "@angular-devkit/core": "17.3.6",
"rxjs": "7.8.1"
},
"engines": {
@@ -437,15 +186,15 @@
}
},
"node_modules/@angular-devkit/build-angular": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-17.3.2.tgz",
- "integrity": "sha512-muPCUyL0uHvRkLH4NLWiccER6P2vCm/Q5DDvqyN4XOzzY3tAHHLrKrpvY87sgd2oNJ6Ci8x7GPNcfzR5KELCnw==",
+ "version": "17.3.6",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-17.3.6.tgz",
+ "integrity": "sha512-K4CEZvhQZUUOpmXPVoI1YBM8BARbIlqE6FZRxakmnr+YOtVTYE5s+Dr1wgja8hZIohNz6L7j167G9Aut7oPU/w==",
"dev": true,
"dependencies": {
"@ampproject/remapping": "2.3.0",
- "@angular-devkit/architect": "0.1703.2",
- "@angular-devkit/build-webpack": "0.1703.2",
- "@angular-devkit/core": "17.3.2",
+ "@angular-devkit/architect": "0.1703.6",
+ "@angular-devkit/build-webpack": "0.1703.6",
+ "@angular-devkit/core": "17.3.6",
"@babel/core": "7.24.0",
"@babel/generator": "7.23.6",
"@babel/helper-annotate-as-pure": "7.22.5",
@@ -456,7 +205,7 @@
"@babel/preset-env": "7.24.0",
"@babel/runtime": "7.24.0",
"@discoveryjs/json-ext": "0.5.7",
- "@ngtools/webpack": "17.3.2",
+ "@ngtools/webpack": "17.3.6",
"@vitejs/plugin-basic-ssl": "1.1.0",
"ansi-colors": "4.1.3",
"autoprefixer": "10.4.18",
@@ -497,8 +246,8 @@
"terser": "5.29.1",
"tree-kill": "1.2.2",
"tslib": "2.6.2",
- "undici": "6.7.1",
- "vite": "5.1.5",
+ "undici": "6.11.1",
+ "vite": "5.1.7",
"watchpack": "2.4.0",
"webpack": "5.90.3",
"webpack-dev-middleware": "6.1.2",
@@ -649,12 +398,12 @@
}
},
"node_modules/@angular-devkit/build-webpack": {
- "version": "0.1703.2",
- "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1703.2.tgz",
- "integrity": "sha512-w7rVFQcZK4iTCd/MLfQWIkDkwBOfAs++txNQyS9qYID8KvLs1V+oWYd2qDBRelRv1u3YtaCIS1pQx3GFKBC3OA==",
+ "version": "0.1703.6",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1703.6.tgz",
+ "integrity": "sha512-pJu0et2SiF0kfXenHSTtAART0omzbWpLgBfeUo4hBh4uwX5IaT+mRpYpr8gCXMq+qsjoQp3HobSU3lPDeBn+bg==",
"dev": true,
"dependencies": {
- "@angular-devkit/architect": "0.1703.2",
+ "@angular-devkit/architect": "0.1703.6",
"rxjs": "7.8.1"
},
"engines": {
@@ -668,9 +417,9 @@
}
},
"node_modules/@angular-devkit/core": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-17.3.2.tgz",
- "integrity": "sha512-1vxKo9+pdSwTOwqPDSYQh84gZYmCJo6OgR5+AZoGLGMZSeqvi9RG5RiUcOMLQYOnuYv0arlhlWxz0ZjyR8ApKw==",
+ "version": "17.3.6",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-17.3.6.tgz",
+ "integrity": "sha512-FVbkT9dEwHEvjnxr4mvMNSMg2bCFoGoP4X68xXU9dhLEUpC05opLvfbaR3Qh543eCJ5AstosBFVzB/krfIkOvA==",
"dev": true,
"dependencies": {
"ajv": "8.12.0",
@@ -722,12 +471,12 @@
}
},
"node_modules/@angular-devkit/schematics": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-17.3.2.tgz",
- "integrity": "sha512-AYO6oc6QpFGigc1KiDzEVT1CeLnwvnIedU5Q/U3JDZ/Yqmvgc09D64g9XXER2kg6tV7iEgLxiYnonIAQOHq7eA==",
+ "version": "17.3.6",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-17.3.6.tgz",
+ "integrity": "sha512-2G1YuPInd8znG7uUgKOS7z72Aku50lTzB/2csWkWPJLAFkh7vKC8QZ40x8S1nC9npVYPhI5CRLX/HVpBh9CyxA==",
"dev": true,
"dependencies": {
- "@angular-devkit/core": "17.3.2",
+ "@angular-devkit/core": "17.3.6",
"jsonc-parser": "3.2.1",
"magic-string": "0.30.8",
"ora": "5.4.1",
@@ -746,9 +495,9 @@
"dev": true
},
"node_modules/@angular/animations": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-17.3.2.tgz",
- "integrity": "sha512-9RplCRS3dS7I8UeMmnwVCAxEaixQCj98UkSqjErO+GX5KJwMsFPydh7HKWH0/yclidJe5my41psEiQkyEyGKww==",
+ "version": "17.3.7",
+ "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-17.3.7.tgz",
+ "integrity": "sha512-ahenGALPPweeHgqtl9BMkGIAV4fUNI5kOWUrLNbKBfwIJN+aOBOYV1Jz6NKUQq6eYn/1ZYtm0f3lIkHIdtLKEw==",
"dependencies": {
"tslib": "^2.3.0"
},
@@ -756,13 +505,13 @@
"node": "^18.13.0 || >=20.9.0"
},
"peerDependencies": {
- "@angular/core": "17.3.2"
+ "@angular/core": "17.3.7"
}
},
"node_modules/@angular/cdk": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-17.3.2.tgz",
- "integrity": "sha512-mC2U7aoIf7RSpGgIwVyfQEbaPDDX59plQt88KeTz15wjF8vosLt2DG0rZEoV8Mq14YS47J+jI76q/LJfd6/GCw==",
+ "version": "17.3.6",
+ "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-17.3.6.tgz",
+ "integrity": "sha512-7eKrC61/6pmMAxllU/vYKadZRF7x7GxUYpA5G70fNaQsIUUiZvxx/SJN9AuZEoPGAtF6atKlJD8QVmFoDzv/Lw==",
"dependencies": {
"tslib": "^2.3.0"
},
@@ -776,15 +525,15 @@
}
},
"node_modules/@angular/cli": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-17.3.2.tgz",
- "integrity": "sha512-g6r4XZyGnh9P6GmWgaFh8RmR4L6UdQ408e3SpG3rjncuPRD57Ur8806GfCLPt6HIA9TARiKmaJ0EJ3RsIjag0g==",
+ "version": "17.3.6",
+ "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-17.3.6.tgz",
+ "integrity": "sha512-poKaRPeI+hFqX+AxIaEriaIggFVcC3XqlT9E1/uBC2rfHirE1n5F9Z7xqEDtMHduKwLbNXhQIPoKIKya8+Hnew==",
"dev": true,
"dependencies": {
- "@angular-devkit/architect": "0.1703.2",
- "@angular-devkit/core": "17.3.2",
- "@angular-devkit/schematics": "17.3.2",
- "@schematics/angular": "17.3.2",
+ "@angular-devkit/architect": "0.1703.6",
+ "@angular-devkit/core": "17.3.6",
+ "@angular-devkit/schematics": "17.3.6",
+ "@schematics/angular": "17.3.6",
"@yarnpkg/lockfile": "1.1.0",
"ansi-colors": "4.1.3",
"ini": "4.1.2",
@@ -926,9 +675,9 @@
}
},
"node_modules/@angular/common": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular/common/-/common-17.3.2.tgz",
- "integrity": "sha512-7fo+hrQEzo+VX0fJAKK+P4YNeiEnpdMOAkyIdwweyAeUZYeFIs6TKtax3CiJAubnkIkhQ/52uxiusDhK3Wg/WQ==",
+ "version": "17.3.7",
+ "resolved": "https://registry.npmjs.org/@angular/common/-/common-17.3.7.tgz",
+ "integrity": "sha512-A7LRJu1vVCGGgrfZXjU+njz50SiU4weheKCar5PIUprcdIofS1IrHAJDqYh+kwXxkjXbZMOr/ijQY0+AESLEsw==",
"dependencies": {
"tslib": "^2.3.0"
},
@@ -936,14 +685,14 @@
"node": "^18.13.0 || >=20.9.0"
},
"peerDependencies": {
- "@angular/core": "17.3.2",
+ "@angular/core": "17.3.7",
"rxjs": "^6.5.3 || ^7.4.0"
}
},
"node_modules/@angular/compiler": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-17.3.2.tgz",
- "integrity": "sha512-+/l/FQpVsOPbxZzSKyqEra+yxoI/r8LlTRqshVACv10+DKMWJMHnDkVUrNxvWHutfn4RszpGMtbtHp3yM9rxcA==",
+ "version": "17.3.7",
+ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-17.3.7.tgz",
+ "integrity": "sha512-AlKiqPoxnrpQ0hn13fIaQPSVodaVAIjBW4vpFyuKFqs2LBKg6iolwZ21s8rEI0KR2gXl+8ugj0/UZ6YADiVM5w==",
"dependencies": {
"tslib": "^2.3.0"
},
@@ -951,7 +700,7 @@
"node": "^18.13.0 || >=20.9.0"
},
"peerDependencies": {
- "@angular/core": "17.3.2"
+ "@angular/core": "17.3.7"
},
"peerDependenciesMeta": {
"@angular/core": {
@@ -960,9 +709,9 @@
}
},
"node_modules/@angular/compiler-cli": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-17.3.2.tgz",
- "integrity": "sha512-PG81BrJjeF679tkafjt+t9VEBE1rPq39cdLoBTnPY7Q+E/thVoem5JTRG6hmnLmwEc0xxY6sfYpvx2BB5ywUSA==",
+ "version": "17.3.7",
+ "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-17.3.7.tgz",
+ "integrity": "sha512-vSg5IQZ9jGmvYjpbfH8KbH4Sl1IVeE+Mr1ogcxkGEsURSRvKo7EWc0K7LSEI9+gg0VLamMiP9EyCJdPxiJeLJQ==",
"dev": true,
"dependencies": {
"@babel/core": "7.23.9",
@@ -983,7 +732,7 @@
"node": "^18.13.0 || >=20.9.0"
},
"peerDependencies": {
- "@angular/compiler": "17.3.2",
+ "@angular/compiler": "17.3.7",
"typescript": ">=5.2 <5.5"
}
},
@@ -1033,9 +782,9 @@
}
},
"node_modules/@angular/core": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular/core/-/core-17.3.2.tgz",
- "integrity": "sha512-eylatBGaN8uihKomEcXkaSHmAea5bEqu1OXifEoVOJiJpJA9Dbt/VcLXkIRFnRGH2NWUT5W79vSoU9GRvPMk5w==",
+ "version": "17.3.7",
+ "resolved": "https://registry.npmjs.org/@angular/core/-/core-17.3.7.tgz",
+ "integrity": "sha512-HWcrbxqnvIMSxFuQdN0KPt08bc87hqr0LKm89yuRTUwx/2sNJlNQUobk6aJj4trswGBttcRDT+GOS4DQP2Nr4g==",
"dependencies": {
"tslib": "^2.3.0"
},
@@ -1064,9 +813,9 @@
}
},
"node_modules/@angular/forms": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-17.3.2.tgz",
- "integrity": "sha512-sbHYjAEeEWW+02YDEKuuuTEUukm6AayQuHiAu37vACj/2q/2RWQar49IoRcSJfAwP2ckqRSK4mmLoDX4IG/KSg==",
+ "version": "17.3.7",
+ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-17.3.7.tgz",
+ "integrity": "sha512-FEhXh/VmT++XCoO8i7bBtzxG7Am/cE1zrr9aF+fWW+4jpWvJvVN1IaSiJxgBB+iPsOJ9lTBRwfRW3onlcDkhrw==",
"dependencies": {
"tslib": "^2.3.0"
},
@@ -1074,16 +823,16 @@
"node": "^18.13.0 || >=20.9.0"
},
"peerDependencies": {
- "@angular/common": "17.3.2",
- "@angular/core": "17.3.2",
- "@angular/platform-browser": "17.3.2",
+ "@angular/common": "17.3.7",
+ "@angular/core": "17.3.7",
+ "@angular/platform-browser": "17.3.7",
"rxjs": "^6.5.3 || ^7.4.0"
}
},
"node_modules/@angular/material": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular/material/-/material-17.3.2.tgz",
- "integrity": "sha512-FuQnzmVZQUqPYxn2AbRNKY/7LTldhazK+PCN+Y9vbTZ6L1INJLANip1r4iXfZnhAUE+dmFAPN6GzfLLh1Dg7vA==",
+ "version": "17.3.6",
+ "resolved": "https://registry.npmjs.org/@angular/material/-/material-17.3.6.tgz",
+ "integrity": "sha512-sttN0JNvd2QvCCFIsxb5noiy7tgQdWrwvmrkJ+3KguHh5X84jDliA/d8N7Xgy2IBLnS/q/Hl9DdRCOiItWG1bw==",
"dependencies": {
"@material/animation": "15.0.0-canary.7f224ddd4.0",
"@material/auto-init": "15.0.0-canary.7f224ddd4.0",
@@ -1136,7 +885,7 @@
},
"peerDependencies": {
"@angular/animations": "^17.0.0 || ^18.0.0",
- "@angular/cdk": "17.3.2",
+ "@angular/cdk": "17.3.6",
"@angular/common": "^17.0.0 || ^18.0.0",
"@angular/core": "^17.0.0 || ^18.0.0",
"@angular/forms": "^17.0.0 || ^18.0.0",
@@ -1145,9 +894,9 @@
}
},
"node_modules/@angular/platform-browser": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-17.3.2.tgz",
- "integrity": "sha512-rBVmpJ/uh+CTjYef3Nib1K+31GFbM4mZaw2R2PowKZLgWOT3MWXKy41i44NEyM8qY1dxESmzMzy4NuGfZol42Q==",
+ "version": "17.3.7",
+ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-17.3.7.tgz",
+ "integrity": "sha512-Nn8ZMaftAvO9dEwribWdNv+QBHhYIBrRkv85G6et80AXfXoYAr/xcfnQECRFtZgPmANqHC5auv/xrmExQG+Yeg==",
"dependencies": {
"tslib": "^2.3.0"
},
@@ -1155,9 +904,9 @@
"node": "^18.13.0 || >=20.9.0"
},
"peerDependencies": {
- "@angular/animations": "17.3.2",
- "@angular/common": "17.3.2",
- "@angular/core": "17.3.2"
+ "@angular/animations": "17.3.7",
+ "@angular/common": "17.3.7",
+ "@angular/core": "17.3.7"
},
"peerDependenciesMeta": {
"@angular/animations": {
@@ -1166,9 +915,9 @@
}
},
"node_modules/@angular/platform-browser-dynamic": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-17.3.2.tgz",
- "integrity": "sha512-fcGo9yQ+t9VaG9zPgjQW5HIizbYOKj+9kVk9FPru+uJbYyvJUwEDgpD3aI0DUrQy/OvSf4NMzY/Ucgw1AUknQw==",
+ "version": "17.3.7",
+ "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-17.3.7.tgz",
+ "integrity": "sha512-9c2I4u0L1p2v1/lW8qy+WaNHisUWbyy6wqsv2v9FfCaSM49Lxymgo9LPFPC4qEG5ei5nE+eIQ2ocRiXXsf5QkQ==",
"dependencies": {
"tslib": "^2.3.0"
},
@@ -1176,16 +925,16 @@
"node": "^18.13.0 || >=20.9.0"
},
"peerDependencies": {
- "@angular/common": "17.3.2",
- "@angular/compiler": "17.3.2",
- "@angular/core": "17.3.2",
- "@angular/platform-browser": "17.3.2"
+ "@angular/common": "17.3.7",
+ "@angular/compiler": "17.3.7",
+ "@angular/core": "17.3.7",
+ "@angular/platform-browser": "17.3.7"
}
},
"node_modules/@angular/router": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@angular/router/-/router-17.3.2.tgz",
- "integrity": "sha512-BJiaG7zldhe8FPsg3Xv1o2xsmWNMIuntubRiSt2NlSceAr/NEgHoARpZfAGKTaFSngl6jc407wHOmBBPPALECw==",
+ "version": "17.3.7",
+ "resolved": "https://registry.npmjs.org/@angular/router/-/router-17.3.7.tgz",
+ "integrity": "sha512-lMkuRrc1ZjP5JPDxNHqoAhB0uAnfPQ/q6mJrw1s8IZoVV6VyM+FxR5r13ajNcXWC38xy/YhBjpXPF1vBdxuLXg==",
"dependencies": {
"tslib": "^2.3.0"
},
@@ -1193,9 +942,9 @@
"node": "^18.13.0 || >=20.9.0"
},
"peerDependencies": {
- "@angular/common": "17.3.2",
- "@angular/core": "17.3.2",
- "@angular/platform-browser": "17.3.2",
+ "@angular/common": "17.3.7",
+ "@angular/core": "17.3.7",
+ "@angular/platform-browser": "17.3.7",
"rxjs": "^6.5.3 || ^7.4.0"
}
},
@@ -3473,9 +3222,24 @@
}
},
"node_modules/@finos/fdc3": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@finos/fdc3/-/fdc3-2.0.3.tgz",
- "integrity": "sha512-sq+iGbjU6yRl7xHhp62nB1tV4biFaHZgUAInzPTJvzXWl9xjZMmXvvbeZW6WGZaCSvjQhJPSrmWs+4z2c73T+g=="
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/@finos/fdc3/-/fdc3-2.1.0.tgz",
+ "integrity": "sha512-GYEYNlWbB2iZhOGiQ6DSYQsXx8sqwyHw6gT0cJnzqGH5+fYxgWUias//2A8XDCrPKZH9Pml/wDDH3HFhvRsvdw==",
+ "optionalDependencies": {
+ "@rollup/rollup-linux-x64-gnu": "4.14.1"
+ }
+ },
+ "node_modules/@finos/fdc3/node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.14.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.1.tgz",
+ "integrity": "sha512-9Q7DGjZN+hTdJomaQ3Iub4m6VPu1r94bmK2z3UeWP3dGUecRC54tmVu9vKHTm1bOt3ASoYtEz6JSRLFzrysKlA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
"node_modules/@hutson/parse-repository-url": {
"version": "3.0.2",
@@ -4927,9 +4691,9 @@
"link": true
},
"node_modules/@ngtools/webpack": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-17.3.2.tgz",
- "integrity": "sha512-E8zejFF4aJ8l2XcF+GgnE/1IqsZepnPT1xzulLB4LXtjVuXLFLoF9xkHQwxs7cJWWZsxd/SlNsCIcn/ezrYBcQ==",
+ "version": "17.3.6",
+ "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-17.3.6.tgz",
+ "integrity": "sha512-equxbgh2DKzZtiFMoVf1KD4yJcH1q8lpqQ/GSPPQUvONcmHrr+yqdRUdaJ7oZCyCYmXF/nByBxtMKtJr6nKZVg==",
"dev": true,
"engines": {
"node": "^18.13.0 || >=20.9.0",
@@ -5662,9 +5426,9 @@
}
},
"node_modules/@rollup/rollup-android-arm-eabi": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.1.tgz",
- "integrity": "sha512-fH8/o8nSUek8ceQnT7K4EQbSiV7jgkHq81m9lWZFIXjJ7lJzpWXbQFpT/Zh6OZYnpFykvzC3fbEvEAFZu03dPA==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.17.2.tgz",
+ "integrity": "sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==",
"cpu": [
"arm"
],
@@ -5675,9 +5439,9 @@
]
},
"node_modules/@rollup/rollup-android-arm64": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.1.tgz",
- "integrity": "sha512-Y/9OHLjzkunF+KGEoJr3heiD5X9OLa8sbT1lm0NYeKyaM3oMhhQFvPB0bNZYJwlq93j8Z6wSxh9+cyKQaxS7PQ==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.17.2.tgz",
+ "integrity": "sha512-yeX/Usk7daNIVwkq2uGoq2BYJKZY1JfyLTaHO/jaiSwi/lsf8fTFoQW/n6IdAsx5tx+iotu2zCJwz8MxI6D/Bw==",
"cpu": [
"arm64"
],
@@ -5688,9 +5452,9 @@
]
},
"node_modules/@rollup/rollup-darwin-arm64": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.1.tgz",
- "integrity": "sha512-+kecg3FY84WadgcuSVm6llrABOdQAEbNdnpi5X3UwWiFVhZIZvKgGrF7kmLguvxHNQy+UuRV66cLVl3S+Rkt+Q==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.17.2.tgz",
+ "integrity": "sha512-kcMLpE6uCwls023+kknm71ug7MZOrtXo+y5p/tsg6jltpDtgQY1Eq5sGfHcQfb+lfuKwhBmEURDga9N0ol4YPw==",
"cpu": [
"arm64"
],
@@ -5701,9 +5465,9 @@
]
},
"node_modules/@rollup/rollup-darwin-x64": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.1.tgz",
- "integrity": "sha512-2pYRzEjVqq2TB/UNv47BV/8vQiXkFGVmPFwJb+1E0IFFZbIX8/jo1olxqqMbo6xCXf8kabANhp5bzCij2tFLUA==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.17.2.tgz",
+ "integrity": "sha512-AtKwD0VEx0zWkL0ZjixEkp5tbNLzX+FCqGG1SvOu993HnSz4qDI6S4kGzubrEJAljpVkhRSlg5bzpV//E6ysTQ==",
"cpu": [
"x64"
],
@@ -5714,9 +5478,22 @@
]
},
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.1.tgz",
- "integrity": "sha512-mS6wQ6Do6/wmrF9aTFVpIJ3/IDXhg1EZcQFYHZLHqw6AzMBjTHWnCG35HxSqUNphh0EHqSM6wRTT8HsL1C0x5g==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.17.2.tgz",
+ "integrity": "sha512-3reX2fUHqN7sffBNqmEyMQVj/CKhIHZd4y631duy0hZqI8Qoqf6lTtmAKvJFYa6bhU95B1D0WgzHkmTg33In0A==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.17.2.tgz",
+ "integrity": "sha512-uSqpsp91mheRgw96xtyAGP9FW5ChctTFEoXP0r5FAzj/3ZRv3Uxjtc7taRQSaQM/q85KEKjKsZuiZM3GyUivRg==",
"cpu": [
"arm"
],
@@ -5727,9 +5504,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-gnu": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.1.tgz",
- "integrity": "sha512-p9rGKYkHdFMzhckOTFubfxgyIO1vw//7IIjBBRVzyZebWlzRLeNhqxuSaZ7kCEKVkm/kuC9fVRW9HkC/zNRG2w==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.17.2.tgz",
+ "integrity": "sha512-EMMPHkiCRtE8Wdk3Qhtciq6BndLtstqZIroHiiGzB3C5LDJmIZcSzVtLRbwuXuUft1Cnv+9fxuDtDxz3k3EW2A==",
"cpu": [
"arm64"
],
@@ -5740,9 +5517,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-musl": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.1.tgz",
- "integrity": "sha512-nDY6Yz5xS/Y4M2i9JLQd3Rofh5OR8Bn8qe3Mv/qCVpHFlwtZSBYSPaU4mrGazWkXrdQ98GB//H0BirGR/SKFSw==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.17.2.tgz",
+ "integrity": "sha512-NMPylUUZ1i0z/xJUIx6VUhISZDRT+uTWpBcjdv0/zkp7b/bQDF+NfnfdzuTiB1G6HTodgoFa93hp0O1xl+/UbA==",
"cpu": [
"arm64"
],
@@ -5753,11 +5530,11 @@
]
},
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.1.tgz",
- "integrity": "sha512-im7HE4VBL+aDswvcmfx88Mp1soqL9OBsdDBU8NqDEYtkri0qV0THhQsvZtZeNNlLeCUQ16PZyv7cqutjDF35qw==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.17.2.tgz",
+ "integrity": "sha512-T19My13y8uYXPw/L/k0JYaX1fJKFT/PWdXiHr8mTbXWxjVF1t+8Xl31DgBBvEKclw+1b00Chg0hxE2O7bTG7GQ==",
"cpu": [
- "ppc64le"
+ "ppc64"
],
"dev": true,
"optional": true,
@@ -5766,9 +5543,9 @@
]
},
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.1.tgz",
- "integrity": "sha512-RWdiHuAxWmzPJgaHJdpvUUlDz8sdQz4P2uv367T2JocdDa98iRw2UjIJ4QxSyt077mXZT2X6pKfT2iYtVEvOFw==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.17.2.tgz",
+ "integrity": "sha512-BOaNfthf3X3fOWAB+IJ9kxTgPmMqPPH5f5k2DcCsRrBIbWnaJCgX2ll77dV1TdSy9SaXTR5iDXRL8n7AnoP5cg==",
"cpu": [
"riscv64"
],
@@ -5779,9 +5556,9 @@
]
},
"node_modules/@rollup/rollup-linux-s390x-gnu": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.1.tgz",
- "integrity": "sha512-VMgaGQ5zRX6ZqV/fas65/sUGc9cPmsntq2FiGmayW9KMNfWVG/j0BAqImvU4KTeOOgYSf1F+k6at1UfNONuNjA==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.17.2.tgz",
+ "integrity": "sha512-W0UP/x7bnn3xN2eYMql2T/+wpASLE5SjObXILTMPUBDB/Fg/FxC+gX4nvCfPBCbNhz51C+HcqQp2qQ4u25ok6g==",
"cpu": [
"s390x"
],
@@ -5792,9 +5569,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.1.tgz",
- "integrity": "sha512-9Q7DGjZN+hTdJomaQ3Iub4m6VPu1r94bmK2z3UeWP3dGUecRC54tmVu9vKHTm1bOt3ASoYtEz6JSRLFzrysKlA==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.17.2.tgz",
+ "integrity": "sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==",
"cpu": [
"x64"
],
@@ -5805,9 +5582,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.1.tgz",
- "integrity": "sha512-JNEG/Ti55413SsreTguSx0LOVKX902OfXIKVg+TCXO6Gjans/k9O6ww9q3oLGjNDaTLxM+IHFMeXy/0RXL5R/g==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.17.2.tgz",
+ "integrity": "sha512-h1+yTWeYbRdAyJ/jMiVw0l6fOOm/0D1vNLui9iPuqgRGnXA0u21gAqOyB5iHjlM9MMfNOm9RHCQ7zLIzT0x11Q==",
"cpu": [
"x64"
],
@@ -5818,9 +5595,9 @@
]
},
"node_modules/@rollup/rollup-win32-arm64-msvc": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.1.tgz",
- "integrity": "sha512-ryS22I9y0mumlLNwDFYZRDFLwWh3aKaC72CWjFcFvxK0U6v/mOkM5Up1bTbCRAhv3kEIwW2ajROegCIQViUCeA==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.17.2.tgz",
+ "integrity": "sha512-tmdtXMfKAjy5+IQsVtDiCfqbynAQE/TQRpWdVataHmhMb9DCoJxp9vLcCBjEQWMiUYxO1QprH/HbY9ragCEFLA==",
"cpu": [
"arm64"
],
@@ -5831,9 +5608,9 @@
]
},
"node_modules/@rollup/rollup-win32-ia32-msvc": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.1.tgz",
- "integrity": "sha512-TdloItiGk+T0mTxKx7Hp279xy30LspMso+GzQvV2maYePMAWdmrzqSNZhUpPj3CGw12aGj57I026PgLCTu8CGg==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.17.2.tgz",
+ "integrity": "sha512-7II/QCSTAHuE5vdZaQEwJq2ZACkBpQDOmQsE6D6XUbnBHW8IAhm4eTufL6msLJorzrHDFv3CF8oCA/hSIRuZeQ==",
"cpu": [
"ia32"
],
@@ -5844,9 +5621,9 @@
]
},
"node_modules/@rollup/rollup-win32-x64-msvc": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.1.tgz",
- "integrity": "sha512-wQGI+LY/Py20zdUPq+XCem7JcPOyzIJBm3dli+56DJsQOHbnXZFEwgmnC6el1TPAfC8lBT3m+z69RmLykNUbew==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.17.2.tgz",
+ "integrity": "sha512-TGGO7v7qOq4CYmSBVEYpI1Y5xDuCEnbVC5Vth8mOsW0gDSzxNrVERPc790IGHsrT2dQSimgMr9Ub3Y1Jci5/8w==",
"cpu": [
"x64"
],
@@ -5857,13 +5634,13 @@
]
},
"node_modules/@schematics/angular": {
- "version": "17.3.2",
- "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-17.3.2.tgz",
- "integrity": "sha512-zPINvow0Qo6ionnDl25ZzSSLDyDxBjqRPEJWGHU70expbjXK4A2caQT9P/8ImhapbJAXJCfxg4GF9z1d/sWe4w==",
+ "version": "17.3.6",
+ "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-17.3.6.tgz",
+ "integrity": "sha512-jCNZdjHSVrI8TrrCnCoXC8GYvQRj7zh+SDdmm91Ve8dbikYNmBOKYLuPaCTsmojWx7ytv962yLlgKzpaa2bbfw==",
"dev": true,
"dependencies": {
- "@angular-devkit/core": "17.3.2",
- "@angular-devkit/schematics": "17.3.2",
+ "@angular-devkit/core": "17.3.6",
+ "@angular-devkit/schematics": "17.3.6",
"jsonc-parser": "3.2.1"
},
"engines": {
@@ -6499,9 +6276,9 @@
"dev": true
},
"node_modules/@types/qs": {
- "version": "6.9.14",
- "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz",
- "integrity": "sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==",
+ "version": "6.9.15",
+ "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz",
+ "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==",
"dev": true
},
"node_modules/@types/range-parser": {
@@ -11374,9 +11151,9 @@
}
},
"node_modules/ipaddr.js": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz",
- "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==",
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz",
+ "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==",
"dev": true,
"engines": {
"node": ">= 10"
@@ -17072,9 +16849,9 @@
}
},
"node_modules/rollup": {
- "version": "4.14.1",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.1.tgz",
- "integrity": "sha512-4LnHSdd3QK2pa1J6dFbfm1HN0D7vSK/ZuZTsdyUAlA6Rr1yTouUTL13HaDOGJVgby461AhrNGBS7sCGXXtT+SA==",
+ "version": "4.17.2",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.17.2.tgz",
+ "integrity": "sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==",
"dev": true,
"dependencies": {
"@types/estree": "1.0.5"
@@ -17087,21 +16864,22 @@
"npm": ">=8.0.0"
},
"optionalDependencies": {
- "@rollup/rollup-android-arm-eabi": "4.14.1",
- "@rollup/rollup-android-arm64": "4.14.1",
- "@rollup/rollup-darwin-arm64": "4.14.1",
- "@rollup/rollup-darwin-x64": "4.14.1",
- "@rollup/rollup-linux-arm-gnueabihf": "4.14.1",
- "@rollup/rollup-linux-arm64-gnu": "4.14.1",
- "@rollup/rollup-linux-arm64-musl": "4.14.1",
- "@rollup/rollup-linux-powerpc64le-gnu": "4.14.1",
- "@rollup/rollup-linux-riscv64-gnu": "4.14.1",
- "@rollup/rollup-linux-s390x-gnu": "4.14.1",
- "@rollup/rollup-linux-x64-gnu": "4.14.1",
- "@rollup/rollup-linux-x64-musl": "4.14.1",
- "@rollup/rollup-win32-arm64-msvc": "4.14.1",
- "@rollup/rollup-win32-ia32-msvc": "4.14.1",
- "@rollup/rollup-win32-x64-msvc": "4.14.1",
+ "@rollup/rollup-android-arm-eabi": "4.17.2",
+ "@rollup/rollup-android-arm64": "4.17.2",
+ "@rollup/rollup-darwin-arm64": "4.17.2",
+ "@rollup/rollup-darwin-x64": "4.17.2",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.17.2",
+ "@rollup/rollup-linux-arm-musleabihf": "4.17.2",
+ "@rollup/rollup-linux-arm64-gnu": "4.17.2",
+ "@rollup/rollup-linux-arm64-musl": "4.17.2",
+ "@rollup/rollup-linux-powerpc64le-gnu": "4.17.2",
+ "@rollup/rollup-linux-riscv64-gnu": "4.17.2",
+ "@rollup/rollup-linux-s390x-gnu": "4.17.2",
+ "@rollup/rollup-linux-x64-gnu": "4.17.2",
+ "@rollup/rollup-linux-x64-musl": "4.17.2",
+ "@rollup/rollup-win32-arm64-msvc": "4.17.2",
+ "@rollup/rollup-win32-ia32-msvc": "4.17.2",
+ "@rollup/rollup-win32-x64-msvc": "4.17.2",
"fsevents": "~2.3.2"
}
},
@@ -19062,9 +18840,9 @@
"dev": true
},
"node_modules/typescript": {
- "version": "5.4.4",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.4.tgz",
- "integrity": "sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==",
+ "version": "5.4.5",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
+ "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@@ -19111,9 +18889,9 @@
}
},
"node_modules/undici": {
- "version": "6.7.1",
- "resolved": "https://registry.npmjs.org/undici/-/undici-6.7.1.tgz",
- "integrity": "sha512-+Wtb9bAQw6HYWzCnxrPTMVEV3Q1QjYanI0E4q02ehReMuquQdLTEFEYbfs7hcImVYKcQkWSwT6buEmSVIiDDtQ==",
+ "version": "6.11.1",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-6.11.1.tgz",
+ "integrity": "sha512-KyhzaLJnV1qa3BSHdj4AZ2ndqI0QWPxYzaIOio0WzcEJB9gvuysprJSLtpvc2D9mhR9jPDUk7xlJlZbH2KR5iw==",
"dev": true,
"engines": {
"node": ">=18.0"
@@ -19374,9 +19152,9 @@
}
},
"node_modules/vite": {
- "version": "5.1.5",
- "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.5.tgz",
- "integrity": "sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==",
+ "version": "5.1.7",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.7.tgz",
+ "integrity": "sha512-sgnEEFTZYMui/sTlH1/XEnVNHMujOahPLGMxn1+5sIT45Xjng1Ec1K78jRP15dSmVgg5WBin9yO81j3o9OxofA==",
"dev": true,
"dependencies": {
"esbuild": "^0.19.3",
@@ -20558,9 +20336,9 @@
}
},
"node_modules/zone.js": {
- "version": "0.14.4",
- "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.14.4.tgz",
- "integrity": "sha512-NtTUvIlNELez7Q1DzKVIFZBzNb646boQMgpATo9z3Ftuu/gWvzxCW7jdjcUDoRGxRikrhVHB/zLXh1hxeJawvw==",
+ "version": "0.14.5",
+ "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.14.5.tgz",
+ "integrity": "sha512-9XYWZzY6PhHOSdkYryNcMm7L8EK7a4q+GbTvxbIA2a9lMdRUpGuyaYvLDcg8D6bdn+JomSsbPcilVKg6SmUx6w==",
"dependencies": {
"tslib": "^2.3.0"
}
diff --git a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Contracts/FindIntentRequest.cs b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Contracts/FindIntentRequest.cs
index e396750af..b301443de 100644
--- a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Contracts/FindIntentRequest.cs
+++ b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Contracts/FindIntentRequest.cs
@@ -22,8 +22,8 @@ namespace MorganStanley.ComposeUI.Fdc3.DesktopAgent.Contracts;
internal sealed class FindIntentRequest
{
///
- /// Unique identifier from the application which sent the RaiseIntentRequest type of message.
- /// eg.: the instanceId of the application which can be queried from the window.object.composeui.fdc3.config, if it's a webapplication.
+ /// Unique identifier from the application which sent the FindIntentRequest type of message.
+ /// eg.: the instanceId of the application which can be queried from the window.object.composeui.fdc3.config, if it's a WebApplication.
///
public string Fdc3InstanceId { get; set; }
diff --git a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Contracts/FindIntentsByContextRequest.cs b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Contracts/FindIntentsByContextRequest.cs
index 391f26374..5080915bc 100644
--- a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Contracts/FindIntentsByContextRequest.cs
+++ b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Contracts/FindIntentsByContextRequest.cs
@@ -23,7 +23,7 @@ internal sealed class FindIntentsByContextRequest
{
///
/// Unique identifier from the application which sent the FindIntentsByContextRequest type of message.
- /// eg.: the instanceId of the application which can be queried from the window.object.composeui.fdc3.config, if it's a webapplication.
+ /// eg.: the instanceId of the application which can be queried from the window.object.composeui.fdc3.config, if it's a WebApplication.
///
public string Fdc3InstanceId { get; set; }
diff --git a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Contracts/RaiseIntentRequest.cs b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Contracts/RaiseIntentRequest.cs
index 7f8643639..d02040488 100644
--- a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Contracts/RaiseIntentRequest.cs
+++ b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Contracts/RaiseIntentRequest.cs
@@ -29,7 +29,7 @@ internal sealed class RaiseIntentRequest
///
/// Unique identifier from the application which sent the RaiseIntentRequest type of message.
- /// eg.: the instanceId of the application which can be queried from the window.object.composeui.fdc3.config, if it's a webapplication.
+ /// eg.: the instanceId of the application which can be queried from the window.object.composeui.fdc3.config, if it's a WebApplication.
///
public string Fdc3InstanceId { get; set; }
@@ -52,9 +52,4 @@ internal sealed class RaiseIntentRequest
/// Information about the app that should resolve the raised intent.
///
public AppIdentifier? TargetAppIdentifier { get; set; }
-
- ///
- /// Contains error text if an error happened during executing the raiseIntent method.
- ///
- public string? Error { get; set; }
}
diff --git a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Exceptions/Fdc3DesktopAgentErrors.cs b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Exceptions/Fdc3DesktopAgentErrors.cs
index 501d6365f..29503176b 100644
--- a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Exceptions/Fdc3DesktopAgentErrors.cs
+++ b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Exceptions/Fdc3DesktopAgentErrors.cs
@@ -35,14 +35,4 @@ public static class Fdc3DesktopAgentErrors
/// Indicates that getting the IntentResult from the backend, has no appropriate attribute.
///
public const string ResponseHasNoAttribute = $"{nameof(ResponseHasNoAttribute)}";
-
- ///
- /// Indicates that could not start a module via raiseIntent, etc.
- ///
- public const string StartModuleFailure = $"{nameof(StartModuleFailure)}";
-
- ///
- /// Indicates that querying raised intent invocations does not contain an element for the intent.
- ///
- public const string MissingIntent = $"{nameof(MissingIntent)}";
}
\ No newline at end of file
diff --git a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Exceptions/ThrowHelper.cs b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Exceptions/ThrowHelper.cs
index 4eb15d89c..3b7597eb4 100644
--- a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Exceptions/ThrowHelper.cs
+++ b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Exceptions/ThrowHelper.cs
@@ -25,14 +25,8 @@ public static Fdc3DesktopAgentException MissingAppFromRaisedIntentInvocations(st
new(Fdc3DesktopAgentErrors.MissingId, $"Missing Fdc3InstanceId: {instanceId}, when module has added its intent listener and FDC3 is enabled by the application.");
public static Fdc3DesktopAgentException MultipleIntentRegisteredToAnAppInstance(string intent) =>
- new(Fdc3DesktopAgentErrors.MultipleIntent, $"Multiplpe intent were registered to the running instance. Intent: {intent}.");
+ new(Fdc3DesktopAgentErrors.MultipleIntent, $"Multiple intents were registered to the running instance. Intent: {intent}.");
public static Fdc3DesktopAgentException TargetInstanceUnavailable() =>
new(ResolveError.TargetAppUnavailable, $"Target app is unavailable when intent was raised.");
-
- public static Fdc3DesktopAgentException StartModuleFailure(Exception exception) =>
- new(Fdc3DesktopAgentErrors.StartModuleFailure, $"Could not start module when intent was raised.", exception);
-
- public static Fdc3DesktopAgentException MissingIntentForMessage(string messageId, string intent) =>
- new(Fdc3DesktopAgentErrors.MissingIntent, $"Could not found raised intent invocations for message: {messageId} with intent: {intent}");
}
\ No newline at end of file
diff --git a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Fdc3DesktopAgent.cs b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Fdc3DesktopAgent.cs
index 41297ed7d..c23ca9e50 100644
--- a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Fdc3DesktopAgent.cs
+++ b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Fdc3DesktopAgent.cs
@@ -32,6 +32,8 @@
using Icon = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.Icon;
using IntentMetadata = Finos.Fdc3.AppDirectory.IntentMetadata;
using Screenshot = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.Screenshot;
+using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol;
+using System.Collections.Generic;
namespace MorganStanley.ComposeUI.Fdc3.DesktopAgent;
@@ -70,7 +72,7 @@ public async ValueTask AddUserChannel(UserChannel userChannel)
public async Task StartAsync(CancellationToken cancellationToken)
{
var observable = _moduleLoader.LifetimeEvents.ToAsyncObservable();
- var subscription = await observable.SubscribeAsync(async (lifetimeEvent) =>
+ var subscription = await observable.SubscribeAsync(async lifetimeEvent =>
{
switch (lifetimeEvent)
{
@@ -126,24 +128,38 @@ public async ValueTask FindIntent(FindIntentRequest? request
//This function returns null, if the app could not be accepted based on the intent (required), context (optional in request), resultType (optional in request)
//else for consistency it will return a single element array containing the intentMetadata which is allowed by the request.
- Func?> selector = (fdc3App) =>
+ Func, IEnumerable?> selector = (fdc3App, _) =>
{
- if (fdc3App.Interop?.Intents?.ListensFor == null || !fdc3App.Interop.Intents.ListensFor.TryGetValue(request.Intent!, out var intentMetadata)) return null;
- if (request.Context != null && (intentMetadata.Contexts == null || !intentMetadata.Contexts.Contains(request.Context.Type)) && request.Context?.Type != ContextTypes.Nothing) return null;
- if (request.ResultType != null && (intentMetadata.ResultType == null || !intentMetadata.ResultType.Contains(request.ResultType))) return null;
- return new[] { intentMetadata };
+ if (fdc3App.Interop?.Intents?.ListensFor == null
+ || !fdc3App.Interop.Intents.ListensFor.TryGetValue(request.Intent!, out var intentMetadata))
+ {
+ return null;
+ }
+
+ if (request.Context != null
+ && (intentMetadata.Contexts == null || !intentMetadata.Contexts.Contains(request.Context.Type))
+ && request.Context?.Type != ContextTypes.Nothing)
+ {
+ return null;
+ }
+
+ if (request.ResultType != null
+ && (intentMetadata.ResultType == null || !intentMetadata.ResultType.Contains(request.ResultType)))
+ {
+ return null;
+ }
+
+ return [intentMetadata];
};
- var appIntents = await GetAppIntentsByRequest(selector, null, false);
+ var appIntents = await GetAppIntentsByRequest(selector, null);
- if (!appIntents.Any())
+ if (!appIntents.TryGetValue(request.Intent, out var appIntent))
{
return FindIntentResponse.Failure(ResolveError.NoAppsFound);
}
- return appIntents.Count > 1
- ? FindIntentResponse.Failure(ResolveError.IntentDeliveryFailed)
- : FindIntentResponse.Success(appIntents.Values.First());
+ return FindIntentResponse.Success(appIntent);
}
public async ValueTask FindIntentsByContext(FindIntentsByContextRequest? request)
@@ -155,15 +171,27 @@ public async ValueTask FindIntentsByContext(FindIn
//This function returns null, if the app could not be accepted based on the context(optional in request), resultType (optional in request)
//else for consistency it will return a collection containing the intentMetadata which is allowed by the request.
- Func?> selector = (fdc3App) =>
+ Func, IEnumerable?> selector = (fdc3App, _) =>
{
var intentMetadataCollection = new List();
if (fdc3App.Interop?.Intents?.ListensFor?.Values != null)
{
foreach (var intentMetadata in fdc3App.Interop.Intents.ListensFor.Values)
{
- if (intentMetadata.Contexts == null || !intentMetadata.Contexts.Contains(request.Context?.Type) && request.Context?.Type != ContextTypes.Nothing) continue;
- if (request.ResultType != null && (intentMetadata.ResultType == null || !intentMetadata.ResultType.Contains(request.ResultType))) continue;
+ if (intentMetadata.Contexts == null
+ || !intentMetadata.Contexts.Contains(request.Context?.Type)
+ && request.Context?.Type != ContextTypes.Nothing)
+ {
+ continue;
+ }
+
+ if (request.ResultType != null
+ && (intentMetadata.ResultType == null
+ || !intentMetadata.ResultType.Contains(request.ResultType)))
+ {
+ continue;
+ }
+
intentMetadataCollection.Add(intentMetadata);
}
}
@@ -176,7 +204,7 @@ public async ValueTask FindIntentsByContext(FindIn
return null;
};
- var appIntents = await GetAppIntentsByRequest(selector, null, false);
+ var appIntents = await GetAppIntentsByRequest(selector, null);
if (!appIntents.Any())
{
@@ -211,7 +239,6 @@ public async ValueTask GetIntentResult(GetIntentResultR
}
catch (TimeoutException)
{
-
return GetIntentResultResponse.Failure(ResolveError.IntentDeliveryFailed);
}
}
@@ -261,14 +288,15 @@ public async ValueTask> AddIntentListe
resolver.AddIntentListener(request.Intent);
var resolutions = new List();
- foreach (var raisedIntent in resolver.RaiseIntentResolutions.Where(invocation => invocation.Intent == request.Intent))
+ foreach (var raisedIntent in resolver.RaiseIntentResolutions.Where(
+ invocation => invocation.Intent == request.Intent && !invocation.IsResolved))
{
- var resolution = await RaiseIntentResolution(
- raisedIntent.RaiseIntentMessageId,
- raisedIntent.Intent,
- raisedIntent.Context,
- request.Fdc3InstanceId,
- raisedIntent.OriginFdc3InstanceId);
+ var resolution = await GetRaiseIntentResolutionMessage(
+ raisedIntent.RaiseIntentMessageId,
+ raisedIntent.Intent,
+ raisedIntent.Context,
+ request.Fdc3InstanceId,
+ raisedIntent.OriginFdc3InstanceId);
if (resolution != null)
{
@@ -282,19 +310,17 @@ public async ValueTask> AddIntentListe
RaiseIntentResolutionMessages = resolutions
};
}
- else
- {
- var createdResolver = _raisedIntentResolutions.GetOrAdd(
- new(request.Fdc3InstanceId),
- new RaisedIntentRequestHandler());
- createdResolver.AddIntentListener(request.Intent);
+ var createdResolver = _raisedIntentResolutions.GetOrAdd(
+ new(request.Fdc3InstanceId),
+ new RaisedIntentRequestHandler(_loggerFactory.CreateLogger()));
- return new()
- {
- Response = IntentListenerResponse.SubscribeSuccess(),
- };
- }
+ createdResolver.AddIntentListener(request.Intent);
+
+ return new()
+ {
+ Response = IntentListenerResponse.SubscribeSuccess(),
+ };
case SubscribeState.Unsubscribe:
@@ -326,28 +352,41 @@ public async ValueTask> RaiseIntent(Raise
};
}
- if (!string.IsNullOrEmpty(request.Error))
- {
- return new()
- {
- Response = RaiseIntentResponse.Failure(request.Error)
- };
- }
-
//This function returns null, if the app could not be accepted based on the intent (required), context (optional in request), appIdentifier (optional in request)
//else for consistency it will return a single element array containing the intentMetadata which is allowed by the request.
- Func?> selector = (fdc3App) =>
+ Func, IEnumerable?> selector = (fdc3App, appIntents) =>
{
- if (fdc3App.Interop?.Intents?.ListensFor == null || !fdc3App.Interop.Intents.ListensFor.TryGetValue(request.Intent!, out var intentMetadata)) return null;
- if (request.Context != null && (intentMetadata.Contexts == null || !intentMetadata.Contexts.Contains(request.Context.Type)) && request.Context?.Type != ContextTypes.Nothing) return null;
- if (request.TargetAppIdentifier != null && (fdc3App.AppId != request.TargetAppIdentifier.AppId)) return null;
- return new[] { intentMetadata };
+ //If the user selects an application from the AppDirectory instead of the its running instance
+ if (request.Selected && appIntents.TryGetValue(request.Intent, out var result) && result.Apps.Any())
+ {
+ return null;
+ }
+
+ if (fdc3App.Interop?.Intents?.ListensFor == null
+ || !fdc3App.Interop.Intents.ListensFor.TryGetValue(request.Intent!, out var intentMetadata))
+ {
+ return null;
+ }
+
+ if (request.Context != null
+ && (intentMetadata.Contexts == null || !intentMetadata.Contexts.Contains(request.Context.Type))
+ && request.Context?.Type != ContextTypes.Nothing)
+ {
+ return null;
+ }
+
+ if (request.TargetAppIdentifier != null && (fdc3App.AppId != request.TargetAppIdentifier.AppId))
+ {
+ return null;
+ }
+
+ return [intentMetadata];
};
- var appIntents = await GetAppIntentsByRequest(selector, request.TargetAppIdentifier, request.Selected);
+ var appIntents = await GetAppIntentsByRequest(selector, request.TargetAppIdentifier);
//No intents were found which would have the right information to handle the raised intent
- if (!appIntents.Any())
+ if (!appIntents.TryGetValue(request.Intent, out var appIntent) || !appIntent.Apps.Any())
{
return new()
{
@@ -355,18 +394,6 @@ public async ValueTask> RaiseIntent(Raise
};
}
- //Here we have used a method, which could return multiple IAppIntents to multiple intents, this is for abstracting method to findIntent, findIntentsByContext, etc.
- //Here we should get just one IAppIntent, as the intent field is required (at least fdc3.nothing)
- if (appIntents.Count > 1)
- {
- return new()
- {
- Response = RaiseIntentResponse.Failure(ResolveError.IntentDeliveryFailed)
- };
- }
-
- var appIntent = appIntents.Values.First();
-
if (appIntent.Apps.Count() == 1)
{
return await RaiseIntentToApplication(
@@ -378,7 +405,7 @@ public async ValueTask> RaiseIntent(Raise
}
//Resolve to one app via ResolverUI.
- var result = await WaitForResolverUIAsync(request.Intent, appIntent.Apps);
+ var result = await WaitForResolverUiAsync(request.Intent, appIntent.Apps);
if (result != null)
{
@@ -395,11 +422,11 @@ public async ValueTask> RaiseIntent(Raise
{
Response = RaiseIntentResponse.Failure(ResolveError.UserCancelledResolution)
};
- }
+ }
}
- //TODO: Placeholder for the right implementation of returning the choosen application from the ResolverUI.
- private async Task WaitForResolverUIAsync(string intent, IEnumerable apps)
+ //TODO: Placeholder for the right implementation of returning the chosen application from the ResolverUI.
+ private async Task WaitForResolverUiAsync(string intent, IEnumerable apps)
{
Task IsIntentListenerRegisteredAsync(AppMetadata appMetadata)
{
@@ -453,80 +480,77 @@ private async ValueTask> RaiseIntentToApp
if (registeredFdc3App.IsIntentListenerRegistered(intent))
{
- resolution = await RaiseIntentResolution(raisedIntentMessageId, intent, context, targetAppMetadata.InstanceId, sourceFdc3InstanceId);
+ resolution = await GetRaiseIntentResolutionMessage(raisedIntentMessageId, intent, context, targetAppMetadata.InstanceId, sourceFdc3InstanceId);
}
return new()
{
Response = RaiseIntentResponse.Success(raisedIntentMessageId, intent, targetAppMetadata),
RaiseIntentResolutionMessages = resolution != null
- ? new[] { resolution }
+ ? [resolution]
: Enumerable.Empty()
};
}
- else
+
+ try
{
- try
- {
- var fdc3InstanceId = Guid.NewGuid();
- var startRequest = new StartRequest(
- targetAppMetadata.AppId, //TODO: possible remove some identifier like @"fdc3."
- new List>()
- {
- { new(Fdc3StartupParameters.Fdc3InstanceId, fdc3InstanceId.ToString()) }
- });
+ var fdc3InstanceId = Guid.NewGuid();
+ var startRequest = new StartRequest(
+ targetAppMetadata.AppId, //TODO: possible remove some identifier like @"fdc3."
+ [
+ new(Fdc3StartupParameters.Fdc3InstanceId, fdc3InstanceId.ToString())
+ ]);
- var taskCompletionSource = new TaskCompletionSource();
+ var taskCompletionSource = new TaskCompletionSource();
- if (_pendingStartRequests.TryAdd(startRequest, taskCompletionSource))
+ if (_pendingStartRequests.TryAdd(startRequest, taskCompletionSource))
+ {
+ var moduleInstance = await _moduleLoader.StartModule(startRequest);
+
+ if (moduleInstance == null)
{
- var moduleInstance = await _moduleLoader.StartModule(startRequest);
+ var exception = ThrowHelper.TargetInstanceUnavailable();
- if (moduleInstance == null)
+ if (!_pendingStartRequests.TryRemove(startRequest, out _))
{
- var exception = ThrowHelper.TargetInstanceUnavailable();
-
- if (!_pendingStartRequests.TryRemove(startRequest, out _))
- {
- _logger.LogWarning($"Could not remove {nameof(StartRequest)} from the pending requests. ModuleId: {startRequest.ModuleId}.");
- }
-
- taskCompletionSource.TrySetException(exception);
+ _logger.LogWarning($"Could not remove {nameof(StartRequest)} from the pending requests. ModuleId: {startRequest.ModuleId}.");
}
- await taskCompletionSource.Task;
+ taskCompletionSource.TrySetException(exception);
}
- var raisedIntentMessageId = StoreRaisedIntentForTarget(messageId, fdc3InstanceId.ToString(), intent, context, sourceFdc3InstanceId);
+ await taskCompletionSource.Task;
+ }
- var target = new AppMetadata()
- {
- AppId = targetAppMetadata.AppId,
- InstanceId = fdc3InstanceId.ToString(),
- Name = targetAppMetadata.Name,
- Version = targetAppMetadata.Version,
- Title = targetAppMetadata.Title,
- Tooltip = targetAppMetadata.Tooltip,
- Description = targetAppMetadata.Description,
- Icons = targetAppMetadata.Icons.Select(Icon.GetIcon),
- Screenshots = targetAppMetadata.Screenshots.Select(Screenshot.GetScreenshot),
- ResultType = targetAppMetadata.ResultType
- };
+ var raisedIntentMessageId = StoreRaisedIntentForTarget(messageId, fdc3InstanceId.ToString(), intent, context, sourceFdc3InstanceId);
- return new()
- {
- Response = RaiseIntentResponse.Success(raisedIntentMessageId, intent, target)
- };
- }
- catch (Fdc3DesktopAgentException exception)
+ var target = new AppMetadata
{
- _logger.LogError(exception, "Error while starting module.");
+ AppId = targetAppMetadata.AppId,
+ InstanceId = fdc3InstanceId.ToString(),
+ Name = targetAppMetadata.Name,
+ Version = targetAppMetadata.Version,
+ Title = targetAppMetadata.Title,
+ Tooltip = targetAppMetadata.Tooltip,
+ Description = targetAppMetadata.Description,
+ Icons = targetAppMetadata.Icons.Select(Icon.GetIcon),
+ Screenshots = targetAppMetadata.Screenshots.Select(Screenshot.GetScreenshot),
+ ResultType = targetAppMetadata.ResultType
+ };
- return new()
- {
- Response = RaiseIntentResponse.Failure(exception.ToString()),
- };
- }
+ return new()
+ {
+ Response = RaiseIntentResponse.Success(raisedIntentMessageId, intent, target)
+ };
+ }
+ catch (Fdc3DesktopAgentException exception)
+ {
+ _logger.LogError(exception, "Error while starting module.");
+
+ return new()
+ {
+ Response = RaiseIntentResponse.Failure(exception.ToString()),
+ };
}
}
@@ -534,9 +558,12 @@ private async ValueTask> RaiseIntentToApp
{
RaiseIntentResolutionInvocation? resolution;
while (
- !_raisedIntentResolutions.TryGetValue(new Guid(request.TargetAppIdentifier.InstanceId!), out var resolver)
- || !resolver.TryGetRaisedIntentResult(request.MessageId, request.Intent, out resolution)
- || (resolution.ResultChannelId == null && resolution.ResultChannelType == null && resolution.ResultContext == null && resolution.ResultVoid == null))
+ !_raisedIntentResolutions.TryGetValue(new Guid(request.TargetAppIdentifier.InstanceId!), out var resolver)
+ || !resolver.TryGetRaisedIntentResult(request.MessageId, request.Intent, out resolution)
+ || (resolution.ResultChannelId == null
+ && resolution.ResultChannelType == null
+ && resolution.ResultContext == null
+ && resolution.ResultVoid == null))
{
await Task.Delay(100);
}
@@ -552,30 +579,30 @@ private string StoreRaisedIntentForTarget(
string sourceFdc3InstanceId)
{
var invocation = new RaiseIntentResolutionInvocation(
- raiseIntentMessageId: messageId,
- intent: intent,
- originFdc3InstanceId: sourceFdc3InstanceId,
- contextToHandle: context);
+ raiseIntentMessageId: messageId,
+ intent: intent,
+ originFdc3InstanceId: sourceFdc3InstanceId,
+ contextToHandle: context);
_raisedIntentResolutions.AddOrUpdate(
- new(targetFdc3InstanceId),
- _ =>
- {
- var resolver = new RaisedIntentRequestHandler();
- resolver.AddRaiseIntentToHandle(invocation);
- return resolver;
- },
- (key, oldValue) => oldValue.AddRaiseIntentToHandle(invocation));
+ new(targetFdc3InstanceId),
+ _ =>
+ {
+ var resolver = new RaisedIntentRequestHandler(_loggerFactory.CreateLogger());
+ resolver.AddRaiseIntentToHandle(invocation);
+ return resolver;
+ },
+ (key, oldValue) => oldValue.AddRaiseIntentToHandle(invocation));
return invocation.RaiseIntentMessageId;
}
- //Publishing intent resolution request to the fdc3 clients, they will receive the message and start their intenthandler appropriately, and send a store request back to the backend.
- private Task RaiseIntentResolution(string raisedIntentMessageId, string intent, Context context, string targetId, string sourceFdc3InstanceId)
+ //Publishing intent resolution request to the fdc3 clients, they will receive the message and start their IntentHandler appropriately, and send a store request back to the backend.
+ private Task GetRaiseIntentResolutionMessage(string raisedIntentMessageId, string intent, Context context, string targetId, string sourceFdc3InstanceId)
{
if (_runningModules.TryGetValue(new(sourceFdc3InstanceId), out var sourceApp))
{
- var sourceAppIdentifier = new AppIdentifier()
+ var sourceAppIdentifier = new AppIdentifier
{
AppId = sourceApp.AppId,
InstanceId = sourceFdc3InstanceId
@@ -586,11 +613,11 @@ private string StoreRaisedIntentForTarget(
{
Intent = intent,
TargetModuleInstanceId = targetId,
- Request = new RaiseIntentResolutionRequest()
+ Request = new RaiseIntentResolutionRequest
{
MessageId = raisedIntentMessageId,
Context = context,
- ContextMetadata = new ContextMetadata()
+ ContextMetadata = new ContextMetadata
{
Source = sourceAppIdentifier
}
@@ -602,20 +629,14 @@ private string StoreRaisedIntentForTarget(
}
private async Task> GetAppIntentsByRequest(
- Func?> selector,
- IAppIdentifier? targetAppIdentifier,
- bool selected)
+ Func, IEnumerable?> selector,
+ IAppIdentifier? targetAppIdentifier)
{
var appIntents = new Dictionary();
if (targetAppIdentifier?.InstanceId == null)
{
appIntents = await GetAppIntentsFromAppDirectory(selector, targetAppIdentifier, appIntents);
-
- if (selected && appIntents.Count > 0)
- {
- return appIntents;
- }
}
appIntents = GetAppIntentsFromRunningModules(selector, targetAppIdentifier, appIntents);
@@ -623,35 +644,52 @@ private async Task> GetAppIntentsByRequest(
return appIntents;
}
+
+ private async Task GetAppIntentsByRequest(
+ Action selector,
+ IAppIdentifier? targetAppIdentifier)
+ {
+ if (targetAppIdentifier?.InstanceId == null)
+ {
+ await GetAppIntentsFromAppDirectory(selector, targetAppIdentifier);
+ }
+
+ GetAppIntentsFromRunningModules(selector, targetAppIdentifier);
+ }
+
private Dictionary GetAppIntentsFromRunningModules(
- Func?> selector,
+ Func, IEnumerable?> selector,
IAppIdentifier? targetAppIdentifier,
Dictionary appIntents)
{
foreach (var app in _runningModules)
{
- if (targetAppIdentifier?.InstanceId != null
+ if (targetAppIdentifier?.InstanceId != null
&& Guid.TryParse(targetAppIdentifier.InstanceId, out var instanceId)
&& instanceId != app.Key)
{
continue;
}
- var intentMetadataCollection = selector(app.Value);
+ var intentMetadataCollection = selector(app.Value, appIntents);
if (intentMetadataCollection == null)
{
continue;
}
- appIntents = GetAppIntentsFromIntentMetadaCollection(app.Value, app.Key.ToString(), intentMetadataCollection, appIntents);
+ appIntents = GetAppIntentsFromIntentMetadataCollection(
+ app.Value,
+ app.Key.ToString(),
+ intentMetadataCollection,
+ appIntents);
}
return appIntents;
}
private async Task> GetAppIntentsFromAppDirectory(
- Func?> selector,
+ Func, IEnumerable?> selector,
IAppIdentifier? targetAppIdentifier,
Dictionary appIntents)
{
@@ -662,20 +700,20 @@ private async Task> GetAppIntentsFromAppDirectory(
continue;
}
- var intentMetadataCollection = selector(app);
+ var intentMetadataCollection = selector(app, appIntents);
if (intentMetadataCollection == null)
{
continue;
}
- appIntents = GetAppIntentsFromIntentMetadaCollection(app, null, intentMetadataCollection, appIntents);
+ appIntents = GetAppIntentsFromIntentMetadataCollection(app, null, intentMetadataCollection, appIntents);
}
return appIntents;
}
- private Dictionary GetAppIntentsFromIntentMetadaCollection(
+ private Dictionary GetAppIntentsFromIntentMetadataCollection(
Fdc3App app,
string? instanceId,
IEnumerable intentMetadataCollection,
@@ -685,6 +723,81 @@ private Dictionary GetAppIntentsFromIntentMetadaCollection(
{
var appMetadata =
new AppMetadata()
+ {
+ AppId = app.AppId,
+ InstanceId = instanceId,
+ Name = app.Name,
+ Version = app.Version,
+ Title = app.Title,
+ Tooltip = app.ToolTip,
+ Description = app.Description,
+ Icons = app.Icons == null ? Enumerable.Empty() : app.Icons.Select(Icon.GetIcon),
+ Screenshots = app.Screenshots == null
+ ? Enumerable.Empty()
+ : app.Screenshots.Select(Screenshot.GetScreenshot),
+ ResultType = intentMetadata.ResultType
+ };
+
+ if (!appIntents.TryGetValue(intentMetadata.Name, out var appIntent))
+ {
+ appIntent = new AppIntent
+ {
+ Intent = new Protocol.IntentMetadata
+ { Name = intentMetadata.Name, DisplayName = intentMetadata.DisplayName },
+ Apps = Enumerable.Empty()
+ };
+
+ appIntents.Add(intentMetadata.Name, appIntent);
+ }
+
+ appIntent.Apps = appIntent.Apps.Append(appMetadata);
+ }
+
+ return appIntents;
+ }
+
+ private async Task GetAppIntentsFromAppDirectory(
+ Action selector,
+ IAppIdentifier? targetAppIdentifier)
+ {
+ foreach (var app in await _appDirectory.GetApps())
+ {
+ if (targetAppIdentifier != null && targetAppIdentifier.AppId != app.AppId)
+ {
+ continue;
+ }
+
+ selector(app, null);
+ }
+ }
+
+ private void GetAppIntentsFromRunningModules(
+ Action selector,
+ IAppIdentifier? targetAppIdentifier)
+ {
+ foreach (var app in _runningModules)
+ {
+ if (targetAppIdentifier?.InstanceId != null
+ && Guid.TryParse(targetAppIdentifier.InstanceId, out var instanceId)
+ && instanceId != app.Key)
+ {
+ continue;
+ }
+
+ selector(app.Value, app.Key.ToString());
+ }
+ }
+
+ private Dictionary GetAppIntentsFromIntentMetadataCollection(
+ Fdc3App app,
+ string? instanceId,
+ IEnumerable intentMetadataCollection,
+ ref Dictionary appIntents)
+ {
+ foreach (var intentMetadata in intentMetadataCollection)
+ {
+ var appMetadata =
+ new AppMetadata
{
AppId = app.AppId,
InstanceId = instanceId,
@@ -695,12 +808,13 @@ private Dictionary GetAppIntentsFromIntentMetadaCollection(
Description = app.Description,
Icons = app.Icons == null ? Enumerable.Empty() : app.Icons.Select(Icon.GetIcon),
Screenshots = app.Screenshots == null ? Enumerable.Empty() : app.Screenshots.Select(Screenshot.GetScreenshot),
- ResultType = intentMetadata?.ResultType
+ ResultType = intentMetadata.ResultType
};
- if (appIntents.ContainsKey(intentMetadata!.Name))
+ // request.Intent and intentMetadata.Name should be equal: https://github.com/finos/fdc3-dotnet/blob/main/src/Fdc3.Json/Serialization/IntentsConverter.cs#L29-L32
+ if (appIntents.ContainsKey(intentMetadata.Name))
{
- appIntents[intentMetadata.Name] = new AppIntent()
+ appIntents[intentMetadata.Name] = new AppIntent
{
Intent = new Protocol.IntentMetadata { Name = intentMetadata.Name, DisplayName = intentMetadata.DisplayName },
Apps = appIntents[intentMetadata.Name].Apps.Append(appMetadata)
@@ -710,10 +824,10 @@ private Dictionary GetAppIntentsFromIntentMetadaCollection(
{
appIntents.Add(
intentMetadata.Name,
- new AppIntent()
+ new AppIntent
{
Intent = new Protocol.IntentMetadata { Name = intentMetadata.Name, DisplayName = intentMetadata.DisplayName },
- Apps = new List() { appMetadata }
+ Apps = new List { appMetadata }
});
}
}
@@ -723,10 +837,10 @@ private Dictionary GetAppIntentsFromIntentMetadaCollection(
private Task RemoveModuleAsync(IModuleInstance instance)
{
- try
+ var fdc3InstanceId = GetFdc3InstanceId(instance);
+
+ if (fdc3InstanceId != null)
{
- var fdc3InstanceId = GetFdc3InstanceId(instance);
-
if (!_runningModules.TryRemove(new(fdc3InstanceId), out _))
{
_logger.LogError($"Could not remove the closed window with instanceId: {fdc3InstanceId}.");
@@ -737,10 +851,6 @@ private Task RemoveModuleAsync(IModuleInstance instance)
taskCompletionSource.SetException(ThrowHelper.TargetInstanceUnavailable());
}
}
- catch (Fdc3DesktopAgentException exception)
- {
- _logger.LogError(exception, $"Exception thrown while removing module: {instance.Manifest.Id}, {instance.Manifest.Name} from running instances in FDC3DesktopAgent.");
- }
return Task.CompletedTask;
}
@@ -757,9 +867,9 @@ private async Task AddOrUpdateModuleAsync(IModuleInstance instance)
taskCompletionSource.SetResult(instance);
}
}
- catch (AppNotFoundException)
+ catch (AppNotFoundException exception)
{
- _logger.LogError($"Could not retrieve app: {instance.Manifest.Id} from AppDirectory.");
+ _logger.LogError(exception, $"Could not retrieve app: {instance.Manifest.Id} from AppDirectory.");
return;
}
@@ -767,8 +877,8 @@ private async Task AddOrUpdateModuleAsync(IModuleInstance instance)
//TODO: should add some identifier to the query => "fdc3:" + instance.Manifest.Id
_runningModules.GetOrAdd(
- new(fdc3InstanceId),
- _ => fdc3App);
+ new(fdc3InstanceId),
+ _ => fdc3App);
}
private bool IsFdc3StartedModule(IModuleInstance instance, out string instanceId)
@@ -785,14 +895,14 @@ private bool IsFdc3StartedModule(IModuleInstance instance, out string instanceId
return true;
}
- private string GetFdc3InstanceId(IModuleInstance instance)
+ private string? GetFdc3InstanceId(IModuleInstance instance)
{
if (!IsFdc3StartedModule(instance, out var fdc3InstanceId))
{
- var startupProperties = instance.GetProperties().FirstOrDefault(p => p is Fdc3StartupProperties);
+ var startupProperties = instance.GetProperties().FirstOrDefault(property => property is Fdc3StartupProperties);
return startupProperties == null
- ? throw ThrowHelper.MissingFdc3InstanceId(instance.Manifest.Id)
+ ? null
: ((Fdc3StartupProperties) startupProperties).InstanceId;
}
diff --git a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Infrastructure/Internal/Fdc3DesktopAgentMessageRouterService.cs b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Infrastructure/Internal/Fdc3DesktopAgentMessageRouterService.cs
index d0379b053..fdba69c2f 100644
--- a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Infrastructure/Internal/Fdc3DesktopAgentMessageRouterService.cs
+++ b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Infrastructure/Internal/Fdc3DesktopAgentMessageRouterService.cs
@@ -73,9 +73,9 @@ public async ValueTask HandleAddUserChannel(string id)
internal ValueTask HandleFindChannel(FindChannelRequest? request, MessageContext context)
{
return ValueTask.FromResult(
- _desktopAgent.FindChannel(request!.ChannelId, request!.ChannelType)
- ? FindChannelResponse.Success
- : FindChannelResponse.Failure(ChannelError.NoChannelFound));
+ _desktopAgent.FindChannel(request!.ChannelId, request!.ChannelType)
+ ? FindChannelResponse.Success
+ : FindChannelResponse.Failure(ChannelError.NoChannelFound));
}
internal async ValueTask HandleFindIntent(FindIntentRequest? request, MessageContext context)
@@ -90,25 +90,18 @@ public async ValueTask HandleAddUserChannel(string id)
internal async ValueTask HandleRaiseIntent(RaiseIntentRequest? request, MessageContext context)
{
- try
+ var result = await _desktopAgent.RaiseIntent(request);
+ if (result.RaiseIntentResolutionMessages.Any())
{
- var result = await _desktopAgent.RaiseIntent(request);
- if (result.RaiseIntentResolutionMessages.Any())
+ foreach (var message in result.RaiseIntentResolutionMessages)
{
- foreach (var message in result.RaiseIntentResolutionMessages)
- {
- await _messageRouter.PublishAsync(
- Fdc3Topic.RaiseIntentResolution(message.Intent, message.TargetModuleInstanceId),
- MessageBuffer.Factory.CreateJson(message.Request, _jsonSerializerOptions));
- }
+ await _messageRouter.PublishAsync(
+ Fdc3Topic.RaiseIntentResolution(message.Intent, message.TargetModuleInstanceId),
+ MessageBuffer.Factory.CreateJson(message.Request, _jsonSerializerOptions));
}
-
- return result.Response;
- }
- catch (Fdc3DesktopAgentException)
- {
- throw;
}
+
+ return result.Response;
}
internal async ValueTask HandleAddIntentListener(IntentListenerRequest? request, MessageContext context)
@@ -186,13 +179,13 @@ public async Task StopAsync(CancellationToken cancellationToken)
{
var unregisteringTasks = new ValueTask[]
{
- _messageRouter.UnregisterServiceAsync(Fdc3Topic.FindChannel, cancellationToken),
- _messageRouter.UnregisterServiceAsync(Fdc3Topic.FindIntent, cancellationToken),
- _messageRouter.UnregisterServiceAsync(Fdc3Topic.RaiseIntent, cancellationToken),
- _messageRouter.UnregisterServiceAsync(Fdc3Topic.FindIntentsByContext, cancellationToken),
- _messageRouter.UnregisterServiceAsync(Fdc3Topic.GetIntentResult, cancellationToken),
- _messageRouter.UnregisterServiceAsync(Fdc3Topic.SendIntentResult, cancellationToken),
- _messageRouter.UnregisterServiceAsync(Fdc3Topic.AddIntentListener, cancellationToken)
+ _messageRouter.UnregisterServiceAsync(Fdc3Topic.FindChannel, cancellationToken),
+ _messageRouter.UnregisterServiceAsync(Fdc3Topic.FindIntent, cancellationToken),
+ _messageRouter.UnregisterServiceAsync(Fdc3Topic.RaiseIntent, cancellationToken),
+ _messageRouter.UnregisterServiceAsync(Fdc3Topic.FindIntentsByContext, cancellationToken),
+ _messageRouter.UnregisterServiceAsync(Fdc3Topic.GetIntentResult, cancellationToken),
+ _messageRouter.UnregisterServiceAsync(Fdc3Topic.SendIntentResult, cancellationToken),
+ _messageRouter.UnregisterServiceAsync(Fdc3Topic.AddIntentListener, cancellationToken)
};
await SafeWaitAsync(unregisteringTasks);
diff --git a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Infrastructure/Internal/RaiseIntentResolutionInvocation.cs b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Infrastructure/Internal/RaiseIntentResolutionInvocation.cs
index 11c276cd4..fe226b6bc 100644
--- a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Infrastructure/Internal/RaiseIntentResolutionInvocation.cs
+++ b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Infrastructure/Internal/RaiseIntentResolutionInvocation.cs
@@ -50,4 +50,5 @@ public RaiseIntentResolutionInvocation(
public ChannelType? ResultChannelType { get; set; }
public bool? ResultVoid { get; set; }
public string? ResultError { get; set; }
+ public bool IsResolved { get; set; } = false;
}
diff --git a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Infrastructure/Internal/RaisedIntentRequestHandler.cs b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Infrastructure/Internal/RaisedIntentRequestHandler.cs
index 488b6deca..de1d35023 100644
--- a/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Infrastructure/Internal/RaisedIntentRequestHandler.cs
+++ b/src/fdc3/dotnet/DesktopAgent/src/DesktopAgent/Infrastructure/Internal/RaisedIntentRequestHandler.cs
@@ -15,6 +15,8 @@
using Finos.Fdc3.Context;
using Finos.Fdc3;
using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Exceptions;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging.Abstractions;
namespace MorganStanley.ComposeUI.Fdc3.DesktopAgent.Infrastructure.Internal;
@@ -24,13 +26,28 @@ internal class RaisedIntentRequestHandler
private readonly object _raiseIntentInvocationsLock = new();
private readonly List _registeredIntentListeners = new();
private readonly List _raiseIntentResolutions = new();
+ private readonly ILogger _logger;
+
public IEnumerable IntentListeners => _registeredIntentListeners;
public IEnumerable RaiseIntentResolutions => _raiseIntentResolutions;
+ public RaisedIntentRequestHandler(ILogger? logger = null)
+ {
+ _logger = logger ?? NullLogger.Instance;
+ }
+
public RaisedIntentRequestHandler AddIntentListener(string intent)
{
lock (_intentListenersLock)
{
+ if (_registeredIntentListeners.Contains(intent))
+ {
+ if (_logger.IsEnabled(LogLevel.Warning))
+ {
+ _logger.LogWarning($"Multiple IntentHandlers are registered to the intent: {intent}.");
+ }
+ }
+
_registeredIntentListeners.Add(intent);
return this;
}
@@ -84,6 +101,7 @@ public RaisedIntentRequestHandler AddIntentResult(
raisedIntentInvocation.ResultContext = context;
raisedIntentInvocation.ResultVoid = voidResult;
raisedIntentInvocation.ResultError = error;
+ raisedIntentInvocation.IsResolved = true;
}
else if (raisedIntentInvocations.Count() > 1)
{
@@ -98,7 +116,11 @@ public bool TryGetRaisedIntentResult(string messageId, string intent, out RaiseI
{
lock (_raiseIntentInvocationsLock)
{
- var raiseIntentInvocations = _raiseIntentResolutions.Where(raiseIntentInvocation => raiseIntentInvocation.RaiseIntentMessageId == messageId && raiseIntentInvocation.Intent == intent);
+ var raiseIntentInvocations = _raiseIntentResolutions.Where(raiseIntentInvocation =>
+ raiseIntentInvocation.RaiseIntentMessageId == messageId
+ && raiseIntentInvocation.Intent == intent
+ && raiseIntentInvocation.IsResolved);
+
if (raiseIntentInvocations.Any())
{
if (raiseIntentInvocations.Count() > 1)
diff --git a/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/EndToEndTests.cs b/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/EndToEndTests.cs
index d64c8db65..5ef088fc7 100644
--- a/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/EndToEndTests.cs
+++ b/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/EndToEndTests.cs
@@ -14,973 +14,960 @@
using System.Text.Json;
+using Finos.Fdc3;
+using Finos.Fdc3.Context;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Contracts;
-using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Converters;
using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Exceptions;
+using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Infrastructure.Internal;
using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Tests.Helpers;
using MorganStanley.ComposeUI.Messaging.Client.WebSocket;
using MorganStanley.ComposeUI.ModuleLoader;
-using Finos.Fdc3;
-using Finos.Fdc3.Context;
-using AppMetadata = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppMetadata;
-using AppIntent = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppIntent;
using AppIdentifier = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppIdentifier;
-using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Infrastructure.Internal;
+using AppIntent = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppIntent;
+using AppMetadata = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppMetadata;
+using IntentMetadata = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.IntentMetadata;
-namespace MorganStanley.ComposeUI.Fdc3.DesktopAgent.Tests
+namespace MorganStanley.ComposeUI.Fdc3.DesktopAgent.Tests;
+
+public class EndToEndTests : IAsyncLifetime
{
- public class EndToEndTests : IAsyncLifetime
- {
- private IHost _host;
- private IMessageRouter _messageRouter;
- private ServiceProvider _clientServices;
- private readonly Uri _webSocketUri = new("ws://localhost:7098/ws");
- private const string TestChannel = "testChannel";
- private readonly UserChannelTopics _topics = new UserChannelTopics(TestChannel);
- private const string AccessToken = "token";
- private JsonSerializerOptions _options;
- private IModuleLoader _moduleLoader;
- private readonly object _runningAppsLock = new();
- private IDisposable _runningAppsObserver;
- private readonly List _runningApps = new();
-
- public async Task InitializeAsync()
- {
- // Create the backend side
- IHostBuilder builder = new HostBuilder();
- builder.ConfigureServices(
- services =>
- {
- services.AddMessageRouterServer(
- s => s.UseWebSockets(
- opt =>
- {
- opt.RootPath = _webSocketUri.AbsolutePath;
- opt.Port = _webSocketUri.Port;
- }));
- services.AddMessageRouter(mr => mr.UseServer());
-
- services.AddFdc3AppDirectory(
- _ => _.Source = new Uri($"file:\\\\{Directory.GetCurrentDirectory()}\\TestUtils\\appDirectorySample.json"));
-
- services.AddModuleLoader();
-
- services.AddFdc3DesktopAgent(
- fdc3 => fdc3.Configure(
- builder =>
- {
- builder.ChannelId = TestChannel;
- }));
- });
+ private const string TestChannel = "testChannel";
+ private const string AccessToken = "token";
+ private readonly List _runningApps = new();
+ private readonly object _runningAppsLock = new();
+ private readonly UserChannelTopics _topics = new(TestChannel);
+ private readonly Uri _webSocketUri = new("ws://localhost:7098/ws");
+ private ServiceProvider _clientServices;
+
+ private int _counter;
+ private IHost _host;
+ private IMessageRouter _messageRouter;
+ private IModuleLoader _moduleLoader;
+ private JsonSerializerOptions _options;
+ private IDisposable _runningAppsObserver;
+
+ private MessageBuffer EmptyContextType => MessageBuffer.Factory.CreateJson(new GetCurrentContextRequest());
- _host = builder.Build();
- await _host.StartAsync();
+ private MessageBuffer ContextType =>
+ MessageBuffer.Factory.CreateJson(new GetCurrentContextRequest {ContextType = new Contact().Type});
- // Create a client acting in place of an application
- _clientServices = new ServiceCollection()
- .AddMessageRouter(
- mr => mr.UseWebSocket(
- new MessageRouterWebSocketOptions
+ private MessageBuffer OtherContextType =>
+ MessageBuffer.Factory.CreateJson(new GetCurrentContextRequest {ContextType = new Email(null).Type});
+
+ private MessageBuffer FindRequest => MessageBuffer.Factory.CreateJson(
+ new FindChannelRequest {ChannelId = TestChannel, ChannelType = ChannelType.User});
+
+ private MessageBuffer FindNonExistingRequest => MessageBuffer.Factory.CreateJson(
+ new FindChannelRequest {ChannelId = "nonexisting", ChannelType = ChannelType.User});
+
+ public async Task InitializeAsync()
+ {
+ // Create the backend side
+ IHostBuilder builder = new HostBuilder();
+ builder.ConfigureServices(
+ services =>
+ {
+ services.AddMessageRouterServer(
+ s => s.UseWebSockets(
+ opt =>
{
- Uri = _webSocketUri
- }))
- .BuildServiceProvider();
-
- _messageRouter = _clientServices.GetRequiredService();
-
- _moduleLoader = _host.Services.GetRequiredService();
-
- _runningAppsObserver = _moduleLoader.LifetimeEvents.Subscribe((lifetimeEvent) =>
- {
- lock (_runningAppsLock)
- {
- switch (lifetimeEvent.EventType)
- {
- case LifetimeEventType.Started:
- _runningApps.Add(lifetimeEvent.Instance);
- break;
-
- case LifetimeEventType.Stopped:
- _runningApps.Remove(lifetimeEvent.Instance);
- break;
- }
- }
- });
-
- var fdc3DesktopAgentMessageRouterService = _host.Services.GetRequiredService() as Fdc3DesktopAgentMessageRouterService;
- _options = fdc3DesktopAgentMessageRouterService!.JsonMessageSerializerOptions;
- }
+ opt.RootPath = _webSocketUri.AbsolutePath;
+ opt.Port = _webSocketUri.Port;
+ }));
+ services.AddMessageRouter(mr => mr.UseServer());
+
+ services.AddFdc3AppDirectory(
+ _ => _.Source = new Uri(
+ $"file:\\\\{Directory.GetCurrentDirectory()}\\TestUtils\\appDirectorySample.json"));
+
+ services.AddModuleLoader();
+
+ services.AddFdc3DesktopAgent(
+ fdc3 => fdc3.Configure(
+ builder => { builder.ChannelId = TestChannel; }));
+ });
+
+ _host = builder.Build();
+ await _host.StartAsync();
+
+ // Create a client acting in place of an application
+ _clientServices = new ServiceCollection()
+ .AddMessageRouter(
+ mr => mr.UseWebSocket(
+ new MessageRouterWebSocketOptions
+ {
+ Uri = _webSocketUri
+ }))
+ .BuildServiceProvider();
- public async Task DisposeAsync()
- {
- List runningApps;
- _runningAppsObserver?.Dispose();
- lock (_runningAppsLock)
- {
- runningApps = _runningApps.Reverse().ToList();
- }
- foreach (var instance in runningApps)
+ _messageRouter = _clientServices.GetRequiredService();
+
+ _moduleLoader = _host.Services.GetRequiredService();
+
+ _runningAppsObserver = _moduleLoader.LifetimeEvents.Subscribe(
+ lifetimeEvent =>
{
- await _moduleLoader.StopModule(new StopRequest(instance.InstanceId));
- }
- await _clientServices.DisposeAsync();
- await _host.StopAsync();
- _host.Dispose();
- }
+ lock (_runningAppsLock)
+ {
+ switch (lifetimeEvent.EventType)
+ {
+ case LifetimeEventType.Started:
+ _runningApps.Add(lifetimeEvent.Instance);
+ break;
- [Fact]
- public async void GetCurrentContextReturnsNullBeforeBroadcast()
+ case LifetimeEventType.Stopped:
+ _runningApps.Remove(lifetimeEvent.Instance);
+ break;
+ }
+ }
+ });
+
+ var fdc3DesktopAgentMessageRouterService =
+ _host.Services.GetRequiredService() as Fdc3DesktopAgentMessageRouterService;
+ _options = fdc3DesktopAgentMessageRouterService!.JsonMessageSerializerOptions;
+ }
+
+ public async Task DisposeAsync()
+ {
+ List runningApps;
+ _runningAppsObserver?.Dispose();
+ lock (_runningAppsLock)
{
- var resultBuffer = await _messageRouter.InvokeAsync(_topics.GetCurrentContext, EmptyContextType);
- resultBuffer.Should().BeNull();
+ runningApps = _runningApps.Reverse().ToList();
}
- [Fact]
- public async void GetCurrentContextReturnsAfterBroadcast()
+ foreach (var instance in runningApps)
{
- var ctx = GetContext();
+ await _moduleLoader.StopModule(new StopRequest(instance.InstanceId));
+ }
- await _messageRouter.PublishAsync(_topics.Broadcast, ctx);
+ await _clientServices.DisposeAsync();
+ await _host.StopAsync();
+ _host.Dispose();
+ }
+
+ [Fact]
+ public async void GetCurrentContextReturnsNullBeforeBroadcast()
+ {
+ var resultBuffer = await _messageRouter.InvokeAsync(_topics.GetCurrentContext, EmptyContextType);
+ resultBuffer.Should().BeNull();
+ }
- await Task.Delay(100);
+ [Fact]
+ public async void GetCurrentContextReturnsAfterBroadcast()
+ {
+ var ctx = GetContext();
- var resultBuffer = await _messageRouter.InvokeAsync(_topics.GetCurrentContext, ContextType);
+ await _messageRouter.PublishAsync(_topics.Broadcast, ctx);
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson();
+ await Task.Delay(100);
- result.Should().BeEquivalentTo(ctx.ReadJson());
- }
+ var resultBuffer = await _messageRouter.InvokeAsync(_topics.GetCurrentContext, ContextType);
- [Fact]
- public async void GetCurrentContextReturnsAfterBroadcastWithNoType()
- {
- var ctx = GetContext();
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson();
- await _messageRouter.PublishAsync(_topics.Broadcast, ctx);
+ result.Should().BeEquivalentTo(ctx.ReadJson());
+ }
- await Task.Delay(100);
+ [Fact]
+ public async void GetCurrentContextReturnsAfterBroadcastWithNoType()
+ {
+ var ctx = GetContext();
- var resultBuffer = await _messageRouter.InvokeAsync(_topics.GetCurrentContext, EmptyContextType);
+ await _messageRouter.PublishAsync(_topics.Broadcast, ctx);
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson();
+ await Task.Delay(100);
- result.Should().BeEquivalentTo(ctx.ReadJson());
- }
+ var resultBuffer = await _messageRouter.InvokeAsync(_topics.GetCurrentContext, EmptyContextType);
- [Fact]
- public async void DifferentGetCurrentContextReturnsNullAfterBroadcast()
- {
- var ctx = GetContext();
- await _messageRouter.PublishAsync(_topics.Broadcast, ctx);
- await Task.Delay(100);
- var resultBuffer = await _messageRouter.InvokeAsync(_topics.GetCurrentContext, OtherContextType);
- resultBuffer.Should().BeNull();
- }
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson();
- [Fact]
- public async void FindUserChannelReturnsFoundTrueForExistingChannel()
- {
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindChannel, FindRequest);
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().BeEquivalentTo(FindChannelResponse.Success);
- }
+ result.Should().BeEquivalentTo(ctx.ReadJson());
+ }
- [Fact]
- public async void FindUserChannelReturnsNoChannelFoundForNonExistingChannel()
- {
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindChannel, FindNonExistingRequest);
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().BeEquivalentTo(FindChannelResponse.Failure(ChannelError.NoChannelFound));
- }
+ [Fact]
+ public async void DifferentGetCurrentContextReturnsNullAfterBroadcast()
+ {
+ var ctx = GetContext();
+ await _messageRouter.PublishAsync(_topics.Broadcast, ctx);
+ await Task.Delay(100);
+ var resultBuffer = await _messageRouter.InvokeAsync(_topics.GetCurrentContext, OtherContextType);
+ resultBuffer.Should().BeNull();
+ }
- [Fact]
- public async Task FindIntentReturnsAppIntent()
- {
- //TODO: should add some identifier to the query => "fdc3:" + instance.Manifest.Id
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ [Fact]
+ public async void FindUserChannelReturnsFoundTrueForExistingChannel()
+ {
+ var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindChannel, FindRequest);
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().BeEquivalentTo(FindChannelResponse.Success);
+ }
- var appId4IntentMetadata = new Protocol.IntentMetadata() { Name = "intentMetadata4", DisplayName = "displayName4" };
+ [Fact]
+ public async void FindUserChannelReturnsNoChannelFoundForNonExistingChannel()
+ {
+ var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindChannel, FindNonExistingRequest);
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().BeEquivalentTo(FindChannelResponse.Failure(ChannelError.NoChannelFound));
+ }
- var request = new FindIntentRequest()
- {
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "intentMetadata4"
- };
+ [Fact]
+ public async Task FindIntentReturnsAppIntent()
+ {
+ //TODO: should add some identifier to the query => "fdc3:" + instance.Manifest.Id
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
- var expectedResponse = new FindIntentResponse()
- {
- AppIntent = new AppIntent()
- {
- Intent = appId4IntentMetadata,
- Apps = new AppMetadata[]
- {
- new() { AppId = "appId4", Name = "app4", ResultType = null },
- new() { AppId = "appId5", Name = "app5", ResultType = "resultType" },
- new() { AppId = "appId6", Name = "app6", ResultType = "resultType" }
- }
- }
- };
+ var appId4IntentMetadata = new IntentMetadata {Name = "intentMetadata4", DisplayName = "displayName4"};
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindIntent, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
- result.Should().BeEquivalentTo(expectedResponse);
- }
+ var request = new FindIntentRequest
+ {
+ Fdc3InstanceId = originFdc3InstanceId,
+ Intent = "intentMetadata4"
+ };
- [Fact]
- public async Task FindIntentReturnsIntentDeliveryFailureBecauseOfTheRequest()
+ var expectedResponse = new FindIntentResponse
{
- var expectedResponse = new FindIntentResponse()
+ AppIntent = new AppIntent
{
- Error = ResolveError.IntentDeliveryFailed
- };
-
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindIntent, null);
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
- result.Should().BeEquivalentTo(expectedResponse);
- }
+ Intent = appId4IntentMetadata,
+ Apps = new AppMetadata[]
+ {
+ new() {AppId = "appId4", Name = "app4", ResultType = null},
+ new() {AppId = "appId5", Name = "app5", ResultType = "resultType"},
+ new() {AppId = "appId6", Name = "app6", ResultType = "resultType"}
+ }
+ }
+ };
+
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.FindIntent,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().NotBeNull();
+ result.Should().BeEquivalentTo(expectedResponse);
+ }
- [Fact]
- public async Task FindIntentReturnsNoAppsFound()
+ [Fact]
+ public async Task FindIntentReturnsIntentDeliveryFailureBecauseOfTheRequest()
+ {
+ var expectedResponse = new FindIntentResponse
{
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ Error = ResolveError.IntentDeliveryFailed
+ };
- var request = new FindIntentRequest()
- {
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "noAppShouldReturnIntent",
- };
+ var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindIntent);
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().NotBeNull();
+ result.Should().BeEquivalentTo(expectedResponse);
+ }
- var expectedResponse = new FindIntentResponse()
- {
- Error = ResolveError.NoAppsFound
- };
-
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindIntent, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
- result.Should().BeEquivalentTo(expectedResponse);
- }
+ [Fact]
+ public async Task FindIntentReturnsNoAppsFound()
+ {
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
- [Fact]
- public async Task FindIntentReturnsIntentDeliveryFailureBecauseOfMultipleAppIntentFound()
+ var request = new FindIntentRequest
{
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ Fdc3InstanceId = originFdc3InstanceId,
+ Intent = "noAppShouldReturnIntent"
+ };
- var request = new FindIntentRequest()
- {
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "intentMetadata8"
- };
+ var expectedResponse = new FindIntentResponse
+ {
+ Error = ResolveError.NoAppsFound
+ };
- var expectedResponse = new FindIntentResponse()
- {
- Error = ResolveError.IntentDeliveryFailed
- };
-
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindIntent, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
- result.Should().BeEquivalentTo(expectedResponse);
- }
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.FindIntent,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().NotBeNull();
+ result.Should().BeEquivalentTo(expectedResponse);
+ }
- [Fact]
- public async Task FindIntentsByContextReturnsAppIntent()
- {
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ [Fact]
+ public async Task FindIntentsByContextReturnsAppIntent()
+ {
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
- var request = new FindIntentsByContextRequest()
- {
- Fdc3InstanceId = originFdc3InstanceId,
- Context = new Context("context2"),
- ResultType = "resultType"
- };
+ var request = new FindIntentsByContextRequest
+ {
+ Fdc3InstanceId = originFdc3InstanceId,
+ Context = new Context("context2"),
+ ResultType = "resultType"
+ };
- var appId5IntentMetadata = new Protocol.IntentMetadata() { Name = "intentMetadata4", DisplayName = "displayName4" };
+ var appId5IntentMetadata = new IntentMetadata {Name = "intentMetadata4", DisplayName = "displayName4"};
- var expectedResponse = new FindIntentsByContextResponse()
+ var expectedResponse = new FindIntentsByContextResponse
+ {
+ AppIntents = new AppIntent[]
{
- AppIntents = new AppIntent[]
+ new()
{
- new()
+ Intent = appId5IntentMetadata,
+ Apps = new AppMetadata[]
{
- Intent = appId5IntentMetadata,
- Apps = new AppMetadata[]
- {
- new() { AppId = "appId5", Name = "app5", ResultType = "resultType" },
- new() { AppId = "appId6", Name = "app6", ResultType = "resultType" }
- }
+ new() {AppId = "appId5", Name = "app5", ResultType = "resultType"},
+ new() {AppId = "appId6", Name = "app6", ResultType = "resultType"}
}
}
- };
+ }
+ };
+
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.FindIntentsByContext,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().NotBeNull();
+ result.Should().BeEquivalentTo(expectedResponse);
+ }
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindIntentsByContext, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
- result.Should().BeEquivalentTo(expectedResponse);
- }
+ [Fact]
+ public async Task FindIntentsByContextReturnsMultipleAppIntents()
+ {
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
- [Fact]
- public async Task FindIntentsByContextReturnsMultipleAppIntent()
+ var request = new FindIntentsByContextRequest
{
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ Fdc3InstanceId = originFdc3InstanceId,
+ Context = new Context("context9"),
+ ResultType = "resultWrongApp"
+ };
- var request = new FindIntentsByContextRequest()
- {
- Fdc3InstanceId = originFdc3InstanceId,
- Context = new Context("context9"),
- ResultType = "resultWrongApp"
- };
-
- var appId9IntentMetadata = new Protocol.IntentMetadata() { Name = "intentMetadata9", DisplayName = "displayName9" };
- var appId12IntentMetadata = new Protocol.IntentMetadata() { Name = "intentMetadata11", DisplayName = "displayName11" };
- var expectedResponse = new FindIntentsByContextResponse()
+ var appId9IntentMetadata = new IntentMetadata {Name = "intentMetadata9", DisplayName = "displayName9"};
+ var appId12IntentMetadata = new IntentMetadata {Name = "intentMetadata11", DisplayName = "displayName11"};
+ var expectedResponse = new FindIntentsByContextResponse
+ {
+ AppIntents = new[]
{
- AppIntents = new[]
+ new AppIntent
+ {
+ Intent = appId9IntentMetadata,
+ Apps = new[]
{
- new AppIntent()
- {
- Intent = appId9IntentMetadata,
- Apps = new []
- {
- new AppMetadata() { AppId = "wrongappId9", Name = "app9", ResultType = "resultWrongApp" },
- }
- },
- new AppIntent()
- {
- Intent = appId12IntentMetadata,
- Apps = new []
- {
- new AppMetadata(){ AppId = "appId12", Name = "app12", ResultType = "resultWrongApp" },
- }
- }
+ new AppMetadata {AppId = "wrongappId9", Name = "app9", ResultType = "resultWrongApp"}
}
- };
-
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindIntentsByContext, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
- result.Should().BeEquivalentTo(expectedResponse);
- }
-
- [Fact]
- public async Task FindIntentsByContextReturnsIntentDeliveryFailureBecauseOfTheRequest()
- {
- var expectedResponse = new FindIntentsByContextResponse()
- {
- Error = ResolveError.IntentDeliveryFailed
- };
-
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindIntentsByContext, null);
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
- result.Should().BeEquivalentTo(expectedResponse);
- }
+ },
+ new AppIntent
+ {
+ Intent = appId12IntentMetadata,
+ Apps = new[]
+ {
+ new AppMetadata {AppId = "appId12", Name = "app12", ResultType = "resultWrongApp"}
+ }
+ }
+ }
+ };
+
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.FindIntentsByContext,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().NotBeNull();
+ result.Should().BeEquivalentTo(expectedResponse);
+ }
- [Fact]
- public async Task FindIntentsByContextReturnsNoAppsFound()
+ [Fact]
+ public async Task FindIntentsByContextReturnsIntentDeliveryFailureBecauseOfTheRequest()
+ {
+ var expectedResponse = new FindIntentsByContextResponse
{
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ Error = ResolveError.IntentDeliveryFailed
+ };
- var request = new FindIntentsByContextRequest()
- {
- Fdc3InstanceId = originFdc3InstanceId,
- Context = new Context("context2"),
- ResultType = "noAppShouldReturn"
- };
-
- var expectedResponse = new FindIntentsByContextResponse()
- {
- Error = ResolveError.NoAppsFound
- };
-
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindIntentsByContext, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
- result.Should().BeEquivalentTo(expectedResponse);
- }
+ var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.FindIntentsByContext);
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().NotBeNull();
+ result.Should().BeEquivalentTo(expectedResponse);
+ }
- [Fact]
- public async Task RaiseIntentReturnsIntentDeliveryFailureBecauseOfTheRequest()
- {
- var expectedResponse = new RaiseIntentResponse()
- {
- Error = ResolveError.IntentDeliveryFailed
- };
-
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.RaiseIntent, null);
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
- result.Should().BeEquivalentTo(expectedResponse);
- }
+ [Fact]
+ public async Task FindIntentsByContextReturnsNoAppsFound()
+ {
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
- [Fact]
- public async Task RaiseIntentReturnsErrorAsMessageContainsError()
+ var request = new FindIntentsByContextRequest
{
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
-
- var request = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "dummy",
- Selected = false,
- Context = new Context(ContextTypes.Nothing),
- Error = "dummyError"
- };
+ Fdc3InstanceId = originFdc3InstanceId,
+ Context = new Context("context2"),
+ ResultType = "noAppShouldReturn"
+ };
- var expectedResponse = new RaiseIntentResponse()
- {
- Error = "dummyError"
- };
-
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.RaiseIntent, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
- result.Should().BeEquivalentTo(expectedResponse);
- }
-
- [Fact]
- public async Task RaiseIntentReturnsNoAppsFound()
+ var expectedResponse = new FindIntentsByContextResponse
{
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ Error = ResolveError.NoAppsFound
+ };
- var request = new RaiseIntentRequest()
- {
- MessageId = 2,
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "noIntentShouldHandle",
- Selected = false,
- Context = new Context(ContextTypes.Nothing)
- };
-
- var expectedResponse = new RaiseIntentResponse()
- {
- Error = ResolveError.NoAppsFound
- };
-
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.RaiseIntent, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
- result.Should().BeEquivalentTo(expectedResponse);
- }
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.FindIntentsByContext,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().NotBeNull();
+ result.Should().BeEquivalentTo(expectedResponse);
+ }
- [Fact]
- public async Task RaiseIntentReturnsIntentDeliveryFailureAsMultipleAppIntentFound()
+ [Fact]
+ public async Task RaiseIntentReturnsIntentDeliveryFailureBecauseOfTheRequest()
+ {
+ var expectedResponse = new RaiseIntentResponse
{
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ Error = ResolveError.IntentDeliveryFailed
+ };
- var request = new RaiseIntentRequest()
- {
- MessageId = 2,
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "intentMetadata8", //wrongly set up AppDirectory on purpose
- Selected = false,
- Context = new Context(ContextTypes.Nothing)
- };
+ var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.RaiseIntent);
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().NotBeNull();
+ result.Should().BeEquivalentTo(expectedResponse);
+ }
- var expectedResponse = new RaiseIntentResponse()
- {
- Error = ResolveError.IntentDeliveryFailed
- };
-
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.RaiseIntent, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
- result.Should().BeEquivalentTo(expectedResponse);
- }
+ [Fact]
+ public async Task RaiseIntentReturnsNoAppsFound()
+ {
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+
+ var request = new RaiseIntentRequest
+ {
+ MessageId = 2,
+ Fdc3InstanceId = originFdc3InstanceId,
+ Intent = "noIntentShouldHandle",
+ Selected = false,
+ Context = new Context(ContextTypes.Nothing)
+ };
+
+ var expectedResponse = new RaiseIntentResponse
+ {
+ Error = ResolveError.NoAppsFound
+ };
+
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.RaiseIntent,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().NotBeNull();
+ result.Should().BeEquivalentTo(expectedResponse);
+ }
- [Fact]
- public async Task RaiseIntentReturnsAppIntentWithOneApp()
- {
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ [Fact]
+ public async Task RaiseIntentReturnsAppIntentWithOneApp()
+ {
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+
+ var request = new RaiseIntentRequest
+ {
+ MessageId = 2,
+ Fdc3InstanceId = originFdc3InstanceId,
+ Intent = "intentMetadataCustom",
+ Selected = false,
+ Context = new Context("contextCustom")
+ };
+
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.RaiseIntent,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ var app4 = _runningApps.First(application => application.Manifest.Id == "appId4");
+ var app4Fdc3InstanceId = Fdc3InstanceIdRetriever.Get(app4);
+ app4Fdc3InstanceId.Should()
+ .Be(resultBuffer!.ReadJson(_options)!.AppMetadata!.First().InstanceId);
+ app4Fdc3InstanceId.Should().NotBeNull();
+
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().NotBeNull();
+
+ var expectedResponse = new RaiseIntentResponse
+ {
+ MessageId = result!.MessageId,
+ Intent = "intentMetadataCustom",
+ AppMetadata = new AppMetadata[]
+ {
+ new() {AppId = "appId4", InstanceId = app4Fdc3InstanceId, Name = "app4", ResultType = null}
+ }
+ };
- var request = new RaiseIntentRequest()
- {
- MessageId = 2,
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "intentMetadataCustom",
- Selected = false,
- Context = new Context("contextCustom")
- };
+ result.Should().BeEquivalentTo(expectedResponse);
+ }
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.RaiseIntent, MessageBuffer.Factory.CreateJson(request, _options));
- var app4 = _runningApps.First(application => application.Manifest.Id == "appId4");
- var app4Fdc3InstanceId = Fdc3InstanceIdRetriever.Get(app4);
- app4Fdc3InstanceId.Should().Be(resultBuffer!.ReadJson(_options)!.AppMetadata!.First().InstanceId);
- app4Fdc3InstanceId.Should().NotBeNull();
+ [Fact]
+ public async Task RaiseIntentReturnsAppIntentWithOneExistingAppAndPublishesContextToHandle()
+ {
+ var origin = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var target = await _moduleLoader.StartModule(new StartRequest("appId4"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(origin);
+ var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
+
+ var addIntentListenerRequest =
+ MessageBuffer.Factory.CreateJson(
+ new IntentListenerRequest
+ {
+ Intent = "intentMetadataCustom",
+ Fdc3InstanceId = targetFdc3InstanceId,
+ State = SubscribeState.Subscribe
+ },
+ _options);
+
+ var addIntentListenerResult = await _messageRouter.InvokeAsync(
+ Fdc3Topic.AddIntentListener,
+ addIntentListenerRequest);
+ addIntentListenerResult.Should().NotBeNull();
+ addIntentListenerResult!.ReadJson(_options)
+ .Should()
+ .BeEquivalentTo(IntentListenerResponse.SubscribeSuccess());
+
+ var request = new RaiseIntentRequest
+ {
+ MessageId = 2,
+ Fdc3InstanceId = originFdc3InstanceId,
+ Intent = "intentMetadataCustom",
+ Selected = false,
+ Context = new Context("contextCustom"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
+ };
+
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.RaiseIntent,
+ MessageBuffer.Factory.CreateJson(request, _options));
+
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().NotBeNull();
+
+ var expectedResponse = new RaiseIntentResponse
+ {
+ MessageId = result!.MessageId,
+ Intent = "intentMetadataCustom",
+ AppMetadata = new AppMetadata[]
+ {
+ new() {AppId = "appId4", InstanceId = targetFdc3InstanceId, Name = "app4", ResultType = null}
+ }
+ };
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
+ result.Should().BeEquivalentTo(expectedResponse);
+ }
- var expectedResponse = new RaiseIntentResponse()
- {
- MessageId = result!.MessageId,
- Intent = "intentMetadataCustom",
- AppMetadata = new AppMetadata[]
+ //TODO: Right now we are returning just one element, without the possibility of selecting via ResolverUI.
+ [Fact]
+ public async Task RaiseIntentReturnsAppIntentWithFirstApp()
+ {
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+
+ var request = new RaiseIntentRequest
+ {
+ MessageId = 2,
+ Fdc3InstanceId = originFdc3InstanceId,
+ Intent = "intentMetadata4",
+ Selected = false,
+ Context = new Context("context2")
+ };
+
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.RaiseIntent,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result.Should().NotBeNull();
+
+ var app4 = _runningApps.First(application => application.Manifest.Id == "appId4");
+ var app4Fdc3InstanceId = Fdc3InstanceIdRetriever.Get(app4);
+
+ result!.AppMetadata.Should()
+ .BeEquivalentTo(
+ new AppMetadata[]
{
- new(){ AppId = "appId4", InstanceId = app4Fdc3InstanceId, Name = "app4", ResultType = null }
- }
- };
-
- result.Should().BeEquivalentTo(expectedResponse);
- }
+ new() {AppId = "appId4", InstanceId = app4Fdc3InstanceId, Name = "app4", ResultType = null}
+ });
+ }
- [Fact]
- public async Task RaiseIntentReturnsAppIntentWithOneExistingAppAndPublishesContextToHandle()
+ [Fact]
+ public async Task StoreIntentResultReturnsIntentDeliveryFailureAsRequestIsNull()
+ {
+ var expectedResponse = new StoreIntentResultResponse
{
- var origin = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var target = await _moduleLoader.StartModule(new StartRequest("appId4"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(origin);
- var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
-
- var addIntentListenerRequest =
- MessageBuffer.Factory.CreateJson(
- new IntentListenerRequest()
- {
- Intent = "intentMetadataCustom",
- Fdc3InstanceId = targetFdc3InstanceId,
- State = SubscribeState.Subscribe
- },
- _options);
-
- var addIntentListenerResult = await _messageRouter.InvokeAsync(Fdc3Topic.AddIntentListener, addIntentListenerRequest);
- addIntentListenerResult.Should().NotBeNull();
- addIntentListenerResult!.ReadJson(_options).Should().BeEquivalentTo(IntentListenerResponse.SubscribeSuccess());
-
- var request = new RaiseIntentRequest()
- {
- MessageId = 2,
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "intentMetadataCustom",
- Selected = false,
- Context = new Context("contextCustom"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
- };
+ Error = ResolveError.IntentDeliveryFailed
+ };
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.RaiseIntent, MessageBuffer.Factory.CreateJson(request, _options));
-
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
+ var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.SendIntentResult);
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result!.Should().BeEquivalentTo(expectedResponse);
+ }
- var expectedResponse = new RaiseIntentResponse()
- {
- MessageId = result!.MessageId,
- Intent = "intentMetadataCustom",
- AppMetadata = new AppMetadata[]
- {
- new() { AppId = "appId4", InstanceId = targetFdc3InstanceId, Name = "app4", ResultType = null }
- }
- };
+ [Fact]
+ public async Task StoreIntentResultReturnsIntentDeliveryFailureAsRequestNotContainsInformation()
+ {
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
- result.Should().BeEquivalentTo(expectedResponse);
- }
+ var request = new StoreIntentResultRequest
+ {
+ MessageId = string.Empty,
+ Intent = "dummyIntent",
+ OriginFdc3InstanceId = originFdc3InstanceId,
+ TargetFdc3InstanceId = null
+ };
- //TODO: Right now we are returning just one element, without the possibility of selecting via ResolverUI.
- [Fact]
- public async Task RaiseIntentReturnsAppIntentWithFirstApp()
+ var expectedResponse = new StoreIntentResultResponse
{
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ Error = ResolveError.IntentDeliveryFailed
+ };
- var request = new RaiseIntentRequest()
- {
- MessageId = 2,
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "intentMetadata4",
- Selected = false,
- Context = new Context("context2")
- };
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.SendIntentResult,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result!.Should().BeEquivalentTo(expectedResponse);
+ }
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.RaiseIntent, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result.Should().NotBeNull();
+ [Fact]
+ public async Task StoreIntentResultReturnsSuccessfully()
+ {
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = 2,
+ Fdc3InstanceId = originFdc3InstanceId,
+ Intent = "intentMetadataCustom",
+ Selected = false,
+ Context = new Context("contextCustom")
+ };
+
+ var raiseIntentResultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.RaiseIntent,
+ MessageBuffer.Factory.CreateJson(raiseIntentRequest, _options));
+ raiseIntentResultBuffer.Should().NotBeNull();
+ var raiseIntentResult = raiseIntentResultBuffer!.ReadJson(_options);
+ raiseIntentResult!.AppMetadata.Should().HaveCount(1);
+ raiseIntentResult.AppMetadata!.First().InstanceId.Should().NotBeNull();
+
+ var testContext = new Context("testContextType");
+
+ var request = new StoreIntentResultRequest
+ {
+ MessageId = raiseIntentResult.MessageId!,
+ Intent = "intentMetadataCustom",
+ OriginFdc3InstanceId = raiseIntentResult.AppMetadata!.First().InstanceId!,
+ TargetFdc3InstanceId = originFdc3InstanceId,
+ Context = testContext
+ };
+
+ var expectedResponse = new StoreIntentResultResponse
+ {
+ Stored = true
+ };
+
+ var app4 = _runningApps.First(application => application.Manifest.Id == "appId4");
+ var app4Fdc3InstanceId = Fdc3InstanceIdRetriever.Get(app4);
+ app4Fdc3InstanceId.Should().Be(raiseIntentResult!.AppMetadata!.First().InstanceId);
+
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.SendIntentResult,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result!.Should().BeEquivalentTo(expectedResponse);
+ }
- var app4 = _runningApps.First(application => application.Manifest.Id == "appId4");
- var app4Fdc3InstanceId = Fdc3InstanceIdRetriever.Get(app4);
+ [Fact]
+ public async Task GetIntentResultReturnsIntentDeliveryFailureAsRequestIsNull()
+ {
+ var expectedResponse = new GetIntentResultResponse
+ {
+ Error = ResolveError.IntentDeliveryFailed
+ };
- result!.AppMetadata.Should().BeEquivalentTo(
- new AppMetadata[]
- {
- new() { AppId = "appId4", InstanceId = app4Fdc3InstanceId, Name = "app4", ResultType = null }
- });
- }
+ var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.GetIntentResult);
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result!.Should().BeEquivalentTo(expectedResponse);
+ }
- [Fact]
- public async Task StoreIntentResultReturnsIntentDeliveryFailureAsRequestIsNull()
+ [Fact]
+ public async Task GetIntentResultReturnsIntentDeliveryFailureAsRequestDoesNotContainInformation()
+ {
+ var request = new GetIntentResultRequest
{
- var expectedResponse = new StoreIntentResultResponse()
- {
- Error = ResolveError.IntentDeliveryFailed
- };
-
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.SendIntentResult, null);
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result!.Should().BeEquivalentTo(expectedResponse);
- }
+ MessageId = "dummy",
+ Intent = "dummy",
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId1"}
+ };
- [Fact]
- public async Task StoreIntentResultReturnsIntentDeliveryFailureAsRequestNotContainsInformation()
+ var expectedResponse = new GetIntentResultResponse
{
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ Error = ResolveError.IntentDeliveryFailed
+ };
- var request = new StoreIntentResultRequest()
- {
- MessageId = string.Empty,
- Intent = "dummyIntent",
- OriginFdc3InstanceId = originFdc3InstanceId,
- TargetFdc3InstanceId = null
- };
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.GetIntentResult,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result!.Should().BeEquivalentTo(expectedResponse);
+ }
- var expectedResponse = new StoreIntentResultResponse()
- {
- Error = ResolveError.IntentDeliveryFailed
- };
+ [Fact]
+ public async Task GetIntentResultReturnsIntentDeliveryFailureAsNoIntentResultFound()
+ {
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.SendIntentResult, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result!.Should().BeEquivalentTo(expectedResponse);
- }
+ var request = new GetIntentResultRequest
+ {
+ MessageId = "dummy",
+ Intent = "testIntent",
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId1", InstanceId = originFdc3InstanceId}
+ };
- [Fact]
- public async Task StoreIntentResultReturnsSuccessfully()
+ var expectedResponse = new GetIntentResultResponse
{
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ Error = ResolveError.IntentDeliveryFailed
+ };
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = 2,
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "intentMetadataCustom",
- Selected = false,
- Context = new Context("contextCustom")
- };
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.GetIntentResult,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result!.Should().BeEquivalentTo(expectedResponse);
+ }
- var raiseIntentResultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.RaiseIntent, MessageBuffer.Factory.CreateJson(raiseIntentRequest, _options));
- raiseIntentResultBuffer.Should().NotBeNull();
- var raiseIntentResult = raiseIntentResultBuffer!.ReadJson(_options);
- raiseIntentResult!.AppMetadata.Should().HaveCount(1);
- raiseIntentResult.AppMetadata!.First().InstanceId.Should().NotBeNull();
+ [Fact]
+ public async Task GetIntentResultReturnsSuccessfully()
+ {
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
- var testContext = new Context("testContextType");
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = 2,
+ Fdc3InstanceId = originFdc3InstanceId,
+ Intent = "intentMetadataCustom",
+ Selected = false,
+ Context = new Context("contextCustom")
+ };
- var request = new StoreIntentResultRequest()
- {
- MessageId = raiseIntentResult.MessageId!,
- Intent = "intentMetadataCustom",
- OriginFdc3InstanceId = raiseIntentResult.AppMetadata!.First().InstanceId!,
- TargetFdc3InstanceId = originFdc3InstanceId,
- Context = testContext
- };
+ var resultRaiseIntentBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.RaiseIntent,
+ MessageBuffer.Factory.CreateJson(raiseIntentRequest, _options));
+ var raiseIntentResult = resultRaiseIntentBuffer!.ReadJson(_options);
- var expectedResponse = new StoreIntentResultResponse()
- {
- Stored = true
- };
+ var testContext = new Context("testContextType");
- var app4 = _runningApps.First(application => application.Manifest.Id == "appId4");
- var app4Fdc3InstanceId = Fdc3InstanceIdRetriever.Get(app4);
- app4Fdc3InstanceId.Should().Be(raiseIntentResult!.AppMetadata!.First().InstanceId);
+ var storeIntentRequest = new StoreIntentResultRequest
+ {
+ MessageId = raiseIntentResult!.MessageId!,
+ Intent = "intentMetadataCustom",
+ OriginFdc3InstanceId = raiseIntentResult!.AppMetadata!.First().InstanceId!,
+ TargetFdc3InstanceId = originFdc3InstanceId,
+ Context = testContext
+ };
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.SendIntentResult, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result!.Should().BeEquivalentTo(expectedResponse);
- }
+ await _messageRouter.InvokeAsync(
+ Fdc3Topic.SendIntentResult,
+ MessageBuffer.Factory.CreateJson(storeIntentRequest, _options));
- [Fact]
- public async Task GetIntentResultReturnsIntentDeliveryFailureAsRequestIsNull()
+ var request = new GetIntentResultRequest
{
- var expectedResponse = new GetIntentResultResponse()
- {
- Error = ResolveError.IntentDeliveryFailed
- };
+ MessageId = raiseIntentResult!.MessageId!,
+ Intent = "intentMetadataCustom",
+ TargetAppIdentifier = new AppIdentifier
+ {AppId = "appId4", InstanceId = raiseIntentResult!.AppMetadata!.First().InstanceId!}
+ };
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.GetIntentResult, null);
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result!.Should().BeEquivalentTo(expectedResponse);
- }
-
- [Fact]
- public async Task GetIntentResultReturnsIntentDeliveryFailureAsRequestDoesNotContainInformation()
+ var expectedResponse = new GetIntentResultResponse
{
- var request = new GetIntentResultRequest()
- {
- MessageId = "dummy",
- Intent = "dummy",
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId1" }
- };
+ Context = testContext
+ };
- var expectedResponse = new GetIntentResultResponse()
- {
- Error = ResolveError.IntentDeliveryFailed
- };
+ var app4 = _runningApps.First(application => application.Manifest.Id == "appId4");
+ var app4Fdc3InstanceId = Fdc3InstanceIdRetriever.Get(app4);
+ app4Fdc3InstanceId.Should().Be(raiseIntentResult!.AppMetadata!.First().InstanceId);
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.GetIntentResult, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result!.Should().BeEquivalentTo(expectedResponse);
- }
-
- [Fact]
- public async Task GetIntentResultReturnsIntentDeliveryFailureAsNoIntentResultFound()
- {
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ var resultBuffer = await _messageRouter.InvokeAsync(
+ Fdc3Topic.GetIntentResult,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ resultBuffer.Should().NotBeNull();
+ var result = resultBuffer!.ReadJson(_options);
+ result!.Should().BeEquivalentTo(expectedResponse);
+ }
- var request = new GetIntentResultRequest()
- {
- MessageId = "dummy",
- Intent = "testIntent",
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId1", InstanceId = originFdc3InstanceId }
- };
+ [Fact]
+ public async Task AddIntentListenerReturnsPayloadNullError()
+ {
+ var result = await _messageRouter.InvokeAsync(Fdc3Topic.AddIntentListener);
+ result.Should().NotBeNull();
+ result!.ReadJson(_options)
+ .Should()
+ .BeEquivalentTo(IntentListenerResponse.Failure(Fdc3DesktopAgentErrors.PayloadNull));
+ }
- var expectedResponse = new GetIntentResultResponse()
- {
- Error = ResolveError.IntentDeliveryFailed
- };
+ [Fact]
+ public async Task AddIntentListenerReturnsMissingIdError()
+ {
+ var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ var request = new IntentListenerRequest
+ {Intent = "dummy", Fdc3InstanceId = originFdc3InstanceId, State = SubscribeState.Unsubscribe};
+ var expectedResponse = await _messageRouter.InvokeAsync(
+ Fdc3Topic.AddIntentListener,
+ MessageBuffer.Factory.CreateJson(request, _options));
+ expectedResponse.Should().NotBeNull();
+ expectedResponse!.ReadJson(_options)
+ .Should()
+ .BeEquivalentTo(IntentListenerResponse.Failure(Fdc3DesktopAgentErrors.MissingId));
+ }
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.GetIntentResult, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result!.Should().BeEquivalentTo(expectedResponse);
- }
+ [Fact]
+ public async Task AddIntentListenerSubscribesWithExistingAppPerRaisedIntent()
+ {
+ //TODO: should add some identifier to the query => "fdc3:" + instance.Manifest.Id
+ var origin = await _moduleLoader.StartModule(new StartRequest("appId1"));
+ var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(origin);
- [Fact]
- public async Task GetIntentResultReturnsSuccessfully()
- {
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
+ //TODO: should add some identifier to the query => "fdc3:" + instance.Manifest.Id
+ var target = await _moduleLoader.StartModule(new StartRequest("appId4"));
+ var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var raiseIntentRequest = new RaiseIntentRequest()
+ var raiseIntentRequest = MessageBuffer.Factory.CreateJson(
+ new RaiseIntentRequest
{
- MessageId = 2,
+ MessageId = 1,
Fdc3InstanceId = originFdc3InstanceId,
Intent = "intentMetadataCustom",
Selected = false,
- Context = new Context("contextCustom")
- };
+ Context = new Context("contextCustom"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
+ },
+ _options);
- var resultRaiseIntentBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.RaiseIntent, MessageBuffer.Factory.CreateJson(raiseIntentRequest, _options));
- var raiseIntentResult = resultRaiseIntentBuffer!.ReadJson(_options);
+ var raiseIntentResult = await _messageRouter.InvokeAsync(Fdc3Topic.RaiseIntent, raiseIntentRequest);
- var testContext = new Context("testContextType");
+ raiseIntentResult.Should().NotBeNull();
+ var raiseIntentResponse = raiseIntentResult!.ReadJson(_options)!;
+ raiseIntentResponse.AppMetadata.Should().HaveCount(1);
+ raiseIntentResponse.AppMetadata!.First()!.AppId.Should().Be("appId4");
- var storeIntentRequest = new StoreIntentResultRequest()
+ var addIntentListenerRequest = MessageBuffer.Factory.CreateJson(
+ new IntentListenerRequest
{
- MessageId = raiseIntentResult!.MessageId!,
Intent = "intentMetadataCustom",
- OriginFdc3InstanceId = raiseIntentResult!.AppMetadata!.First().InstanceId!,
- TargetFdc3InstanceId = originFdc3InstanceId,
- Context = testContext
- };
+ Fdc3InstanceId = targetFdc3InstanceId,
+ State = SubscribeState.Subscribe
+ },
+ _options);
+
+ var addIntentListenerResult = await _messageRouter.InvokeAsync(
+ Fdc3Topic.AddIntentListener,
+ addIntentListenerRequest);
+ addIntentListenerResult.Should().NotBeNull();
+
+ var addIntentListenerResponse = addIntentListenerResult!.ReadJson(_options);
+ addIntentListenerResponse!.Stored.Should().BeTrue();
+
+ var app4 = _runningApps.First(application => application.Manifest.Id == "appId4");
+ var app4Fdc3InstanceId = Fdc3InstanceIdRetriever.Get(app4);
+ app4Fdc3InstanceId.Should()
+ .Be(raiseIntentResult!.ReadJson(_options)!.AppMetadata!.First().InstanceId);
+ }
- await _messageRouter.InvokeAsync(Fdc3Topic.SendIntentResult, MessageBuffer.Factory.CreateJson(storeIntentRequest, _options));
+ [Fact]
+ public async Task AddIntentListenerSubscribesWithNewApp()
+ {
+ //TODO: should add some identifier to the query => "fdc3:" + instance.Manifest.Id
+ var target = await _moduleLoader.StartModule(new StartRequest("appId4"));
+ var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var request = new GetIntentResultRequest()
+ var addIntentListenerRequest = MessageBuffer.Factory.CreateJson(
+ new IntentListenerRequest
{
- MessageId = raiseIntentResult!.MessageId!,
Intent = "intentMetadataCustom",
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = raiseIntentResult!.AppMetadata!.First().InstanceId! }
- };
-
- var expectedResponse = new GetIntentResultResponse()
- {
- Context = testContext
- };
-
- var app4 = _runningApps.First(application => application.Manifest.Id == "appId4");
- var app4Fdc3InstanceId = Fdc3InstanceIdRetriever.Get(app4);
- app4Fdc3InstanceId.Should().Be(raiseIntentResult!.AppMetadata!.First().InstanceId);
-
- var resultBuffer = await _messageRouter.InvokeAsync(Fdc3Topic.GetIntentResult, MessageBuffer.Factory.CreateJson(request, _options));
- resultBuffer.Should().NotBeNull();
- var result = resultBuffer!.ReadJson(_options);
- result!.Should().BeEquivalentTo(expectedResponse);
- }
-
- [Fact]
- public async Task AddIntentListenerReturnsPayloadNullError()
- {
- var result = await _messageRouter.InvokeAsync(Fdc3Topic.AddIntentListener, null, new());
- result.Should().NotBeNull();
- result!.ReadJson(_options).Should().BeEquivalentTo(IntentListenerResponse.Failure(Fdc3DesktopAgentErrors.PayloadNull));
- }
-
- [Fact]
- public async Task AddIntentListenerReturnsMissingIdError()
- {
- var instance = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
- var request = new IntentListenerRequest() { Intent = "dummy", Fdc3InstanceId = originFdc3InstanceId, State = SubscribeState.Unsubscribe };
- var expectedResponse = await _messageRouter.InvokeAsync(Fdc3Topic.AddIntentListener, MessageBuffer.Factory.CreateJson(request, _options));
- expectedResponse.Should().NotBeNull();
- expectedResponse!.ReadJson(_options).Should().BeEquivalentTo(IntentListenerResponse.Failure(Fdc3DesktopAgentErrors.MissingId));
- }
-
- [Fact]
- public async Task AddIntentListenerSubscribesWithExistingAppPerRaisedIntent()
- {
- //TODO: should add some identifier to the query => "fdc3:" + instance.Manifest.Id
- var origin = await _moduleLoader.StartModule(new StartRequest("appId1"));
- var originFdc3InstanceId = Fdc3InstanceIdRetriever.Get(origin);
-
- //TODO: should add some identifier to the query => "fdc3:" + instance.Manifest.Id
- var target = await _moduleLoader.StartModule(new StartRequest("appId4"));
- var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
-
- var raiseIntentRequest = MessageBuffer.Factory.CreateJson(
- new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "intentMetadataCustom",
- Selected = false,
- Context = new Context("contextCustom"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
- }, _options);
-
- var raiseIntentResult = await _messageRouter.InvokeAsync(Fdc3Topic.RaiseIntent, raiseIntentRequest);
-
- raiseIntentResult.Should().NotBeNull();
- var raiseIntentResponse = raiseIntentResult!.ReadJson(_options)!;
- raiseIntentResponse.AppMetadata.Should().HaveCount(1);
- raiseIntentResponse.AppMetadata!.First()!.AppId.Should().Be("appId4");
-
- var addIntentListenerRequest = MessageBuffer.Factory.CreateJson(
- new IntentListenerRequest()
- {
- Intent = "intentMetadataCustom",
- Fdc3InstanceId = targetFdc3InstanceId,
- State = SubscribeState.Subscribe
- }, _options);
-
- var addIntentListenerResult = await _messageRouter.InvokeAsync(Fdc3Topic.AddIntentListener, addIntentListenerRequest);
- addIntentListenerResult.Should().NotBeNull();
-
- var addIntentListenerResponse = addIntentListenerResult!.ReadJson(_options);
- addIntentListenerResponse!.Stored.Should().BeTrue();
-
- var app4 = _runningApps.First(application => application.Manifest.Id == "appId4");
- var app4Fdc3InstanceId = Fdc3InstanceIdRetriever.Get(app4);
- app4Fdc3InstanceId.Should().Be(raiseIntentResult!.ReadJson(_options)!.AppMetadata!.First().InstanceId);
- }
-
- [Fact]
- public async Task AddIntentListenerSubscribesWithNewApp()
- {
- //TODO: should add some identifier to the query => "fdc3:" + instance.Manifest.Id
- var target = await _moduleLoader.StartModule(new StartRequest("appId4"));
- var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
-
- var addIntentListenerRequest = MessageBuffer.Factory.CreateJson(
- new IntentListenerRequest()
- {
- Intent = "intentMetadataCustom",
- Fdc3InstanceId = targetFdc3InstanceId,
- State = SubscribeState.Subscribe
- }, _options);
-
- var addIntentListenerResult = await _messageRouter.InvokeAsync(Fdc3Topic.AddIntentListener, addIntentListenerRequest);
- addIntentListenerResult.Should().NotBeNull();
-
- var addIntentListenerResponse = addIntentListenerResult!.ReadJson(_options);
- addIntentListenerResponse!.Stored.Should().BeTrue();
- }
-
- [Fact]
- public async Task AddIntentListenerUnsubscribes()
- {
- //TODO: should add some identifier to the query => "fdc3:" + instance.Manifest.Id
- var target = await _moduleLoader.StartModule(new StartRequest("appId4"));
- var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
-
- var addIntentListenerRequest = MessageBuffer.Factory.CreateJson(
- new IntentListenerRequest()
- {
- Intent = "intentMetadataCustom",
- Fdc3InstanceId = targetFdc3InstanceId,
- State = SubscribeState.Subscribe
- }, _options);
-
- var addIntentListenerResult = await _messageRouter.InvokeAsync(Fdc3Topic.AddIntentListener, addIntentListenerRequest);
- addIntentListenerResult.Should().NotBeNull();
-
- var addIntentListnerResponse = addIntentListenerResult!.ReadJson(_options);
- addIntentListnerResponse!.Stored.Should().BeTrue();
-
- addIntentListenerRequest = MessageBuffer.Factory.CreateJson(
- new IntentListenerRequest()
- {
- Intent = "intentMetadataCustom",
- Fdc3InstanceId = targetFdc3InstanceId,
- State = SubscribeState.Unsubscribe
- }, _options);
-
- addIntentListenerResult = await _messageRouter.InvokeAsync(Fdc3Topic.AddIntentListener, addIntentListenerRequest);
- addIntentListenerResult.Should().NotBeNull();
+ Fdc3InstanceId = targetFdc3InstanceId,
+ State = SubscribeState.Subscribe
+ },
+ _options);
+
+ var addIntentListenerResult = await _messageRouter.InvokeAsync(
+ Fdc3Topic.AddIntentListener,
+ addIntentListenerRequest);
+ addIntentListenerResult.Should().NotBeNull();
+
+ var addIntentListenerResponse = addIntentListenerResult!.ReadJson(_options);
+ addIntentListenerResponse!.Stored.Should().BeTrue();
+ }
- addIntentListnerResponse = addIntentListenerResult!.ReadJson(_options);
- addIntentListnerResponse!.Stored.Should().BeFalse();
- addIntentListnerResponse!.Error.Should().BeNull();
- }
+ [Fact]
+ public async Task AddIntentListenerUnsubscribes()
+ {
+ //TODO: should add some identifier to the query => "fdc3:" + instance.Manifest.Id
+ var target = await _moduleLoader.StartModule(new StartRequest("appId4"));
+ var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- private int _counter = 0;
+ var addIntentListenerRequest = MessageBuffer.Factory.CreateJson(
+ new IntentListenerRequest
+ {
+ Intent = "intentMetadataCustom",
+ Fdc3InstanceId = targetFdc3InstanceId,
+ State = SubscribeState.Subscribe
+ },
+ _options);
- private MessageBuffer EmptyContextType => MessageBuffer.Factory.CreateJson(new GetCurrentContextRequest());
+ var addIntentListenerResult = await _messageRouter.InvokeAsync(
+ Fdc3Topic.AddIntentListener,
+ addIntentListenerRequest);
+ addIntentListenerResult.Should().NotBeNull();
- private MessageBuffer ContextType =>
- MessageBuffer.Factory.CreateJson(new GetCurrentContextRequest { ContextType = new Contact().Type });
+ var addIntentListnerResponse = addIntentListenerResult!.ReadJson(_options);
+ addIntentListnerResponse!.Stored.Should().BeTrue();
- private MessageBuffer OtherContextType =>
- MessageBuffer.Factory.CreateJson(new GetCurrentContextRequest { ContextType = new Email(null).Type });
+ addIntentListenerRequest = MessageBuffer.Factory.CreateJson(
+ new IntentListenerRequest
+ {
+ Intent = "intentMetadataCustom",
+ Fdc3InstanceId = targetFdc3InstanceId,
+ State = SubscribeState.Unsubscribe
+ },
+ _options);
+
+ addIntentListenerResult = await _messageRouter.InvokeAsync(
+ Fdc3Topic.AddIntentListener,
+ addIntentListenerRequest);
+ addIntentListenerResult.Should().NotBeNull();
+
+ addIntentListnerResponse = addIntentListenerResult!.ReadJson(_options);
+ addIntentListnerResponse!.Stored.Should().BeFalse();
+ addIntentListnerResponse!.Error.Should().BeNull();
+ }
- private MessageBuffer GetContext() => MessageBuffer.Factory.CreateJson(
+ private MessageBuffer GetContext()
+ {
+ return MessageBuffer.Factory.CreateJson(
new Contact(
- new ContactID() { Email = $"test{_counter}@test.org", FdsId = $"test{_counter++}" },
- "Testy Tester"));
-
- private MessageBuffer FindRequest => MessageBuffer.Factory.CreateJson(
- new FindChannelRequest { ChannelId = TestChannel, ChannelType = ChannelType.User });
-
- private MessageBuffer FindNonExistingRequest => MessageBuffer.Factory.CreateJson(
- new FindChannelRequest { ChannelId = "nonexisting", ChannelType = ChannelType.User });
+ new ContactID {Email = $"test{_counter}@test.org", FdsId = $"test{_counter++}"},
+ name: "Testy Tester"));
}
}
\ No newline at end of file
diff --git a/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/Fdc3DesktopAgentTests.cs b/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/Fdc3DesktopAgentTests.cs
index 65ddc9821..2ae517e6d 100644
--- a/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/Fdc3DesktopAgentTests.cs
+++ b/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/Fdc3DesktopAgentTests.cs
@@ -13,38 +13,54 @@
*/
-using MorganStanley.ComposeUI.Fdc3.AppDirectory;
-using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Tests.TestUtils;
+using Finos.Fdc3;
using Finos.Fdc3.AppDirectory;
-using AppMetadata = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppMetadata;
-using AppIntent = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppIntent;
-using AppIdentifier = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppIdentifier;
-using MorganStanley.ComposeUI.Fdc3.DesktopAgent.DependencyInjection;
+using Finos.Fdc3.Context;
using Microsoft.Extensions.Logging.Abstractions;
-using Finos.Fdc3;
+using MorganStanley.ComposeUI.Fdc3.AppDirectory;
using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Contracts;
-using Finos.Fdc3.Context;
-using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Tests.Helpers;
+using MorganStanley.ComposeUI.Fdc3.DesktopAgent.DependencyInjection;
using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Exceptions;
-using MorganStanley.ComposeUI.ModuleLoader;
using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Infrastructure.Internal;
+using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Tests.Helpers;
+using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Tests.TestUtils;
+using MorganStanley.ComposeUI.ModuleLoader;
+using AppIdentifier = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppIdentifier;
+using AppIntent = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppIntent;
+using AppMetadata = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppMetadata;
+using IntentMetadata = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.IntentMetadata;
namespace MorganStanley.ComposeUI.Fdc3.DesktopAgent.Tests;
public class Fdc3DesktopAgentTests : IAsyncLifetime
{
- private readonly MockModuleLoader _mockModuleLoader = new();
private readonly IAppDirectory _appDirectory = new AppDirectory.AppDirectory(
- new AppDirectoryOptions()
+ new AppDirectoryOptions
{
Source = new Uri($"file:\\\\{Directory.GetCurrentDirectory()}\\TestUtils\\appDirectorySample.json")
});
+
private readonly IFdc3DesktopAgentBridge _fdc3;
+ private readonly MockModuleLoader _mockModuleLoader = new();
public Fdc3DesktopAgentTests()
{
- _fdc3 = new Fdc3DesktopAgent(_appDirectory, _mockModuleLoader.Object, new Fdc3DesktopAgentOptions(), NullLoggerFactory.Instance);
+ _fdc3 = new Fdc3DesktopAgent(
+ _appDirectory,
+ _mockModuleLoader.Object,
+ new Fdc3DesktopAgentOptions(),
+ NullLoggerFactory.Instance);
+ }
+
+ public async Task InitializeAsync()
+ {
+ await _fdc3.StartAsync(CancellationToken.None);
+ }
+
+ public async Task DisposeAsync()
+ {
+ await _fdc3.StopAsync(CancellationToken.None);
}
[Fact]
@@ -62,14 +78,14 @@ public async Task AddUserChannel_wont_throw_and_adds_channel()
var action = async () => await _fdc3.AddUserChannel(mockUserChannel.Object);
await action.Should().NotThrowAsync();
- var channelExists = _fdc3.FindChannel("test", ChannelType.User);
+ var channelExists = _fdc3.FindChannel(channelId: "test", ChannelType.User);
channelExists.Should().BeTrue();
}
[Fact]
public void FindChannel_returns_false()
{
- var result = _fdc3.FindChannel("testChannelId", ChannelType.User);
+ var result = _fdc3.FindChannel(channelId: "testChannelId", ChannelType.User);
result.Should().BeFalse();
}
@@ -86,14 +102,14 @@ public async Task FindChannel_returns_true()
NullLogger.Instance);
await _fdc3.AddUserChannel(mockUserChannel.Object);
- var result = _fdc3.FindChannel("testChannelId", ChannelType.User);
+ var result = _fdc3.FindChannel(channelId: "testChannelId", ChannelType.User);
result.Should().BeTrue();
}
[Fact]
public async Task FindIntent_returns_NoAppsFound()
{
- var request = new FindIntentRequest()
+ var request = new FindIntentRequest
{
Intent = "testIntent",
Fdc3InstanceId = Guid.NewGuid().ToString()
@@ -104,24 +120,10 @@ public async Task FindIntent_returns_NoAppsFound()
result.Error.Should().Be(ResolveError.NoAppsFound);
}
- [Fact]
- public async Task FindIntent_returns_IntentDeliveryFailed()
- {
- var request = new FindIntentRequest()
- {
- Intent = "intentMetadata8", //wrongly setup MockAppDirectory in purpose
- Fdc3InstanceId = Guid.NewGuid().ToString()
- };
-
- var result = await _fdc3.FindIntent(request);
- result.Should().NotBeNull();
- result.Error.Should().Be(ResolveError.IntentDeliveryFailed);
- }
-
[Fact]
public async Task FindIntent_returns()
{
- var request = new FindIntentRequest()
+ var request = new FindIntentRequest
{
Intent = "intentMetadata4",
Context = new Context("context2"),
@@ -131,22 +133,23 @@ public async Task FindIntent_returns()
var result = await _fdc3.FindIntent(request);
result.Should().NotBeNull();
- result.AppIntent.Should().BeEquivalentTo(
- new AppIntent()
- {
- Intent = new Protocol.IntentMetadata() { Name = "intentMetadata4", DisplayName = "displayName4" },
- Apps = new[]
- {
- new AppMetadata() { AppId = "appId5", Name = "app5", ResultType = "resultType" },
- new AppMetadata() { AppId = "appId6", Name = "app6", ResultType = "resultType"},
- }
- });
+ result.AppIntent.Should()
+ .BeEquivalentTo(
+ new AppIntent
+ {
+ Intent = new IntentMetadata {Name = "intentMetadata4", DisplayName = "displayName4"},
+ Apps = new[]
+ {
+ new AppMetadata {AppId = "appId5", Name = "app5", ResultType = "resultType"},
+ new AppMetadata {AppId = "appId6", Name = "app6", ResultType = "resultType"}
+ }
+ });
}
[Fact]
public async Task FindIntentsByContext_returns_NoAppsFound()
{
- var request = new FindIntentsByContextRequest()
+ var request = new FindIntentsByContextRequest
{
Fdc3InstanceId = Guid.NewGuid().ToString(),
Context = new Context("context9"), //This relates to multiple appId
@@ -160,7 +163,7 @@ public async Task FindIntentsByContext_returns_NoAppsFound()
[Fact]
public async Task FindIntentsByContext_returns()
{
- var request = new FindIntentsByContextRequest()
+ var request = new FindIntentsByContextRequest
{
Fdc3InstanceId = Guid.NewGuid().ToString(),
Context = new Context(ContextTypes.Nothing),
@@ -170,27 +173,28 @@ public async Task FindIntentsByContext_returns()
var result = await _fdc3.FindIntentsByContext(request);
result.Should().NotBeNull();
- result.AppIntents.Should().BeEquivalentTo(
- new[]
+ result.AppIntents.Should()
+ .BeEquivalentTo(
+ new[]
+ {
+ new AppIntent
{
- new AppIntent()
+ Intent = new IntentMetadata {Name = "intentMetadata9", DisplayName = "displayName9"},
+ Apps = new[]
{
- Intent = new Protocol.IntentMetadata() { Name = "intentMetadata9", DisplayName = "displayName9" },
- Apps = new []
- {
- new AppMetadata() { AppId = "wrongappId9", Name = "app9", ResultType = "resultWrongApp" },
- }
- },
-
- new AppIntent()
+ new AppMetadata {AppId = "wrongappId9", Name = "app9", ResultType = "resultWrongApp"}
+ }
+ },
+
+ new AppIntent
+ {
+ Intent = new IntentMetadata {Name = "intentMetadata11", DisplayName = "displayName11"},
+ Apps = new[]
{
- Intent = new Protocol.IntentMetadata () { Name = "intentMetadata11", DisplayName = "displayName11" },
- Apps = new []
- {
- new AppMetadata() { AppId = "appId12", Name = "app12", ResultType = "resultWrongApp" }
- }
- },
- });
+ new AppMetadata {AppId = "appId12", Name = "app12", ResultType = "resultWrongApp"}
+ }
+ }
+ });
}
[Fact]
@@ -200,26 +204,26 @@ public async Task GetIntentResult_returns()
var originFdc3InstanceId = Guid.NewGuid().ToString();
var context = new Context("test");
- var target = await _mockModuleLoader.Object.StartModule(new("appId4"));
+ var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
var raiseIntentRequest =
- new RaiseIntentRequest()
+ new RaiseIntentRequest
{
MessageId = int.MaxValue,
Fdc3InstanceId = Guid.NewGuid().ToString(),
Intent = "intentMetadata4",
Selected = false,
Context = new Context("context2"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
};
var raiseIntentResponse = await _fdc3.RaiseIntent(raiseIntentRequest);
raiseIntentResponse.Should().NotBeNull();
- raiseIntentResponse!.Response.AppMetadata.Should().HaveCount(1);
+ raiseIntentResponse.Response.AppMetadata.Should().HaveCount(1);
- var storeIntentRequest = new StoreIntentResultRequest()
+ var storeIntentRequest = new StoreIntentResultRequest
{
MessageId = raiseIntentResponse.Response.MessageId!,
Intent = "intentMetadata4",
@@ -231,11 +235,12 @@ public async Task GetIntentResult_returns()
var storeResult = await _fdc3.StoreIntentResult(storeIntentRequest);
storeResult.Should().NotBeNull();
- var getIntentResultRequest = new GetIntentResultRequest()
+ var getIntentResultRequest = new GetIntentResultRequest
{
MessageId = raiseIntentResponse.Response.MessageId!,
Intent = "intentMetadata4",
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId1", InstanceId = raiseIntentResponse.Response.AppMetadata!.First().InstanceId! }
+ TargetAppIdentifier = new AppIdentifier
+ {AppId = "appId1", InstanceId = raiseIntentResponse.Response.AppMetadata!.First().InstanceId!}
};
var result = await _fdc3.GetIntentResult(getIntentResultRequest);
@@ -248,25 +253,25 @@ public async Task GetIntentResult_fails()
{
await _fdc3.StartAsync(CancellationToken.None);
var originFdc3InstanceId = Guid.NewGuid().ToString();
- var target = await _mockModuleLoader.Object.StartModule(new("appId4"));
+ var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
var context = new Context("test");
- var raiseIntentRequest = new RaiseIntentRequest()
+ var raiseIntentRequest = new RaiseIntentRequest
{
MessageId = int.MaxValue,
Fdc3InstanceId = Guid.NewGuid().ToString(),
Intent = "intentMetadata4",
Selected = false,
Context = new Context("context2"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
};
var raiseIntentResponse = await _fdc3.RaiseIntent(raiseIntentRequest);
- raiseIntentResponse!.Response.AppMetadata.Should().HaveCount(1);
+ raiseIntentResponse.Response.AppMetadata.Should().HaveCount(1);
- var storeIntentRequest = new StoreIntentResultRequest()
+ var storeIntentRequest = new StoreIntentResultRequest
{
MessageId = raiseIntentResponse.Response.MessageId!,
Intent = "intentMetadata4",
@@ -278,22 +283,23 @@ public async Task GetIntentResult_fails()
var storeResponse = await _fdc3.StoreIntentResult(storeIntentRequest);
storeResponse.Error.Should().BeNull();
- var getIntentResultRequest = new GetIntentResultRequest()
+ var getIntentResultRequest = new GetIntentResultRequest
{
MessageId = raiseIntentResponse.Response.MessageId!,
Intent = "dummy",
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId1", InstanceId = raiseIntentResponse.Response.AppMetadata!.First().InstanceId! },
+ TargetAppIdentifier = new AppIdentifier
+ {AppId = "appId1", InstanceId = raiseIntentResponse.Response.AppMetadata!.First().InstanceId!},
Version = "1.0"
};
var result = await _fdc3.GetIntentResult(getIntentResultRequest);
- result.Should().BeEquivalentTo(new GetIntentResultResponse() { Error = ResolveError.IntentDeliveryFailed });
+ result.Should().BeEquivalentTo(new GetIntentResultResponse {Error = ResolveError.IntentDeliveryFailed});
}
[Fact]
public async Task StoreIntentResult_throws()
{
- var request = new StoreIntentResultRequest()
+ var request = new StoreIntentResultRequest
{
MessageId = "dummy",
Intent = "dummy",
@@ -313,22 +319,22 @@ await action.Should()
public async Task StoreIntentResult_returns()
{
await _fdc3.StartAsync(CancellationToken.None);
- var target = await _mockModuleLoader.Object.StartModule(new("appId4"));
+ var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var raiseIntentRequest = new RaiseIntentRequest()
+ var raiseIntentRequest = new RaiseIntentRequest
{
MessageId = int.MaxValue,
Fdc3InstanceId = Guid.NewGuid().ToString(),
Intent = "intentMetadata4",
Selected = false,
Context = new Context("context2"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
};
var raiseIntentResponse = await _fdc3.RaiseIntent(raiseIntentRequest);
- raiseIntentResponse!.Response.AppMetadata.Should().HaveCount(1);
+ raiseIntentResponse.Response.AppMetadata.Should().HaveCount(1);
- var storeIntentRequest = new StoreIntentResultRequest()
+ var storeIntentRequest = new StoreIntentResultRequest
{
MessageId = raiseIntentResponse!.Response.MessageId!,
Intent = "intentMetadata4",
@@ -340,7 +346,7 @@ public async Task StoreIntentResult_returns()
var result = await _fdc3.StoreIntentResult(storeIntentRequest);
result.Should().NotBeNull();
- result.Should().BeEquivalentTo(new StoreIntentResultResponse() { Stored = true });
+ result.Should().BeEquivalentTo(new StoreIntentResultResponse {Stored = true});
}
[Fact]
@@ -356,24 +362,24 @@ public async Task AddIntentListener_subscribes()
var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var raiseIntentRequest = new RaiseIntentRequest()
+ var raiseIntentRequest = new RaiseIntentRequest
{
MessageId = 1,
Fdc3InstanceId = originFdc3InstanceId,
Intent = "intentMetadataCustom",
Selected = false,
Context = new Context("contextCustom"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
};
var raiseIntentResponse = await _fdc3.RaiseIntent(raiseIntentRequest);
raiseIntentResponse.Should().NotBeNull();
- raiseIntentResponse!.Response.AppMetadata.Should().HaveCount(1);
- raiseIntentResponse!.Response.AppMetadata!.First()!.AppId.Should().Be("appId4");
- raiseIntentResponse!.Response.AppMetadata!.First()!.InstanceId.Should().Be(targetFdc3InstanceId);
- raiseIntentResponse!.RaiseIntentResolutionMessages.Should().BeEmpty();
+ raiseIntentResponse.Response.AppMetadata.Should().HaveCount(1);
+ raiseIntentResponse.Response.AppMetadata!.First().AppId.Should().Be("appId4");
+ raiseIntentResponse.Response.AppMetadata!.First().InstanceId.Should().Be(targetFdc3InstanceId);
+ raiseIntentResponse.RaiseIntentResolutionMessages.Should().BeEmpty();
- var addIntentListenerRequest = new IntentListenerRequest()
+ var addIntentListenerRequest = new IntentListenerRequest
{
Intent = "intentMetadataCustom",
Fdc3InstanceId = targetFdc3InstanceId,
@@ -383,8 +389,8 @@ public async Task AddIntentListener_subscribes()
var addIntentListenerResponse = await _fdc3.AddIntentListener(addIntentListenerRequest);
addIntentListenerResponse.Should().NotBeNull();
- addIntentListenerResponse!.Response.Stored.Should().BeTrue();
- addIntentListenerResponse!.RaiseIntentResolutionMessages.Should().NotBeEmpty();
+ addIntentListenerResponse.Response.Stored.Should().BeTrue();
+ addIntentListenerResponse.RaiseIntentResolutionMessages.Should().NotBeEmpty();
}
[Fact]
@@ -400,24 +406,24 @@ public async Task AddIntentListener_unsubscribes()
var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var raiseIntentRequest = new RaiseIntentRequest()
+ var raiseIntentRequest = new RaiseIntentRequest
{
MessageId = 1,
Fdc3InstanceId = originFdc3InstanceId,
Intent = "intentMetadataCustom",
Selected = false,
Context = new Context("contextCustom"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
};
var raiseIntentResponse = await _fdc3.RaiseIntent(raiseIntentRequest);
raiseIntentResponse.Should().NotBeNull();
- raiseIntentResponse!.Response.AppMetadata.Should().HaveCount(1);
- raiseIntentResponse!.Response.AppMetadata!.First()!.AppId.Should().Be("appId4");
- raiseIntentResponse!.Response.AppMetadata!.First()!.InstanceId.Should().Be(targetFdc3InstanceId);
- raiseIntentResponse!.RaiseIntentResolutionMessages.Should().BeEmpty();
+ raiseIntentResponse.Response.AppMetadata.Should().HaveCount(1);
+ raiseIntentResponse.Response.AppMetadata!.First()!.AppId.Should().Be("appId4");
+ raiseIntentResponse.Response.AppMetadata!.First()!.InstanceId.Should().Be(targetFdc3InstanceId);
+ raiseIntentResponse.RaiseIntentResolutionMessages.Should().BeEmpty();
- var addIntentListenerRequest1 = new IntentListenerRequest()
+ var addIntentListenerRequest1 = new IntentListenerRequest
{
Intent = "intentMetadataCustom",
Fdc3InstanceId = targetFdc3InstanceId,
@@ -426,10 +432,10 @@ public async Task AddIntentListener_unsubscribes()
var addIntentListenerResponse1 = await _fdc3.AddIntentListener(addIntentListenerRequest1);
addIntentListenerResponse1.Should().NotBeNull();
- addIntentListenerResponse1!.Response.Stored.Should().BeTrue();
- addIntentListenerResponse1!.RaiseIntentResolutionMessages.Should().NotBeEmpty();
+ addIntentListenerResponse1.Response.Stored.Should().BeTrue();
+ addIntentListenerResponse1.RaiseIntentResolutionMessages.Should().NotBeEmpty();
- var addIntentListenerRequest2 = new IntentListenerRequest()
+ var addIntentListenerRequest2 = new IntentListenerRequest
{
Intent = "intentMetadataCustom",
Fdc3InstanceId = targetFdc3InstanceId,
@@ -438,14 +444,14 @@ public async Task AddIntentListener_unsubscribes()
var addIntentListenerResponse2 = await _fdc3.AddIntentListener(addIntentListenerRequest2);
addIntentListenerResponse2.Should().NotBeNull();
- addIntentListenerResponse2!.Response.Stored.Should().BeFalse();
- addIntentListenerResponse2!.RaiseIntentResolutionMessages.Should().BeEmpty();
+ addIntentListenerResponse2.Response.Stored.Should().BeFalse();
+ addIntentListenerResponse2.RaiseIntentResolutionMessages.Should().BeEmpty();
}
[Fact]
public async Task AddIntentListener_unsubscribe_fails()
{
- var addIntentListenerRequest = new IntentListenerRequest()
+ var addIntentListenerRequest = new IntentListenerRequest
{
Intent = "intentMetadataCustom",
Fdc3InstanceId = Guid.NewGuid().ToString(),
@@ -454,15 +460,15 @@ public async Task AddIntentListener_unsubscribe_fails()
var addIntentListenerResponse = await _fdc3.AddIntentListener(addIntentListenerRequest);
addIntentListenerResponse.Should().NotBeNull();
- addIntentListenerResponse!.Response.Stored.Should().BeFalse();
- addIntentListenerResponse!.RaiseIntentResolutionMessages.Should().BeEmpty();
- addIntentListenerResponse!.Response.Error.Should().Be(Fdc3DesktopAgentErrors.MissingId);
+ addIntentListenerResponse.Response.Stored.Should().BeFalse();
+ addIntentListenerResponse.RaiseIntentResolutionMessages.Should().BeEmpty();
+ addIntentListenerResponse.Response.Error.Should().Be(Fdc3DesktopAgentErrors.MissingId);
}
[Fact]
public async Task RaiseIntent_returns_NoAppsFound()
{
- var request = new RaiseIntentRequest()
+ var request = new RaiseIntentRequest
{
MessageId = 1,
Fdc3InstanceId = Guid.NewGuid().ToString(),
@@ -473,48 +479,14 @@ public async Task RaiseIntent_returns_NoAppsFound()
var result = await _fdc3.RaiseIntent(request);
result.Should().NotBeNull();
- result!.Response.Error.Should().Be(ResolveError.NoAppsFound);
- }
-
- [Fact]
- public async Task RaiseIntent_returns_IntentDeliveryFailed()
- {
- var request = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata8",
- Selected = false,
- Context = new Context("context7")
- };
-
- var result = await _fdc3.RaiseIntent(request);
- result.Should().NotBeNull();
- result!.Response.Error.Should().Be(ResolveError.IntentDeliveryFailed);
- }
-
- [Fact]
- public async Task RaiseIntent_fails_as_request_specifies_error()
- {
- var request = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "someIntent",
- Selected = false,
- Error = "Some weird error"
- };
-
- var result = await _fdc3.RaiseIntent(request);
-
- result!.Response.Error.Should().Be("Some weird error");
+ result.Response.Error.Should().Be(ResolveError.NoAppsFound);
}
//TODO: Right now we are returning just one element, without the possibility of selecting via ResolverUI.
[Fact]
public async Task RaiseIntent_returns_first_app()
{
- var request = new RaiseIntentRequest()
+ var request = new RaiseIntentRequest
{
MessageId = 1,
Fdc3InstanceId = Guid.NewGuid().ToString(),
@@ -525,26 +497,9 @@ public async Task RaiseIntent_returns_first_app()
var result = await _fdc3.RaiseIntent(request);
result.Should().NotBeNull();
- result!.RaiseIntentResolutionMessages.Should().BeEmpty();
- result!.Response!.AppMetadata.Should().HaveCount(1);
- result!.Response.AppMetadata!.First().AppId.Should().Be("appId4");
- }
-
- [Fact]
- public async Task RaiseIntent_fails_as_multiple_AppIntent_found()
- {
- var request = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata8", //wrongly setup AppDirectory on purpose
- Selected = false,
- Context = new Context("context7")
- };
-
- var result = await _fdc3.RaiseIntent(request);
- result.Should().NotBeNull();
- result!.Response.Error.Should().Be(ResolveError.IntentDeliveryFailed);
+ result.RaiseIntentResolutionMessages.Should().BeEmpty();
+ result.Response.AppMetadata.Should().HaveCount(1);
+ result.Response.AppMetadata!.First().AppId.Should().Be("appId4");
}
[Fact]
@@ -560,47 +515,37 @@ public async Task RaiseIntent_returns_one_running_app()
var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var addIntentListenerRequest = new IntentListenerRequest()
+ var addIntentListenerRequest = new IntentListenerRequest
{
Intent = "intentMetadataCustom",
Fdc3InstanceId = targetFdc3InstanceId,
State = SubscribeState.Subscribe
};
- var addIntentListnerResponse = await _fdc3.AddIntentListener(addIntentListenerRequest);
- addIntentListnerResponse.Should().NotBeNull();
- addIntentListnerResponse!.Response.Stored.Should().BeTrue();
- addIntentListnerResponse.RaiseIntentResolutionMessages.Should().BeEmpty();
+ var addIntentListenerResponse = await _fdc3.AddIntentListener(addIntentListenerRequest);
+ addIntentListenerResponse.Should().NotBeNull();
+ addIntentListenerResponse.Response.Stored.Should().BeTrue();
+ addIntentListenerResponse.RaiseIntentResolutionMessages.Should().BeEmpty();
- var request = new RaiseIntentRequest()
+ var request = new RaiseIntentRequest
{
MessageId = 1,
Fdc3InstanceId = originFdc3InstanceId,
Intent = "intentMetadataCustom",
Selected = false,
Context = new Context("contextCustom"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
};
var result = await _fdc3.RaiseIntent(request);
result.Should().NotBeNull();
- result!.Response.AppMetadata.Should().HaveCount(1);
- result!.Response.AppMetadata!.First()!.AppId.Should().Be("appId4");
- result!.Response.AppMetadata!.First()!.InstanceId.Should().Be(targetFdc3InstanceId);
+ result.Response.AppMetadata.Should().HaveCount(1);
+ result.Response.AppMetadata!.First().AppId.Should().Be("appId4");
+ result.Response.AppMetadata!.First().InstanceId.Should().Be(targetFdc3InstanceId);
result.RaiseIntentResolutionMessages.Should().NotBeEmpty();
- result!.Response!.Intent.Should().Be("intentMetadataCustom");
- result!.RaiseIntentResolutionMessages!.Should().HaveCount(1);
- result!.RaiseIntentResolutionMessages!.First().TargetModuleInstanceId.Should().Be(targetFdc3InstanceId);
- }
-
- public async Task InitializeAsync()
- {
- await _fdc3.StartAsync(CancellationToken.None);
- }
-
- public async Task DisposeAsync()
- {
- await _fdc3.StopAsync(CancellationToken.None);
+ result.Response.Intent.Should().Be("intentMetadataCustom");
+ result.RaiseIntentResolutionMessages.Should().HaveCount(1);
+ result.RaiseIntentResolutionMessages.First().TargetModuleInstanceId.Should().Be(targetFdc3InstanceId);
}
-}
+}
\ No newline at end of file
diff --git a/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/Infrastructure/Internal/Fdc3DesktopAgentMessageRouterService.Tests.cs b/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/Infrastructure/Internal/Fdc3DesktopAgentMessageRouterService.Tests.cs
index 321323d08..671dbf085 100644
--- a/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/Infrastructure/Internal/Fdc3DesktopAgentMessageRouterService.Tests.cs
+++ b/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/Infrastructure/Internal/Fdc3DesktopAgentMessageRouterService.Tests.cs
@@ -12,46 +12,64 @@
* and limitations under the License.
*/
+using Finos.Fdc3;
+using Finos.Fdc3.AppDirectory;
+using Finos.Fdc3.Context;
using Microsoft.Extensions.Logging.Abstractions;
using MorganStanley.ComposeUI.Fdc3.AppDirectory;
using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Contracts;
using MorganStanley.ComposeUI.Fdc3.DesktopAgent.DependencyInjection;
using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Exceptions;
+using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Infrastructure.Internal;
using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Tests.Helpers;
using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Tests.TestUtils;
using MorganStanley.ComposeUI.ModuleLoader;
-using Finos.Fdc3;
-using Finos.Fdc3.AppDirectory;
-using Finos.Fdc3.Context;
-using AppMetadata = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppMetadata;
-using AppIntent = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppIntent;
using AppIdentifier = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppIdentifier;
-using MorganStanley.ComposeUI.Fdc3.DesktopAgent.Infrastructure.Internal;
+using AppIntent = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppIntent;
+using AppMetadata = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.AppMetadata;
+using IntentMetadata = MorganStanley.ComposeUI.Fdc3.DesktopAgent.Protocol.IntentMetadata;
namespace MorganStanley.ComposeUI.Fdc3.DesktopAgent.Tests.Infrastructure.Internal;
public class Fdc3DesktopAgentMessageRouterServiceTests : IAsyncLifetime
{
- private readonly Mock _mockMessageRouter = new();
- private readonly MockModuleLoader _mockModuleLoader = new();
+ private const string TestChannel = "testChannel";
+
private readonly IAppDirectory _appDirectory = new AppDirectory.AppDirectory(
- new AppDirectoryOptions()
+ new AppDirectoryOptions
{
Source = new Uri($"file:\\\\{Directory.GetCurrentDirectory()}\\TestUtils\\appDirectorySample.json")
});
private readonly Fdc3DesktopAgentMessageRouterService _fdc3;
- private const string TestChannel = "testChannel";
+ private readonly Mock _mockMessageRouter = new();
+ private readonly MockModuleLoader _mockModuleLoader = new();
public Fdc3DesktopAgentMessageRouterServiceTests()
{
- _fdc3 = new(
+ _fdc3 = new Fdc3DesktopAgentMessageRouterService(
_mockMessageRouter.Object,
- new Fdc3DesktopAgent(_appDirectory, _mockModuleLoader.Object, new Fdc3DesktopAgentOptions(), NullLoggerFactory.Instance),
+ new Fdc3DesktopAgent(
+ _appDirectory,
+ _mockModuleLoader.Object,
+ new Fdc3DesktopAgentOptions(),
+ NullLoggerFactory.Instance),
new Fdc3DesktopAgentOptions(),
NullLoggerFactory.Instance);
}
+ private FindChannelRequest FindTestChannel => new() {ChannelId = "testChannel", ChannelType = ChannelType.User};
+
+ public async Task InitializeAsync()
+ {
+ await _fdc3.StartAsync(CancellationToken.None);
+ }
+
+ public async Task DisposeAsync()
+ {
+ await _fdc3.StopAsync(CancellationToken.None);
+ }
+
[Fact]
public async void UserChannelAddedCanBeFound()
{
@@ -66,15 +84,15 @@ public async void UserChannelAddedCanBeFound()
[Fact]
public async Task RaiseIntent_returns_one_app_by_AppIdentifier()
{
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4",
- Selected = false,
- Context = new Context("context2"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4" }
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = 1,
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4",
+ Selected = false,
+ Context = new Context("context2"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4"}
+ };
var result = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
result.Should().NotBeNull();
@@ -86,7 +104,7 @@ public async Task RaiseIntent_returns_one_app_by_AppIdentifier()
[Fact]
public async Task RaiseIntent_fails_by_request_delivery_error()
{
- var result = await _fdc3.HandleRaiseIntent(null, new MessageContext());
+ var result = await _fdc3.HandleRaiseIntent(request: null, new MessageContext());
result.Should().NotBeNull();
result!.Error.Should().Be(ResolveError.IntentDeliveryFailed);
}
@@ -94,7 +112,7 @@ public async Task RaiseIntent_fails_by_request_delivery_error()
[Fact]
public async Task RaiseIntent_returns_one_app_by_Context()
{
- var request = new RaiseIntentRequest()
+ var request = new RaiseIntentRequest
{
MessageId = 1,
Fdc3InstanceId = Guid.NewGuid().ToString(),
@@ -111,38 +129,50 @@ public async Task RaiseIntent_returns_one_app_by_Context()
}
[Fact]
- public async Task RaiseIntent_returns_one_app_by_AppIdentifier_and_saves_context_to_resolve_it_when_registers_its_intentHandler()
+ public async Task
+ RaiseIntent_returns_one_app_by_AppIdentifier_and_saves_context_to_resolve_it_when_registers_its_intentHandler()
{
await _fdc3.StartAsync(CancellationToken.None);
//TODO: should add some identifier to the query => "fdc3:" + instance.Manifest.Id
var instance = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(instance);
- var request = new RaiseIntentRequest()
+ var request = new RaiseIntentRequest
{
MessageId = 1,
Fdc3InstanceId = Guid.NewGuid().ToString(),
Intent = "intentMetadataCustom",
Selected = false,
Context = new Context("contextCustom"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
};
var result = await _fdc3.HandleRaiseIntent(request, new MessageContext());
result.Should().NotBeNull();
result!.AppMetadata.Should().HaveCount(1);
- result!.AppMetadata!.First()!.AppId.Should().Be("appId4");
- result!.AppMetadata!.First()!.InstanceId.Should().Be(targetFdc3InstanceId);
+ result!.AppMetadata!.First().AppId.Should().Be("appId4");
+ result!.AppMetadata!.First().InstanceId.Should().Be(targetFdc3InstanceId);
_mockMessageRouter.Verify(
- _ => _.InvokeAsync(Fdc3Topic.AddIntentListener, It.IsAny(), It.IsAny(), It.IsAny()), Times.Never);
+ _ => _.InvokeAsync(
+ Fdc3Topic.AddIntentListener,
+ It.IsAny(),
+ It.IsAny(),
+ It.IsAny()),
+ Times.Never);
_mockMessageRouter.Verify(
- _ => _.InvokeAsync(Fdc3Topic.RaiseIntentResolution("intentMetadataCustom", targetFdc3InstanceId), It.IsAny(), It.IsAny(), It.IsAny()), Times.Never);
+ _ => _.InvokeAsync(
+ Fdc3Topic.RaiseIntentResolution("intentMetadataCustom", targetFdc3InstanceId),
+ It.IsAny(),
+ It.IsAny(),
+ It.IsAny()),
+ Times.Never);
}
[Fact]
- public async Task RaiseIntent_returns_one_app_by_AppIdentifier_and_publishes_context_to_resolve_it_when_registers_its_intentHandler()
+ public async Task
+ RaiseIntent_returns_one_app_by_AppIdentifier_and_publishes_context_to_resolve_it_when_registers_its_intentHandler()
{
await _fdc3.StartAsync(CancellationToken.None);
@@ -154,35 +184,41 @@ public async Task RaiseIntent_returns_one_app_by_AppIdentifier_and_publishes_con
var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var addIntentListenerRequest = new IntentListenerRequest()
- {
- Intent = "intentMetadataCustom",
- Fdc3InstanceId = targetFdc3InstanceId,
- State = SubscribeState.Subscribe
- };
+ var addIntentListenerRequest = new IntentListenerRequest
+ {
+ Intent = "intentMetadataCustom",
+ Fdc3InstanceId = targetFdc3InstanceId,
+ State = SubscribeState.Subscribe
+ };
- var addIntentListenerResult = await _fdc3.HandleAddIntentListener(addIntentListenerRequest, new MessageContext());
+ var addIntentListenerResult =
+ await _fdc3.HandleAddIntentListener(addIntentListenerRequest, new MessageContext());
addIntentListenerResult.Should().NotBeNull();
addIntentListenerResult!.Stored.Should().BeTrue();
- var request = new RaiseIntentRequest()
+ var request = new RaiseIntentRequest
{
MessageId = 1,
Fdc3InstanceId = originFdc3InstanceId,
Intent = "intentMetadataCustom",
Selected = false,
Context = new Context("contextCustom"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
};
var result = await _fdc3.HandleRaiseIntent(request, new MessageContext());
result.Should().NotBeNull();
result!.AppMetadata.Should().HaveCount(1);
- result!.AppMetadata!.First()!.AppId.Should().Be("appId4");
- result!.AppMetadata!.First()!.InstanceId.Should().Be(targetFdc3InstanceId);
+ result!.AppMetadata!.First().AppId.Should().Be("appId4");
+ result!.AppMetadata!.First().InstanceId.Should().Be(targetFdc3InstanceId);
_mockMessageRouter.Verify(
- _ => _.PublishAsync(Fdc3Topic.RaiseIntentResolution("intentMetadataCustom", targetFdc3InstanceId), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once);
+ _ => _.PublishAsync(
+ Fdc3Topic.RaiseIntentResolution("intentMetadataCustom", targetFdc3InstanceId),
+ It.IsAny(),
+ It.IsAny(),
+ It.IsAny()),
+ Times.Once);
}
//TODO: Right now we are returning just one element, without the possibility of selecting via ResolverUI.
@@ -190,19 +226,19 @@ public async Task RaiseIntent_returns_one_app_by_AppIdentifier_and_publishes_con
public async Task RaiseIntent_returns_first_app_by_Context()
{
var instanceId = Guid.NewGuid().ToString();
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = instanceId,
- Intent = "intentMetadata4",
- Selected = false,
- Context = new Context("context2")
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = 1,
+ Fdc3InstanceId = instanceId,
+ Intent = "intentMetadata4",
+ Selected = false,
+ Context = new Context("context2")
+ };
var result = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
result.Should().NotBeNull();
result!.AppMetadata.Should().HaveCount(1);
- result!.AppMetadata!.First().AppId.Should().Be("appId4");
+ result.AppMetadata!.First().AppId.Should().Be("appId4");
}
//TODO: Right now we are returning just one element, without the possibility of selecting via ResolverUI.
@@ -210,14 +246,14 @@ public async Task RaiseIntent_returns_first_app_by_Context()
public async Task RaiseIntent_returns_first_app_by_Context_if_fdc3_nothing()
{
var instanceId = Guid.NewGuid().ToString();
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = instanceId,
- Intent = "intentMetadata4",
- Selected = false,
- Context = new Context(ContextTypes.Nothing)
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = 1,
+ Fdc3InstanceId = instanceId,
+ Intent = "intentMetadata4",
+ Selected = false,
+ Context = new Context(ContextTypes.Nothing)
+ };
var result = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
result.Should().NotBeNull();
@@ -228,15 +264,15 @@ public async Task RaiseIntent_returns_first_app_by_Context_if_fdc3_nothing()
[Fact]
public async Task RaiseIntent_fails_as_no_apps_found_by_AppIdentifier()
{
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "testIntent",
- Selected = false,
- Context = new Context("contextType"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "noAppShouldReturn" }
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = 1,
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "testIntent",
+ Selected = false,
+ Context = new Context("contextType"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "noAppShouldReturn"}
+ };
var result = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
result.Should().NotBeNull();
@@ -246,14 +282,14 @@ public async Task RaiseIntent_fails_as_no_apps_found_by_AppIdentifier()
[Fact]
public async Task RaiseIntent_fails_as_no_apps_found_by_Context()
{
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4",
- Selected = false,
- Context = new Context("noAppShouldReturn")
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = 1,
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4",
+ Selected = false,
+ Context = new Context("noAppShouldReturn")
+ };
var result = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
result.Should().NotBeNull();
@@ -263,98 +299,67 @@ public async Task RaiseIntent_fails_as_no_apps_found_by_Context()
[Fact]
public async Task RaiseIntent_fails_as_no_apps_found_by_Intent()
{
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "noAppShouldReturn",
- Selected = false,
- Context = new Context("context2")
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = 1,
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "noAppShouldReturn",
+ Selected = false,
+ Context = new Context("context2")
+ };
var result = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
result.Should().NotBeNull();
result!.Error.Should().Be(ResolveError.NoAppsFound);
}
- [Fact]
- public async Task RaiseIntent_fails_as_multiple_IAppIntents_found()
- {
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata8",
- Selected = false,
- Context = new Context("context7")
- };
-
- var result = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
- result.Should().NotBeNull();
- result!.Error.Should().Be(ResolveError.IntentDeliveryFailed);
- }
-
- [Fact]
- public async Task RaiseIntent_fails_as_request_specifies_error()
- {
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "someIntent",
- Selected = false,
- Error = "Some weird error"
- };
-
- var result = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
- result!.Error.Should().Be("Some weird error");
- }
-
[Fact]
public async Task StoreIntentResult_fails_due_the_request()
{
- var result = await _fdc3.HandleStoreIntentResult(null, new MessageContext());
+ var result = await _fdc3.HandleStoreIntentResult(request: null, new MessageContext());
result.Should().NotBeNull();
- result!.Should().BeEquivalentTo(new StoreIntentResultResponse() { Error = ResolveError.IntentDeliveryFailed, Stored = false });
+ result!.Should()
+ .BeEquivalentTo(new StoreIntentResultResponse {Error = ResolveError.IntentDeliveryFailed, Stored = false});
}
[Fact]
public async Task StoreIntentResult_fails_due_the_request_contains_no_information()
{
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = int.MaxValue,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4",
- Selected = false,
- Context = new Context("context2"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4" }
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = int.MaxValue,
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4",
+ Selected = false,
+ Context = new Context("context2"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4"}
+ };
var raiseIntentResult = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
raiseIntentResult.Should().NotBeNull();
raiseIntentResult!.AppMetadata.Should().HaveCount(1);
- var storeIntentRequest = new StoreIntentResultRequest()
+ var storeIntentRequest = new StoreIntentResultRequest
{
MessageId = raiseIntentResult.MessageId!,
Intent = "dummy",
OriginFdc3InstanceId = raiseIntentResult.AppMetadata!.First().InstanceId!,
TargetFdc3InstanceId = null,
ChannelId = "dummyChannelId",
- ChannelType = ChannelType.User,
+ ChannelType = ChannelType.User
};
var result = await _fdc3.HandleStoreIntentResult(storeIntentRequest, new MessageContext());
result.Should().NotBeNull();
- result!.Should().BeEquivalentTo(new StoreIntentResultResponse() { Error = ResolveError.IntentDeliveryFailed, Stored = false });
+ result!.Should()
+ .BeEquivalentTo(new StoreIntentResultResponse {Error = ResolveError.IntentDeliveryFailed, Stored = false});
}
[Fact]
public async Task StoreIntentResult_fails_due_the_previosly_no_saved_raiseIntent_could_handle()
{
var originFdc3InstanceId = Guid.NewGuid().ToString();
- var storeIntentRequest = new StoreIntentResultRequest()
+ var storeIntentRequest = new StoreIntentResultRequest
{
MessageId = "dummy",
Intent = "dummy",
@@ -374,16 +379,16 @@ await action.Should()
public async Task StoreIntentResult_succeeds_with_channel()
{
await _fdc3.StartAsync(CancellationToken.None);
- var target = await _mockModuleLoader.Object.StartModule(new("appId4"));
+ var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var raiseIntentRequest = new RaiseIntentRequest()
+ var raiseIntentRequest = new RaiseIntentRequest
{
MessageId = int.MaxValue,
Fdc3InstanceId = Guid.NewGuid().ToString(),
Intent = "intentMetadata4",
Selected = false,
Context = new Context("context2"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
};
var raiseIntentResult = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
@@ -392,7 +397,7 @@ public async Task StoreIntentResult_succeeds_with_channel()
raiseIntentResult.AppMetadata.Should().NotBeNull();
raiseIntentResult!.AppMetadata.Should().HaveCount(1);
- var storeIntentRequest = new StoreIntentResultRequest()
+ var storeIntentRequest = new StoreIntentResultRequest
{
MessageId = raiseIntentResult!.MessageId!,
Intent = "intentMetadata4",
@@ -404,27 +409,27 @@ public async Task StoreIntentResult_succeeds_with_channel()
var result = await _fdc3.HandleStoreIntentResult(storeIntentRequest, new MessageContext());
result.Should().NotBeNull();
- result!.Should().BeEquivalentTo(new StoreIntentResultResponse() { Stored = true });
+ result!.Should().BeEquivalentTo(new StoreIntentResultResponse {Stored = true});
}
[Fact]
public async Task StoreIntentResult_succeeds_with_context()
{
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = int.MaxValue,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4",
- Selected = true,
- Context = new Context("context2"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4" }
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = int.MaxValue,
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4",
+ Selected = true,
+ Context = new Context("context2"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4"}
+ };
var raiseIntentResult = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
raiseIntentResult.Should().NotBeNull();
raiseIntentResult!.AppMetadata.Should().HaveCount(1);
- var storeIntentRequest = new StoreIntentResultRequest()
+ var storeIntentRequest = new StoreIntentResultRequest
{
MessageId = raiseIntentResult.MessageId!,
Intent = "intentMetadata4",
@@ -437,31 +442,31 @@ public async Task StoreIntentResult_succeeds_with_context()
var result = await _fdc3.HandleStoreIntentResult(storeIntentRequest, new MessageContext());
result.Should().NotBeNull();
- result!.Should().BeEquivalentTo(new StoreIntentResultResponse() { Stored = true });
+ result!.Should().BeEquivalentTo(new StoreIntentResultResponse {Stored = true});
}
[Fact]
public async Task StoreIntentResult_succeeds_with_voidResult()
{
await _fdc3.StartAsync(CancellationToken.None);
- var target = await _mockModuleLoader.Object.StartModule(new("appId4"));
+ var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = int.MaxValue,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4",
- Selected = false,
- Context = new Context("context2"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = int.MaxValue,
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4",
+ Selected = false,
+ Context = new Context("context2"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
+ };
var raiseIntentResult = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
raiseIntentResult.Should().NotBeNull();
raiseIntentResult!.AppMetadata.Should().HaveCount(1);
- var storeIntentRequest = new StoreIntentResultRequest()
+ var storeIntentRequest = new StoreIntentResultRequest
{
MessageId = raiseIntentResult.MessageId!,
Intent = "intentMetadata4",
@@ -475,48 +480,48 @@ public async Task StoreIntentResult_succeeds_with_voidResult()
var result = await _fdc3.HandleStoreIntentResult(storeIntentRequest, new MessageContext());
result.Should().NotBeNull();
- result!.Should().BeEquivalentTo(new StoreIntentResultResponse() { Stored = true });
+ result!.Should().BeEquivalentTo(new StoreIntentResultResponse {Stored = true});
}
[Fact]
public async Task GetIntentResult_fails_due_the_request()
{
- var result = await _fdc3.HandleGetIntentResult(null, new MessageContext());
+ var result = await _fdc3.HandleGetIntentResult(request: null, new MessageContext());
result.Should().NotBeNull();
- result!.Should().BeEquivalentTo(new GetIntentResultResponse() { Error = ResolveError.IntentDeliveryFailed });
+ result!.Should().BeEquivalentTo(new GetIntentResultResponse {Error = ResolveError.IntentDeliveryFailed});
}
[Fact]
public async Task GetIntentResult_fails_intent_not_found()
{
//Version should be the Intent's schema version
- var getIntentResultRequest = new GetIntentResultRequest()
+ var getIntentResultRequest = new GetIntentResultRequest
{
MessageId = "dummy",
Intent = "dummy",
- TargetAppIdentifier = new AppIdentifier() { AppId = "dummy", InstanceId = Guid.NewGuid().ToString() },
+ TargetAppIdentifier = new AppIdentifier {AppId = "dummy", InstanceId = Guid.NewGuid().ToString()},
Version = "1.0"
};
var result = await _fdc3.HandleGetIntentResult(getIntentResultRequest, new MessageContext());
result.Should().NotBeNull();
- result!.Should().BeEquivalentTo(new GetIntentResultResponse() { Error = ResolveError.IntentDeliveryFailed });
+ result!.Should().BeEquivalentTo(new GetIntentResultResponse {Error = ResolveError.IntentDeliveryFailed});
}
[Fact]
public async Task GetIntentResult_fails_due_InstanceId_is_null()
{
- var getIntentResultRequest = new GetIntentResultRequest()
+ var getIntentResultRequest = new GetIntentResultRequest
{
MessageId = "dummy",
Intent = "dummy",
- TargetAppIdentifier = new AppIdentifier() { AppId = "dummy" },
+ TargetAppIdentifier = new AppIdentifier {AppId = "dummy"},
Version = "1.0"
};
var result = await _fdc3.HandleGetIntentResult(getIntentResultRequest, new MessageContext());
result.Should().NotBeNull();
- result!.Should().BeEquivalentTo(new GetIntentResultResponse() { Error = ResolveError.IntentDeliveryFailed });
+ result!.Should().BeEquivalentTo(new GetIntentResultResponse {Error = ResolveError.IntentDeliveryFailed});
}
[Fact]
@@ -524,26 +529,26 @@ public async Task GetIntentResult_fails_due_no_intent_found()
{
await _fdc3.StartAsync(CancellationToken.None);
var originFdc3InstanceId = Guid.NewGuid().ToString();
- var target = await _mockModuleLoader.Object.StartModule(new("appId4"));
+ var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
var context = new Context("test");
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = int.MaxValue,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4",
- Selected = false,
- Context = new Context("context2"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = int.MaxValue,
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4",
+ Selected = false,
+ Context = new Context("context2"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
+ };
var raiseIntentResult = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
raiseIntentResult.Should().NotBeNull();
raiseIntentResult!.AppMetadata.Should().HaveCount(1);
- var storeIntentRequest = new StoreIntentResultRequest()
+ var storeIntentRequest = new StoreIntentResultRequest
{
MessageId = raiseIntentResult.MessageId!,
Intent = "intentMetadata4",
@@ -556,17 +561,18 @@ public async Task GetIntentResult_fails_due_no_intent_found()
storeResult.Should().NotBeNull();
storeResult!.Should().BeEquivalentTo(StoreIntentResultResponse.Success());
- var getIntentResultRequest = new GetIntentResultRequest()
+ var getIntentResultRequest = new GetIntentResultRequest
{
MessageId = raiseIntentResult.MessageId!,
Intent = "dummy",
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId1", InstanceId = raiseIntentResult.AppMetadata!.First().InstanceId! },
+ TargetAppIdentifier = new AppIdentifier
+ {AppId = "appId1", InstanceId = raiseIntentResult.AppMetadata!.First().InstanceId!},
Version = "1.0"
};
var result = await _fdc3.HandleGetIntentResult(getIntentResultRequest, new MessageContext());
result.Should().NotBeNull();
- result!.Should().BeEquivalentTo(new GetIntentResultResponse() { Error = ResolveError.IntentDeliveryFailed });
+ result!.Should().BeEquivalentTo(new GetIntentResultResponse {Error = ResolveError.IntentDeliveryFailed});
}
[Fact]
@@ -575,24 +581,24 @@ public async Task GetIntentResult_succeeds_with_context()
await _fdc3.StartAsync(CancellationToken.None);
var originFdc3InstanceId = Guid.NewGuid().ToString();
var context = new Context("test");
- var target = await _mockModuleLoader.Object.StartModule(new("appId4"));
+ var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = int.MaxValue,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4",
- Selected = false,
- Context = new Context("context2"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = int.MaxValue,
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4",
+ Selected = false,
+ Context = new Context("context2"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
+ };
var raiseIntentResult = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
raiseIntentResult.Should().NotBeNull();
raiseIntentResult!.AppMetadata.Should().HaveCount(1);
- var storeIntentRequest = new StoreIntentResultRequest()
+ var storeIntentRequest = new StoreIntentResultRequest
{
MessageId = raiseIntentResult.MessageId!,
Intent = "intentMetadata4",
@@ -605,11 +611,12 @@ public async Task GetIntentResult_succeeds_with_context()
storeResult.Should().NotBeNull();
storeResult!.Should().BeEquivalentTo(StoreIntentResultResponse.Success());
- var getIntentResultRequest = new GetIntentResultRequest()
+ var getIntentResultRequest = new GetIntentResultRequest
{
MessageId = raiseIntentResult.MessageId!,
Intent = "intentMetadata4",
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId1", InstanceId = raiseIntentResult.AppMetadata!.First().InstanceId! }
+ TargetAppIdentifier = new AppIdentifier
+ {AppId = "appId1", InstanceId = raiseIntentResult.AppMetadata!.First().InstanceId!}
};
var result = await _fdc3.HandleGetIntentResult(getIntentResultRequest, new MessageContext());
@@ -624,24 +631,24 @@ public async Task GetIntentResult_succeeds_with_channel()
var originFdc3InstanceId = Guid.NewGuid().ToString();
var channelType = ChannelType.User;
var channelId = "dummyChannelId";
- var target = await _mockModuleLoader.Object.StartModule(new("appId4"));
+ var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var raiseIntentRequest =new RaiseIntentRequest()
- {
- MessageId = int.MaxValue,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4",
- Selected = false,
- Context = new Context("context2"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = int.MaxValue,
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4",
+ Selected = false,
+ Context = new Context("context2"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
+ };
var raiseIntentResult = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
raiseIntentResult.Should().NotBeNull();
raiseIntentResult!.AppMetadata.Should().HaveCount(1);
- var storeIntentRequest = new StoreIntentResultRequest()
+ var storeIntentRequest = new StoreIntentResultRequest
{
MessageId = raiseIntentResult.MessageId!,
Intent = "intentMetadata4",
@@ -655,16 +662,18 @@ public async Task GetIntentResult_succeeds_with_channel()
storeResult.Should().NotBeNull();
storeResult!.Should().BeEquivalentTo(StoreIntentResultResponse.Success());
- var getIntentResultRequest = new GetIntentResultRequest()
+ var getIntentResultRequest = new GetIntentResultRequest
{
MessageId = raiseIntentResult.MessageId!,
Intent = "intentMetadata4",
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId1", InstanceId = raiseIntentResult.AppMetadata!.First().InstanceId! }
+ TargetAppIdentifier = new AppIdentifier
+ {AppId = "appId1", InstanceId = raiseIntentResult.AppMetadata!.First().InstanceId!}
};
var result = await _fdc3.HandleGetIntentResult(getIntentResultRequest, new MessageContext());
result.Should().NotBeNull();
- result!.Should().BeEquivalentTo(GetIntentResultResponse.Success(channelType: channelType, channelId: channelId));
+ result!.Should()
+ .BeEquivalentTo(GetIntentResultResponse.Success(channelType: channelType, channelId: channelId));
}
[Fact]
@@ -673,24 +682,24 @@ public async Task GetIntentResult_succeeds_with_voidResult()
await _fdc3.StartAsync(CancellationToken.None);
var originFdc3InstanceId = Guid.NewGuid().ToString();
- var target = await _mockModuleLoader.Object.StartModule(new("appId4"));
+ var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = int.MaxValue,
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4",
- Selected = false,
- Context = new Context("context2"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = int.MaxValue,
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4",
+ Selected = false,
+ Context = new Context("context2"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
+ };
var raiseIntentResult = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
raiseIntentResult.Should().NotBeNull();
raiseIntentResult!.AppMetadata.Should().HaveCount(1);
- var storeIntentRequest = new StoreIntentResultRequest()
+ var storeIntentRequest = new StoreIntentResultRequest
{
MessageId = raiseIntentResult.MessageId!,
Intent = "intentMetadata4",
@@ -703,11 +712,12 @@ public async Task GetIntentResult_succeeds_with_voidResult()
storeResult.Should().NotBeNull();
storeResult!.Should().BeEquivalentTo(StoreIntentResultResponse.Success());
- var getIntentResultRequest = new GetIntentResultRequest()
+ var getIntentResultRequest = new GetIntentResultRequest
{
MessageId = raiseIntentResult.MessageId!,
Intent = "intentMetadata4",
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId1", InstanceId = raiseIntentResult.AppMetadata!.First().InstanceId! }
+ TargetAppIdentifier = new AppIdentifier
+ {AppId = "appId1", InstanceId = raiseIntentResult.AppMetadata!.First().InstanceId!}
};
var result = await _fdc3.HandleGetIntentResult(getIntentResultRequest, new MessageContext());
@@ -718,7 +728,7 @@ public async Task GetIntentResult_succeeds_with_voidResult()
[Fact]
public async Task AddIntentListener_fails_due_no_payload()
{
- var result = await _fdc3.HandleAddIntentListener(null, new());
+ var result = await _fdc3.HandleAddIntentListener(request: null, new MessageContext());
result.Should().NotBeNull();
result!.Should().BeEquivalentTo(IntentListenerResponse.Failure(Fdc3DesktopAgentErrors.PayloadNull));
}
@@ -726,14 +736,14 @@ public async Task AddIntentListener_fails_due_no_payload()
[Fact]
public async Task AddIntentListener_fails_due_missing_id()
{
- var request = new IntentListenerRequest()
+ var request = new IntentListenerRequest
{
Intent = "dummy",
Fdc3InstanceId = Guid.NewGuid().ToString(),
State = SubscribeState.Unsubscribe
};
- var result = await _fdc3.HandleAddIntentListener(request, new());
+ var result = await _fdc3.HandleAddIntentListener(request, new MessageContext());
result.Should().NotBeNull();
result!.Should().BeEquivalentTo(IntentListenerResponse.Failure(Fdc3DesktopAgentErrors.MissingId));
}
@@ -751,35 +761,40 @@ public async Task AddIntentListener_subscribes_to_existing_raised_intent()
var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "intentMetadataCustom",
- Selected = false,
- Context = new Context("contextCustom"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = 1,
+ Fdc3InstanceId = originFdc3InstanceId,
+ Intent = "intentMetadataCustom",
+ Selected = false,
+ Context = new Context("contextCustom"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
+ };
var raiseIntentResult = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
raiseIntentResult.Should().NotBeNull();
raiseIntentResult!.AppMetadata.Should().HaveCount(1);
- raiseIntentResult!.AppMetadata!.First()!.AppId.Should().Be("appId4");
- raiseIntentResult!.AppMetadata!.First()!.InstanceId.Should().Be(targetFdc3InstanceId);
+ raiseIntentResult.AppMetadata!.First()!.AppId.Should().Be("appId4");
+ raiseIntentResult.AppMetadata!.First()!.InstanceId.Should().Be(targetFdc3InstanceId);
- var addIntentListenerRequest = new IntentListenerRequest()
- {
- Intent = "intentMetadataCustom",
- Fdc3InstanceId = targetFdc3InstanceId,
- State = SubscribeState.Subscribe
- };
+ var addIntentListenerRequest = new IntentListenerRequest
+ {
+ Intent = "intentMetadataCustom",
+ Fdc3InstanceId = targetFdc3InstanceId,
+ State = SubscribeState.Subscribe
+ };
- var addIntentListenerResult = await _fdc3.HandleAddIntentListener(addIntentListenerRequest, new MessageContext());
+ var addIntentListenerResult =
+ await _fdc3.HandleAddIntentListener(addIntentListenerRequest, new MessageContext());
addIntentListenerResult.Should().NotBeNull();
addIntentListenerResult!.Stored.Should().BeTrue();
_mockMessageRouter.Verify(
- _ => _.PublishAsync(Fdc3Topic.RaiseIntentResolution("intentMetadataCustom", targetFdc3InstanceId), It.IsAny(), It.IsAny(), It.IsAny()));
+ _ => _.PublishAsync(
+ Fdc3Topic.RaiseIntentResolution("intentMetadataCustom", targetFdc3InstanceId),
+ It.IsAny(),
+ It.IsAny(),
+ It.IsAny()));
}
[Fact]
@@ -795,35 +810,40 @@ public async Task AddIntentListener_subscribes()
var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var addIntentListenerRequest = new IntentListenerRequest()
- {
- Intent = "intentMetadataCustom",
- Fdc3InstanceId = targetFdc3InstanceId,
- State = SubscribeState.Subscribe
- };
+ var addIntentListenerRequest = new IntentListenerRequest
+ {
+ Intent = "intentMetadataCustom",
+ Fdc3InstanceId = targetFdc3InstanceId,
+ State = SubscribeState.Subscribe
+ };
- var addIntentListenerResult = await _fdc3.HandleAddIntentListener(addIntentListenerRequest, new MessageContext());
+ var addIntentListenerResult =
+ await _fdc3.HandleAddIntentListener(addIntentListenerRequest, new MessageContext());
addIntentListenerResult.Should().NotBeNull();
addIntentListenerResult!.Stored.Should().BeTrue();
- var raiseIntentRequest = new RaiseIntentRequest()
- {
- MessageId = 1,
- Fdc3InstanceId = originFdc3InstanceId,
- Intent = "intentMetadataCustom",
- Selected = false,
- Context = new Context("contextCustom"),
- TargetAppIdentifier = new AppIdentifier() { AppId = "appId4", InstanceId = targetFdc3InstanceId }
- };
+ var raiseIntentRequest = new RaiseIntentRequest
+ {
+ MessageId = 1,
+ Fdc3InstanceId = originFdc3InstanceId,
+ Intent = "intentMetadataCustom",
+ Selected = false,
+ Context = new Context("contextCustom"),
+ TargetAppIdentifier = new AppIdentifier {AppId = "appId4", InstanceId = targetFdc3InstanceId}
+ };
var raiseIntentResult = await _fdc3.HandleRaiseIntent(raiseIntentRequest, new MessageContext());
raiseIntentResult.Should().NotBeNull();
raiseIntentResult!.AppMetadata.Should().HaveCount(1);
- raiseIntentResult!.AppMetadata!.First()!.AppId.Should().Be("appId4");
- raiseIntentResult!.AppMetadata!.First()!.InstanceId.Should().Be(targetFdc3InstanceId);
+ raiseIntentResult!.AppMetadata!.First().AppId.Should().Be("appId4");
+ raiseIntentResult!.AppMetadata!.First().InstanceId.Should().Be(targetFdc3InstanceId);
_mockMessageRouter.Verify(
- _ => _.PublishAsync(Fdc3Topic.RaiseIntentResolution("intentMetadataCustom", targetFdc3InstanceId), It.IsAny(), It.IsAny(), It.IsAny()));
+ _ => _.PublishAsync(
+ Fdc3Topic.RaiseIntentResolution("intentMetadataCustom", targetFdc3InstanceId),
+ It.IsAny(),
+ It.IsAny(),
+ It.IsAny()));
}
[Fact]
@@ -838,32 +858,31 @@ public async Task AddIntentListener_unsubscribes()
var target = await _mockModuleLoader.Object.StartModule(new StartRequest("appId4"));
var targetFdc3InstanceId = Fdc3InstanceIdRetriever.Get(target);
- var addIntentListenerRequest = new IntentListenerRequest()
- {
- Intent = "intentMetadataCustom",
- Fdc3InstanceId = targetFdc3InstanceId,
- State = SubscribeState.Subscribe
- };
+ var addIntentListenerRequest = new IntentListenerRequest
+ {
+ Intent = "intentMetadataCustom",
+ Fdc3InstanceId = targetFdc3InstanceId,
+ State = SubscribeState.Subscribe
+ };
- var addIntentListenerResult = await _fdc3.HandleAddIntentListener(addIntentListenerRequest, new MessageContext());
+ var addIntentListenerResult =
+ await _fdc3.HandleAddIntentListener(addIntentListenerRequest, new MessageContext());
addIntentListenerResult.Should().NotBeNull();
addIntentListenerResult!.Stored.Should().BeTrue();
- addIntentListenerRequest = new IntentListenerRequest()
- {
- Intent = "intentMetadataCustom",
- Fdc3InstanceId = targetFdc3InstanceId,
- State = SubscribeState.Unsubscribe
- };
+ addIntentListenerRequest = new IntentListenerRequest
+ {
+ Intent = "intentMetadataCustom",
+ Fdc3InstanceId = targetFdc3InstanceId,
+ State = SubscribeState.Unsubscribe
+ };
addIntentListenerResult = await _fdc3.HandleAddIntentListener(addIntentListenerRequest, new MessageContext());
addIntentListenerResult.Should().NotBeNull();
addIntentListenerResult!.Stored.Should().BeFalse();
- addIntentListenerResult!.Error.Should().BeNull();
+ addIntentListenerResult.Error.Should().BeNull();
}
- private FindChannelRequest FindTestChannel => new FindChannelRequest() { ChannelId = "testChannel", ChannelType = ChannelType.User };
-
[Theory]
[ClassData(typeof(FindIntentTheoryData))]
@@ -899,278 +918,288 @@ public async Task FindIntentsByContext_edge_case_tests(FindIntentsByContextTestC
result!.Should().BeEquivalentTo(testCase.ExpectedResponse);
}
- public async Task InitializeAsync()
- {
- await _fdc3.StartAsync(CancellationToken.None);
- }
-
- public async Task DisposeAsync()
- {
- await _fdc3.StopAsync(CancellationToken.None);
- }
-
public class FindIntentsByContextTheoryData : TheoryData
{
public FindIntentsByContextTheoryData()
{
// Returning one AppIntent with one app by just passing Context
- AddRow(new FindIntentsByContextTestCase()
- {
- Request = new FindIntentsByContextRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Context = new Context("contextCustom")
- },//This relates to the appId4 only
- ExpectedResponse = new FindIntentsByContextResponse()
+ AddRow(
+ new FindIntentsByContextTestCase
{
- AppIntents = new[]
+ Request = new FindIntentsByContextRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Context = new Context("contextCustom")
+ }, //This relates to the appId4 only
+ ExpectedResponse = new FindIntentsByContextResponse
{
- new AppIntent()
+ AppIntents = new[]
{
- Intent = new Protocol.IntentMetadata () { Name = "intentMetadataCustom", DisplayName = "intentMetadataCustom" },
- Apps = new []
+ new AppIntent
{
- new AppMetadata(){ AppId ="appId4", Name = "app4", ResultType = null }
+ Intent = new IntentMetadata
+ {Name = "intentMetadataCustom", DisplayName = "intentMetadataCustom"},
+ Apps = new[]
+ {
+ new AppMetadata {AppId = "appId4", Name = "app4", ResultType = null}
+ }
}
}
- }
- },
- ExpectedAppIntentsCount = 1
- });
+ },
+ ExpectedAppIntentsCount = 1
+ });
// Returning one AppIntent with multiple app by just passing Context
- AddRow(new FindIntentsByContextTestCase()
- {
- Request = new FindIntentsByContextRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Context = new Context("context2")
- }, //This relates to the appId4, appId5, appId6,
- ExpectedResponse = new FindIntentsByContextResponse()
+ AddRow(
+ new FindIntentsByContextTestCase
{
- AppIntents = new[]
+ Request = new FindIntentsByContextRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Context = new Context("context2")
+ }, //This relates to the appId4, appId5, appId6,
+ ExpectedResponse = new FindIntentsByContextResponse
{
- new AppIntent()
+ AppIntents = new[]
{
- Intent = new Protocol.IntentMetadata () { Name = "intentMetadata4", DisplayName = "displayName4" },
- Apps = new AppMetadata[]
+ new AppIntent
{
- new() { AppId = "appId4", Name = "app4", ResultType = null },
- new() { AppId = "appId5", Name = "app5", ResultType = "resultType" },
- new() { AppId = "appId6", Name = "app6", ResultType = "resultType" }
+ Intent = new IntentMetadata {Name = "intentMetadata4", DisplayName = "displayName4"},
+ Apps = new AppMetadata[]
+ {
+ new() {AppId = "appId4", Name = "app4", ResultType = null},
+ new() {AppId = "appId5", Name = "app5", ResultType = "resultType"},
+ new() {AppId = "appId6", Name = "app6", ResultType = "resultType"}
+ }
}
}
- }
- },
- ExpectedAppIntentsCount = 1
- });
-
- // Returning multiple appIntent by just passing Context
- AddRow(new FindIntentsByContextTestCase()
- {
- Request = new FindIntentsByContextRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Context = new Context("context9")
- },//This relates to the wrongappId9 and an another wrongAppId9 with 2 individual IntentMetadata
- ExpectedResponse = new FindIntentsByContextResponse()
+ },
+ ExpectedAppIntentsCount = 1
+ });
+
+ // Returning multiple appIntents by just passing Context
+ AddRow(
+ new FindIntentsByContextTestCase
{
- AppIntents = new[]
+ Request = new FindIntentsByContextRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Context = new Context("context9")
+ }, //This relates to the wrongappId9 and an another wrongAppId9 with 2 individual IntentMetadata
+ ExpectedResponse = new FindIntentsByContextResponse
{
- new AppIntent()
+ AppIntents = new[]
{
- Intent = new Protocol.IntentMetadata () { Name = "intentMetadata9", DisplayName = "displayName9" },
- Apps = new []
+ new AppIntent
{
- new AppMetadata()
+ Intent = new IntentMetadata {Name = "intentMetadata9", DisplayName = "displayName9"},
+ Apps = new[]
{
- AppId = "wrongappId9", Name = "app9", ResultType = "resultWrongApp"
- },
- }
- },
- new AppIntent()
- {
- Intent = new Protocol.IntentMetadata () { Name = "intentMetadata10", DisplayName = "displayName10" },
- Apps = new []
+ new AppMetadata
+ {
+ AppId = "wrongappId9", Name = "app9", ResultType = "resultWrongApp"
+ }
+ }
+ },
+ new AppIntent
{
- new AppMetadata(){ AppId = "appId11", Name = "app11", ResultType = "channel" },
- }
- },
- new AppIntent()
- {
- Intent = new Protocol.IntentMetadata () { Name = "intentMetadata11", DisplayName = "displayName11" },
- Apps = new []
+ Intent = new IntentMetadata {Name = "intentMetadata10", DisplayName = "displayName10"},
+ Apps = new[]
+ {
+ new AppMetadata
+ {AppId = "appId11", Name = "app11", ResultType = "channel"}
+ }
+ },
+ new AppIntent
{
- new AppMetadata() { AppId = "appId12", Name = "app12", ResultType = "resultWrongApp"},
+ Intent = new IntentMetadata {Name = "intentMetadata11", DisplayName = "displayName11"},
+ Apps = new[]
+ {
+ new AppMetadata {AppId = "appId12", Name = "app12", ResultType = "resultWrongApp"}
+ }
}
}
- }
- },
- ExpectedAppIntentsCount = 3
- });
+ },
+ ExpectedAppIntentsCount = 3
+ });
// Returning error no apps found by just passing Context
- AddRow(new FindIntentsByContextTestCase()
- {
- Request = new FindIntentsByContextRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Context = new Context("noAppShouldReturn")
- },// no app should have this context type
- ExpectedResponse = new FindIntentsByContextResponse()
+ AddRow(
+ new FindIntentsByContextTestCase
{
- Error = ResolveError.NoAppsFound
- },
- ExpectedAppIntentsCount = 0
- });
+ Request = new FindIntentsByContextRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Context = new Context("noAppShouldReturn")
+ }, // no app should have this context type
+ ExpectedResponse = new FindIntentsByContextResponse
+ {
+ Error = ResolveError.NoAppsFound
+ },
+ ExpectedAppIntentsCount = 0
+ });
// Returning one AppIntent with one app by ResultType
- AddRow(new FindIntentsByContextTestCase()
- {
- Request = new FindIntentsByContextRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Context = new Context("context2"), //This relates to multiple appId
- ResultType = "resultType"
- },
- ExpectedResponse = new FindIntentsByContextResponse()
+ AddRow(
+ new FindIntentsByContextTestCase
{
- AppIntents = new[]
+ Request = new FindIntentsByContextRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Context = new Context("context2"), //This relates to multiple appId
+ ResultType = "resultType"
+ },
+ ExpectedResponse = new FindIntentsByContextResponse
{
- new AppIntent(){
- Intent = new Protocol.IntentMetadata () { Name = "intentMetadata4", DisplayName = "displayName4" }, // it should just return appId5
- Apps = new []
+ AppIntents = new[]
+ {
+ new AppIntent
{
- new AppMetadata(){ AppId = "appId5", Name = "app5", ResultType = "resultType" }
+ Intent = new IntentMetadata
+ {
+ Name = "intentMetadata4", DisplayName = "displayName4"
+ }, // it should just return appId5
+ Apps = new[]
+ {
+ new AppMetadata
+ {AppId = "appId5", Name = "app5", ResultType = "resultType"}
+ }
}
}
- }
- },
- ExpectedAppIntentsCount = 1
- });
+ },
+ ExpectedAppIntentsCount = 1
+ });
// Returning one AppIntent with multiple apps by ResultType
- AddRow(new FindIntentsByContextTestCase()
- {
- Request = new FindIntentsByContextRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Context = new Context("context2"), //This relates to multiple appId
- ResultType = "resultType"
- },
- ExpectedResponse = new FindIntentsByContextResponse()
+ AddRow(
+ new FindIntentsByContextTestCase
{
- AppIntents = new[]
+ Request = new FindIntentsByContextRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Context = new Context("context2"), //This relates to multiple appId
+ ResultType = "resultType"
+ },
+ ExpectedResponse = new FindIntentsByContextResponse
{
- new AppIntent()
+ AppIntents = new[]
{
- Intent = new Protocol.IntentMetadata () { Name = "intentMetadata4", DisplayName = "displayName4" },
- Apps = new[]
+ new AppIntent
{
- new AppMetadata(){ AppId ="appId5", Name = "app5", ResultType = "resultType" },
- new AppMetadata(){ AppId ="appId6", Name = "app6", ResultType = "resultType" }
+ Intent = new IntentMetadata {Name = "intentMetadata4", DisplayName = "displayName4"},
+ Apps = new[]
+ {
+ new AppMetadata
+ {AppId = "appId5", Name = "app5", ResultType = "resultType"},
+ new AppMetadata {AppId = "appId6", Name = "app6", ResultType = "resultType"}
+ }
}
- },
- }
- },
- ExpectedAppIntentsCount = 1
- });
-
- // Returning multiple AppIntent by ResultType
- AddRow(new FindIntentsByContextTestCase()
- {
- Request = new FindIntentsByContextRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Context = new Context("context9"), //This relates to multiple appId
- ResultType = "resultWrongApp"
- },
- ExpectedResponse = new FindIntentsByContextResponse()
+ }
+ },
+ ExpectedAppIntentsCount = 1
+ });
+
+ // Returning multiple AppIntents by ResultType
+ AddRow(
+ new FindIntentsByContextTestCase
{
- AppIntents = new[]
+ Request = new FindIntentsByContextRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Context = new Context("context9"), //This relates to multiple appId
+ ResultType = "resultWrongApp"
+ },
+ ExpectedResponse = new FindIntentsByContextResponse
{
- new AppIntent()
+ AppIntents = new[]
{
- Intent = new Protocol.IntentMetadata () { Name = "intentMetadata9", DisplayName = "displayName9" },
- Apps = new []
+ new AppIntent
{
- new AppMetadata() { AppId = "wrongappId9", Name = "app9", ResultType = "resultWrongApp" },
- }
- },
- new AppIntent()
- {
- Intent = new Protocol.IntentMetadata () { Name = "intentMetadata11", DisplayName = "displayName11" },
- Apps = new []
+ Intent = new IntentMetadata {Name = "intentMetadata9", DisplayName = "displayName9"},
+ Apps = new[]
+ {
+ new AppMetadata
+ {AppId = "wrongappId9", Name = "app9", ResultType = "resultWrongApp"}
+ }
+ },
+ new AppIntent
{
- new AppMetadata() { AppId = "appId12", Name = "app12", ResultType = "resultWrongApp" }
+ Intent = new IntentMetadata {Name = "intentMetadata11", DisplayName = "displayName11"},
+ Apps = new[]
+ {
+ new AppMetadata {AppId = "appId12", Name = "app12", ResultType = "resultWrongApp"}
+ }
}
}
- }
- },
- ExpectedAppIntentsCount = 2
- });
+ },
+ ExpectedAppIntentsCount = 2
+ });
// Returning no apps found error by using ResultType
- AddRow(new FindIntentsByContextTestCase()
- {
- Request = new FindIntentsByContextRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Context = new Context("context9"), //This relates to multiple appId
- ResultType = "noAppShouldReturn"
- },
- ExpectedResponse = new FindIntentsByContextResponse()
+ AddRow(
+ new FindIntentsByContextTestCase
{
- Error = ResolveError.NoAppsFound
- },
- ExpectedAppIntentsCount = 0
- });
+ Request = new FindIntentsByContextRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Context = new Context("context9"), //This relates to multiple appId
+ ResultType = "noAppShouldReturn"
+ },
+ ExpectedResponse = new FindIntentsByContextResponse
+ {
+ Error = ResolveError.NoAppsFound
+ },
+ ExpectedAppIntentsCount = 0
+ });
// Returning intent delivery error
- AddRow(new FindIntentsByContextTestCase()
- {
- Request = null,
- ExpectedResponse = new FindIntentsByContextResponse()
+ AddRow(
+ new FindIntentsByContextTestCase
{
- Error = ResolveError.IntentDeliveryFailed
- },
- ExpectedAppIntentsCount = 0
- });
+ Request = null,
+ ExpectedResponse = new FindIntentsByContextResponse
+ {
+ Error = ResolveError.IntentDeliveryFailed
+ },
+ ExpectedAppIntentsCount = 0
+ });
// Returning all the apps that are using the ResultType by adding fdc3.nothing.
- AddRow(new FindIntentsByContextTestCase()
- {
- Request = new FindIntentsByContextRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Context = new Context(ContextTypes.Nothing),
- ResultType = "resultWrongApp"
- },
- ExpectedResponse = new FindIntentsByContextResponse()
+ AddRow(
+ new FindIntentsByContextTestCase
{
- AppIntents = new[]
+ Request = new FindIntentsByContextRequest
{
- new AppIntent()
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Context = new Context(ContextTypes.Nothing),
+ ResultType = "resultWrongApp"
+ },
+ ExpectedResponse = new FindIntentsByContextResponse
+ {
+ AppIntents = new[]
{
- Intent = new Protocol.IntentMetadata () { Name = "intentMetadata9", DisplayName = "displayName9" },
- Apps = new []
+ new AppIntent
{
- new AppMetadata() { AppId = "wrongappId9", Name = "app9", ResultType = "resultWrongApp" },
- }
- },
+ Intent = new IntentMetadata {Name = "intentMetadata9", DisplayName = "displayName9"},
+ Apps = new[]
+ {
+ new AppMetadata
+ {AppId = "wrongappId9", Name = "app9", ResultType = "resultWrongApp"}
+ }
+ },
- new AppIntent()
- {
- Intent = new Protocol.IntentMetadata () { Name = "intentMetadata11", DisplayName = "displayName11" },
- Apps = new []
+ new AppIntent
{
- new AppMetadata() { AppId = "appId12", Name = "app12", ResultType = "resultWrongApp" }
+ Intent = new IntentMetadata {Name = "intentMetadata11", DisplayName = "displayName11"},
+ Apps = new[]
+ {
+ new AppMetadata {AppId = "appId12", Name = "app12", ResultType = "resultWrongApp"}
+ }
}
- },
- }
- },
- ExpectedAppIntentsCount = 2
- });
+ }
+ },
+ ExpectedAppIntentsCount = 2
+ });
}
}
@@ -1185,34 +1214,15 @@ private class FindIntentTheoryData : TheoryData
{
public FindIntentTheoryData()
{
- //As per the documentation : https://github.com/morganstanley/fdc3-dotnet/blob/main/src/Fdc3/IIntentMetadata.cs
- //name is unique for the intents, so it should be unique for every app, or the app should have the same intentMetadata?
- //if so we should return multiple appIntents and do not return error message for the client.
- //We have setup a test case for wrongappId9 which contains wrongly setted up intentMetadata.
AddRow(
- new FindIntentTestCase()
+ new FindIntentTestCase
{
ExpectedAppCount = 0,
- ExpectedResponse = new FindIntentResponse()
- {
- Error = ResolveError.IntentDeliveryFailed
- },
- Request = new FindIntentRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata8"
- }
- });
-
- AddRow(
- new FindIntentTestCase()
- {
- ExpectedAppCount = 0,
- ExpectedResponse = new FindIntentResponse()
+ ExpectedResponse = new FindIntentResponse
{
Error = ResolveError.NoAppsFound
},
- Request = new FindIntentRequest()
+ Request = new FindIntentRequest
{
Fdc3InstanceId = Guid.NewGuid().ToString(),
Intent = "intentMetadata2",
@@ -1221,198 +1231,207 @@ public FindIntentTheoryData()
});
AddRow(
- new FindIntentTestCase()
+ new FindIntentTestCase
{
ExpectedAppCount = 0,
- ExpectedResponse = new FindIntentResponse()
+ ExpectedResponse = new FindIntentResponse
{
Error = ResolveError.IntentDeliveryFailed
},
Request = null
});
- AddRow(new FindIntentTestCase()
- {
- Request = new FindIntentRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata7",
- Context = new Context("context8"),
- ResultType = "resultType2"
- },
- ExpectedResponse = new FindIntentResponse()
+ AddRow(
+ new FindIntentTestCase
{
- AppIntent = new AppIntent()
+ Request = new FindIntentRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata7",
+ Context = new Context("context8"),
+ ResultType = "resultType2"
+ },
+ ExpectedResponse = new FindIntentResponse
{
- Intent = new Protocol.IntentMetadata() { Name = "intentMetadat7", DisplayName = "displayName7" },
- Apps = new[]
+ AppIntent = new AppIntent
{
- new AppMetadata(){ AppId = "appId7", Name = "app7", ResultType = "resultType2" }
+ Intent = new IntentMetadata {Name = "intentMetadata7", DisplayName = "displayName7"},
+ Apps = new[]
+ {
+ new AppMetadata
+ {AppId = "appId7", Name = "app7", ResultType = "resultType2"}
+ }
}
- }
- },
- ExpectedAppCount = 1
- });
+ },
+ ExpectedAppCount = 1
+ });
- AddRow(new FindIntentTestCase()
- {
- Request = new FindIntentRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4",
- Context = new Context("context2"),
- ResultType = "resultType"
- },
- ExpectedResponse = new FindIntentResponse()
+ AddRow(
+ new FindIntentTestCase
{
- AppIntent = new AppIntent()
+ Request = new FindIntentRequest
{
- Intent = new Protocol.IntentMetadata() { Name = "intentMetadata4", DisplayName = "displayName4" },
- Apps = new[]
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4",
+ Context = new Context("context2"),
+ ResultType = "resultType"
+ },
+ ExpectedResponse = new FindIntentResponse
+ {
+ AppIntent = new AppIntent
{
- new AppMetadata() { AppId = "appId5", Name = "app5", ResultType = "resultType" },
- new AppMetadata() { AppId = "appId6", Name = "app6", ResultType = "resultType"},
-
+ Intent = new IntentMetadata {Name = "intentMetadata4", DisplayName = "displayName4"},
+ Apps = new[]
+ {
+ new AppMetadata {AppId = "appId5", Name = "app5", ResultType = "resultType"},
+ new AppMetadata {AppId = "appId6", Name = "app6", ResultType = "resultType"}
+ }
}
- }
- },
- ExpectedAppCount = 2
- });
+ },
+ ExpectedAppCount = 2
+ });
- AddRow(new FindIntentTestCase()
- {
- Request = new FindIntentRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata7",
- ResultType = "resultType2"
- },
- ExpectedResponse = new FindIntentResponse()
+ AddRow(
+ new FindIntentTestCase
{
- AppIntent = new AppIntent()
+ Request = new FindIntentRequest
{
- Intent = new Protocol.IntentMetadata() { Name = "intentMetadat7", DisplayName = "displayName7" },
- Apps = new[]
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata7",
+ ResultType = "resultType2"
+ },
+ ExpectedResponse = new FindIntentResponse
+ {
+ AppIntent = new AppIntent
{
- new AppMetadata() { AppId = "appId7", Name = "app7", ResultType = "resultType2"}
+ Intent = new IntentMetadata {Name = "intentMetadata7", DisplayName = "displayName7"},
+ Apps = new[]
+ {
+ new AppMetadata
+ {AppId = "appId7", Name = "app7", ResultType = "resultType2"}
+ }
}
- }
- },
- ExpectedAppCount = 1
- });
+ },
+ ExpectedAppCount = 1
+ });
- AddRow(new FindIntentTestCase()
- {
- Request = new FindIntentRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4",
- ResultType = "resultType"
- },
- ExpectedResponse = new FindIntentResponse()
+ AddRow(
+ new FindIntentTestCase
{
- AppIntent = new AppIntent()
+ Request = new FindIntentRequest
{
- Intent = new Protocol.IntentMetadata() { Name = "intentMetadata4", DisplayName = "displayName4" },
- Apps = new[]
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4",
+ ResultType = "resultType"
+ },
+ ExpectedResponse = new FindIntentResponse
+ {
+ AppIntent = new AppIntent
{
- new AppMetadata() { AppId = "appId5", Name = "app5", ResultType = "resultType" },
- new AppMetadata() { AppId = "appId6", Name = "app6", ResultType = "resultType" },
+ Intent = new IntentMetadata {Name = "intentMetadata4", DisplayName = "displayName4"},
+ Apps = new[]
+ {
+ new AppMetadata {AppId = "appId5", Name = "app5", ResultType = "resultType"},
+ new AppMetadata {AppId = "appId6", Name = "app6", ResultType = "resultType"}
+ }
}
- }
- },
- ExpectedAppCount = 2
- });
+ },
+ ExpectedAppCount = 2
+ });
- AddRow(new FindIntentTestCase()
- {
- Request = new FindIntentRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata1",
- Context = new Context("context1")
- },
- ExpectedResponse = new FindIntentResponse()
+ AddRow(
+ new FindIntentTestCase
{
- AppIntent = new AppIntent()
+ Request = new FindIntentRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata1",
+ Context = new Context("context1")
+ },
+ ExpectedResponse = new FindIntentResponse
{
- Intent = new Protocol.IntentMetadata() { Name = "intentMetadata1", DisplayName = "displayName1" },
- Apps = new[]
+ AppIntent = new AppIntent
{
- new AppMetadata() { AppId = "appId1", Name = "app1", ResultType = null }
+ Intent = new IntentMetadata {Name = "intentMetadata1", DisplayName = "displayName1"},
+ Apps = new[]
+ {
+ new AppMetadata {AppId = "appId1", Name = "app1", ResultType = null}
+ }
}
- }
- },
- ExpectedAppCount = 1
- });
+ },
+ ExpectedAppCount = 1
+ });
- AddRow(new FindIntentTestCase()
- {
- Request = new FindIntentRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4",
- Context = new Context("context2")
- },
- ExpectedResponse = new FindIntentResponse()
+ AddRow(
+ new FindIntentTestCase
{
- AppIntent = new AppIntent()
+ Request = new FindIntentRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4",
+ Context = new Context("context2")
+ },
+ ExpectedResponse = new FindIntentResponse
{
- Intent = new Protocol.IntentMetadata() { Name = "intentMetadata4", DisplayName = "displayName4" },
- Apps = new AppMetadata[]
+ AppIntent = new AppIntent
+ {
+ Intent = new IntentMetadata {Name = "intentMetadata4", DisplayName = "displayName4"},
+ Apps = new AppMetadata[]
{
- new() { AppId = "appId4", Name = "app4", ResultType = null },
- new() { AppId = "appId5", Name = "app5", ResultType = "resultType" },
- new() { AppId = "appId6", Name = "app6", ResultType = "resultType" }
+ new() {AppId = "appId4", Name = "app4", ResultType = null},
+ new() {AppId = "appId5", Name = "app5", ResultType = "resultType"},
+ new() {AppId = "appId6", Name = "app6", ResultType = "resultType"}
}
- }
- },
- ExpectedAppCount = 3
- });
+ }
+ },
+ ExpectedAppCount = 3
+ });
- AddRow(new FindIntentTestCase()
- {
- Request = new FindIntentRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata2"
- },
- ExpectedResponse = new FindIntentResponse()
+ AddRow(
+ new FindIntentTestCase
{
- AppIntent = new AppIntent()
+ Request = new FindIntentRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata2"
+ },
+ ExpectedResponse = new FindIntentResponse
{
- Intent = new Protocol.IntentMetadata() { Name = "intentMetadata2", DisplayName = "displayName2" },
- Apps = new[]
+ AppIntent = new AppIntent
{
- new AppMetadata() { AppId = "appId2", Name = "app2", ResultType = null }
+ Intent = new IntentMetadata {Name = "intentMetadata2", DisplayName = "displayName2"},
+ Apps = new[]
+ {
+ new AppMetadata {AppId = "appId2", Name = "app2", ResultType = null}
+ }
}
- }
- },
- ExpectedAppCount = 1
- });
+ },
+ ExpectedAppCount = 1
+ });
- AddRow(new FindIntentTestCase()
- {
- Request = new FindIntentRequest()
- {
- Fdc3InstanceId = Guid.NewGuid().ToString(),
- Intent = "intentMetadata4"
- },
- ExpectedResponse = new FindIntentResponse()
+ AddRow(
+ new FindIntentTestCase
{
- AppIntent = new AppIntent()
+ Request = new FindIntentRequest
+ {
+ Fdc3InstanceId = Guid.NewGuid().ToString(),
+ Intent = "intentMetadata4"
+ },
+ ExpectedResponse = new FindIntentResponse
{
- Intent = new Protocol.IntentMetadata() { Name = "intentMetadata4", DisplayName = "displayName4" },
- Apps = new AppMetadata[]
+ AppIntent = new AppIntent
+ {
+ Intent = new IntentMetadata {Name = "intentMetadata4", DisplayName = "displayName4"},
+ Apps = new AppMetadata[]
{
- new() { AppId = "appId4", Name = "app4", ResultType = null },
- new() { AppId = "appId5", Name = "app5", ResultType = "resultType" },
- new() { AppId = "appId6", Name = "app6", ResultType = "resultType" }
+ new() {AppId = "appId4", Name = "app4", ResultType = null},
+ new() {AppId = "appId5", Name = "app5", ResultType = "resultType"},
+ new() {AppId = "appId6", Name = "app6", ResultType = "resultType"}
}
- }
- },
- ExpectedAppCount = 3
- });
+ }
+ },
+ ExpectedAppCount = 3
+ });
}
}
@@ -1422,4 +1441,4 @@ public class FindIntentTestCase
internal FindIntentResponse ExpectedResponse { get; set; }
public int ExpectedAppCount { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/TestUtils/appDirectorySample.json b/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/TestUtils/appDirectorySample.json
index 4e30d8dcb..812256270 100644
--- a/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/TestUtils/appDirectorySample.json
+++ b/src/fdc3/dotnet/DesktopAgent/tests/DesktopAgent.Tests/TestUtils/appDirectorySample.json
@@ -145,7 +145,7 @@
"intents": {
"listensFor": {
"intentMetadata7": {
- "name": "intentMetadat7",
+ "name": "intentMetadata7",
"displayName": "displayName7",
"contexts": [
"context8"
@@ -175,7 +175,7 @@
"intents": {
"listensFor": {
"intentMetadata8": {
- "name": "intentMetadat8",
+ "name": "intentMetadata8",
"displayName": "displayName8",
"contexts": [
"context7"
@@ -240,7 +240,7 @@
"interop": {
"intents": {
"listensFor": {
- "intentMetadata10": {
+ "intentMetadata11": {
"name": "intentMetadata11",
"displayName": "displayName11",
"contexts": [
diff --git a/src/fdc3/js/composeui-fdc3/src/infrastructure/messages/Fdc3RaiseIntentRequest.ts b/src/fdc3/js/composeui-fdc3/src/infrastructure/messages/Fdc3RaiseIntentRequest.ts
index e9e56324e..d8c7947fd 100644
--- a/src/fdc3/js/composeui-fdc3/src/infrastructure/messages/Fdc3RaiseIntentRequest.ts
+++ b/src/fdc3/js/composeui-fdc3/src/infrastructure/messages/Fdc3RaiseIntentRequest.ts
@@ -21,7 +21,6 @@ export class Fdc3RaiseIntentRequest {
public readonly intent: string,
public readonly selected: boolean,
public readonly context: Context,
- public readonly targetAppIdentifier?: AppIdentifier,
- public readonly error?: string) {
+ public readonly targetAppIdentifier?: AppIdentifier) {
}
}
\ No newline at end of file