diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml index eb72ecfa45..616ce94ffa 100644 --- a/.github/codeql/codeql-config.yml +++ b/.github/codeql/codeql-config.yml @@ -31,3 +31,5 @@ paths-ignore: - '**/*.spec.ts' - frontend/src/mockServiceWorker.js - tx-backend/src/main/resources/application-integration-spring-boot.yml + - docs/src/post-processing + - tx-backend/target/generated-sources/jsonschema2pojo diff --git a/CHANGELOG.md b/CHANGELOG.md index fd72072bec..e7a46ca8f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,18 @@ _**For better traceability add the corresponding GitHub issue number in each cha ## [UNRELEASED - DD.MM.YYYY] +### Added +- #606 Added error message into notifications on failure + +### Changed + +- #709 Bumped spring-core from 6.0.17 to 6.1.5 +- #606 cucumber tests retry on error +- #606 refactored response model to only be used by common model package tx-models + + +### Removed + ## [10.7.0 - 18.03.2024] ### Added diff --git a/pom.xml b/pom.xml index da3a8e26e5..080f253566 100644 --- a/pom.xml +++ b/pom.xml @@ -38,25 +38,25 @@ SPDX-License-Identifier: Apache-2.0 3.1.9 - 6.0.17 + 6.1.5 17 ${java.version} ${java.version} UTF-8 org.eclipse.tractusx.traceability.TraceabilityApplication + 3.1.9 + 3.11.0 7.0.1 3.3.2 2.2.4 3.3.1 - 3.11.0 1.12.0 3.1.1 0.8.11 3.3.0 9.0.9 4.8.3.0 - 3.1.3 3.4.5 3.10.0.2594 3.2.5 @@ -64,7 +64,7 @@ SPDX-License-Identifier: Apache-2.0 4.0.0-M11 0.2.1 - 1.0.2 + 1.1.0 9.37.3 2.2.13 2.5.8 @@ -180,14 +180,15 @@ SPDX-License-Identifier: Apache-2.0 - dash-licenses-snapshots - https://repo.eclipse.org/content/repositories/dash-licenses-snapshots/ + dash-licenses-releases + https://repo.eclipse.org/content/repositories/dash-licenses-releases/ - true + false + @@ -285,6 +286,9 @@ SPDX-License-Identifier: Apache-2.0 org.apache.maven.plugins maven-compiler-plugin ${compiler-plugin.version} + + true + org.jacoco diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 79515e02b0..02fadf8fda 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -37,8 +37,18 @@ "description" : "The endpoint returns a result of BPN EDC URL mappings.", "operationId" : "getBpnEdcs", "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -62,18 +72,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -92,8 +92,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -102,8 +102,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -154,23 +154,18 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -179,8 +174,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -189,8 +184,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -199,8 +194,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -209,8 +204,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -219,12 +214,17 @@ } } }, - "500" : { - "description" : "Internal server error.", + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } @@ -271,23 +271,18 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -296,8 +291,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -306,8 +301,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -316,8 +311,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -326,8 +321,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -336,12 +331,17 @@ } } }, - "500" : { - "description" : "Internal server error.", + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } @@ -385,8 +385,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -395,28 +395,28 @@ } } }, - "200" : { - "description" : "Returns submodel payload", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "type" : "string" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Returns submodel payload", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "type" : "string" } } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -435,8 +435,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -445,8 +445,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -502,8 +502,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -512,11 +512,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -525,8 +522,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -545,8 +542,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Ok." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -555,11 +555,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -568,6 +565,9 @@ } } }, + "204" : { + "description" : "No Content." + }, "404" : { "description" : "Not found.", "content" : { @@ -607,8 +607,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -617,8 +617,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -627,8 +627,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -647,8 +647,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -657,22 +657,22 @@ } } }, - "201" : { - "description" : "Created.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "201" : { + "description" : "Created.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/QualityNotificationIdResponse" } } } @@ -727,11 +727,8 @@ "required" : true }, "responses" : { - "204" : { - "description" : "No content." - }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -740,11 +737,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -753,8 +747,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -773,8 +767,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Ok." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -783,8 +780,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -802,6 +799,9 @@ } } } + }, + "204" : { + "description" : "No content." } }, "security" : [ @@ -843,11 +843,8 @@ "required" : true }, "responses" : { - "204" : { - "description" : "No content." - }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -856,11 +853,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -869,8 +863,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -889,8 +883,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Ok." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -899,8 +896,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -918,6 +915,9 @@ } } } + }, + "204" : { + "description" : "No content." } }, "security" : [ @@ -949,8 +949,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -959,11 +959,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -972,8 +969,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -992,8 +989,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Ok." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1002,11 +1002,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1015,6 +1012,9 @@ } } }, + "204" : { + "description" : "No content." + }, "404" : { "description" : "Not found.", "content" : { @@ -1055,8 +1055,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1065,11 +1065,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1078,8 +1075,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1098,8 +1095,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Ok." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1108,11 +1108,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1121,6 +1118,9 @@ } } }, + "204" : { + "description" : "No content." + }, "404" : { "description" : "Not found.", "content" : { @@ -1160,18 +1160,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1190,26 +1180,6 @@ } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -1331,13 +1301,7 @@ "type" : "string", "example" : "2099-02-21T21:27:10.734950Z" }, - "errorMessage" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "EDC not reachable" - }, - "qualityNotificationMessages" : { + "messages" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/QualityNotificationMessageResponse" @@ -1360,6 +1324,36 @@ } } }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "404" : { "description" : "Not found.", "content" : { @@ -1399,8 +1393,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1409,8 +1403,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1419,8 +1413,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1439,8 +1433,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1449,22 +1443,22 @@ } } }, - "201" : { - "description" : "Created.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/CreateNotificationContractResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "201" : { + "description" : "Created.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/CreateNotificationContractResponse" } } } @@ -1508,108 +1502,108 @@ "required" : true }, "responses" : { - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Internal server error." + "message" : "Too many requests." } } } } }, - "200" : { - "description" : "Ok.", + "415" : { + "description" : "Unsupported media type.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "description" : "PageResults", - "items" : { - "$ref" : "#/components/schemas/PageResultContractResponse" + "type" : "string", + "example" : { + "message" : "Unsupported media type." } } } } }, - "404" : { - "description" : "Not found.", + "200" : { + "description" : "Ok.", "content" : { "application/json" : { "schema" : { - "type" : "string", - "example" : { - "message" : "Not found." + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "description" : "PageResults", + "items" : { + "$ref" : "#/components/schemas/PageResultContractResponse" } } } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Authorization failed." + "message" : "Internal server error." } } } } }, - "415" : { - "description" : "Unsupported media type.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Unsupported media type." + "message" : "Bad request." } } } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Bad request." + "message" : "Forbidden." } } } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Forbidden." + "message" : "Not found." } } } } }, - "429" : { - "description" : "Too many requests.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Too many requests." + "message" : "Authorization failed." } } } @@ -1656,8 +1650,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1666,8 +1660,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1676,8 +1670,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1696,8 +1690,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1706,14 +1700,8 @@ } } }, - "200" : { - "description" : "OK.", - "content" : { - "application/json" : {} - } - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1722,6 +1710,12 @@ } } }, + "200" : { + "description" : "OK.", + "content" : { + "application/json" : {} + } + }, "204" : { "description" : "No Content." }, @@ -1772,8 +1766,8 @@ } }, "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1782,8 +1776,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1792,8 +1786,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1812,8 +1806,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1822,29 +1816,29 @@ } } }, - "200" : { - "description" : "OK.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "204" : { + "description" : "No Content." + }, + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportResponse" } } } }, - "204" : { - "description" : "No Content." - }, "404" : { "description" : "Not found.", "content" : { @@ -1884,8 +1878,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1894,8 +1888,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1904,8 +1898,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1924,8 +1918,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1934,11 +1928,8 @@ } } }, - "201" : { - "description" : "Created." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1947,6 +1938,9 @@ } } }, + "201" : { + "description" : "Created." + }, "404" : { "description" : "Not found.", "content" : { @@ -1986,18 +1980,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2016,8 +2000,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2026,8 +2010,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2036,8 +2020,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2238,6 +2222,16 @@ } } }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "404" : { "description" : "Not found.", "content" : { @@ -2277,8 +2271,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2287,8 +2281,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2297,8 +2291,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2317,8 +2311,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2327,11 +2321,8 @@ } } }, - "201" : { - "description" : "Created." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2340,6 +2331,9 @@ } } }, + "201" : { + "description" : "Created." + }, "404" : { "description" : "Not found.", "content" : { @@ -2379,8 +2373,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2389,8 +2383,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2399,8 +2393,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2419,8 +2413,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2621,16 +2625,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "404" : { "description" : "Not found.", "content" : { @@ -2670,8 +2664,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2680,8 +2674,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2690,8 +2684,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2710,8 +2704,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2720,22 +2714,22 @@ } } }, - "201" : { - "description" : "Created.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "201" : { + "description" : "Created.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/QualityNotificationIdResponse" } } } @@ -2790,11 +2784,8 @@ "required" : true }, "responses" : { - "204" : { - "description" : "No content." - }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2803,8 +2794,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2813,8 +2804,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2833,8 +2824,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2843,8 +2834,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2862,6 +2853,9 @@ } } } + }, + "204" : { + "description" : "No content." } }, "security" : [ @@ -2903,11 +2897,8 @@ "required" : true }, "responses" : { - "204" : { - "description" : "No content." - }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2916,11 +2907,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2929,8 +2917,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2949,8 +2937,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Ok." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2959,8 +2950,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2978,7 +2969,10 @@ } } } - } + }, + "204" : { + "description" : "No content." + } }, "security" : [ { @@ -3009,8 +3003,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3019,11 +3013,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3032,8 +3023,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3052,8 +3043,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Ok." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3062,11 +3056,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3075,6 +3066,9 @@ } } }, + "204" : { + "description" : "No content." + }, "404" : { "description" : "Not found.", "content" : { @@ -3115,8 +3109,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3125,11 +3119,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3138,8 +3129,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3158,8 +3149,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Ok." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3168,11 +3162,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3181,6 +3172,9 @@ } } }, + "204" : { + "description" : "No content." + }, "404" : { "description" : "Not found.", "content" : { @@ -3220,6 +3214,46 @@ "required" : true }, "responses" : { + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "429" : { "description" : "Too many requests.", "content" : { @@ -3230,6 +3264,16 @@ } } }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -3346,13 +3390,7 @@ "type" : "string", "example" : "2099-02-21T21:27:10.734950Z" }, - "errorMessage" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "EDC not reachable" - }, - "qualityNotificationMessages" : { + "messages" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/QualityNotificationMessageResponse" @@ -3364,56 +3402,6 @@ } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "404" : { "description" : "Not found.", "content" : { @@ -3453,6 +3441,16 @@ } ], "responses" : { + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the assets found", "content" : { @@ -3640,18 +3638,8 @@ } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3660,8 +3648,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3680,8 +3668,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3690,8 +3678,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3747,8 +3735,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3757,8 +3745,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3767,8 +3755,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3787,8 +3775,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3984,16 +3982,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "404" : { "description" : "Not found.", "content" : { @@ -4033,8 +4021,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4230,8 +4218,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4240,8 +4228,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4260,8 +4248,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4270,8 +4258,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4327,8 +4315,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4337,8 +4325,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4347,8 +4335,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4367,8 +4355,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4377,8 +4365,18 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4573,16 +4571,6 @@ } } } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -4603,8 +4591,8 @@ "description" : "The endpoint Triggers reload of shell descriptors.", "operationId" : "reload", "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4613,8 +4601,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4623,8 +4611,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4643,8 +4631,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4653,11 +4641,8 @@ } } }, - "202" : { - "description" : "Created registry reload job." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4666,6 +4651,9 @@ } } }, + "202" : { + "description" : "Created registry reload job." + }, "404" : { "description" : "Not found.", "content" : { @@ -4695,28 +4683,28 @@ "description" : "The endpoint returns all policies .", "operationId" : "policy", "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns the policies", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/PolicyResponse" } } } }, - "200" : { - "description" : "Returns the policies", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PolicyResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4725,8 +4713,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4745,8 +4733,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4755,8 +4743,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4805,8 +4793,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4815,24 +4803,18 @@ } } }, - "200" : { - "description" : "OK.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : -2147483648, - "type" : "array", - "description" : "Investigations", - "items" : { - "$ref" : "#/components/schemas/InvestigationResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4841,8 +4823,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4851,18 +4833,24 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : -2147483648, + "type" : "array", + "description" : "Investigations", + "items" : { + "$ref" : "#/components/schemas/InvestigationResponse" + } } } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4871,8 +4859,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4950,8 +4938,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4960,23 +4948,18 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4985,8 +4968,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4995,8 +4978,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5005,18 +4988,23 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5064,8 +5052,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5074,8 +5062,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5084,8 +5072,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5104,8 +5092,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5114,8 +5102,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5164,8 +5152,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5174,18 +5162,18 @@ } } }, - "200" : { - "description" : "OK.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportReportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5194,8 +5182,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5204,8 +5192,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5214,8 +5202,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5224,12 +5212,12 @@ } } }, - "500" : { - "description" : "Internal server error.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportReportResponse" } } } @@ -5284,8 +5272,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5294,8 +5282,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5304,8 +5292,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5314,8 +5302,38 @@ } } }, - "200" : { - "description" : "Returns the paged result found for Asset", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "200" : { + "description" : "Returns the paged result found for Asset", "content" : { "application/json" : { "schema" : { @@ -5506,36 +5524,6 @@ } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "404" : { "description" : "Not found.", "content" : { @@ -5577,7 +5565,7 @@ { "name" : "size", "in" : "query", - "required" : true, + "required" : false, "schema" : { "type" : "integer", "format" : "int32" @@ -5586,7 +5574,7 @@ { "name" : "startWith", "in" : "query", - "required" : true, + "required" : false, "schema" : { "type" : "string" } @@ -5594,7 +5582,7 @@ { "name" : "owner", "in" : "query", - "required" : true, + "required" : false, "schema" : { "type" : "string", "enum" : [ @@ -5607,8 +5595,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5617,23 +5605,18 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5642,8 +5625,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5652,8 +5635,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5662,18 +5645,23 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5721,6 +5709,46 @@ } ], "responses" : { + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "429" : { "description" : "Too many requests.", "content" : { @@ -5731,6 +5759,16 @@ } } }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the asset by childId", "content" : { @@ -5918,56 +5956,6 @@ } } }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "404" : { "description" : "Not found.", "content" : { @@ -6015,56 +6003,6 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -6257,6 +6195,26 @@ } } }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "500" : { "description" : "Internal server error.", "content" : { @@ -6267,6 +6225,36 @@ } } }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "404" : { "description" : "Not found.", "content" : { @@ -6338,8 +6326,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6348,23 +6336,18 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6373,8 +6356,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6383,8 +6366,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6393,18 +6376,23 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6442,33 +6430,18 @@ "description" : "The endpoint returns a map for assets consumed by the map.", "operationId" : "assetsCountryMap", "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Returns the assets found", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6477,8 +6450,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6497,8 +6470,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6507,8 +6480,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6526,6 +6499,21 @@ } } } + }, + "200" : { + "description" : "Returns the assets found", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } } }, "security" : [ @@ -6556,8 +6544,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6566,8 +6554,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -6576,8 +6564,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6596,8 +6584,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6793,16 +6791,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "404" : { "description" : "Not found.", "content" : { @@ -6843,8 +6831,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6853,23 +6841,18 @@ } } }, - "200" : { - "description" : "OK.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Alerts", - "items" : { - "$ref" : "#/components/schemas/AlertResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -6878,8 +6861,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -6888,18 +6871,23 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "type" : "array", + "description" : "Alerts", + "items" : { + "$ref" : "#/components/schemas/AlertResponse" + } } } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -6908,8 +6896,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -6987,8 +6975,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -6997,23 +6985,18 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -7022,8 +7005,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -7032,8 +7015,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -7042,18 +7025,23 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -7091,8 +7079,8 @@ "description" : "Deletes all submodels from the system.", "operationId" : "deleteSubmodels", "responses" : { - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -7101,11 +7089,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -7114,8 +7099,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -7134,8 +7119,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Ok." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -7144,11 +7132,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -7157,6 +7142,9 @@ } } }, + "204" : { + "description" : "No Content." + }, "404" : { "description" : "Not found.", "content" : { @@ -7199,8 +7187,8 @@ "200" : { "description" : "Okay" }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -7209,8 +7197,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -7219,8 +7207,11 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "204" : { + "description" : "Deleted." + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -7229,9 +7220,6 @@ } } }, - "204" : { - "description" : "Deleted." - }, "400" : { "description" : "Bad request.", "content" : { @@ -7242,8 +7230,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -7252,8 +7240,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -7305,6 +7293,18 @@ } } }, + "ErrorResponse" : { + "type" : "object", + "properties" : { + "message" : { + "maxLength" : 1000, + "minLength" : 0, + "pattern" : "^.*$", + "type" : "string", + "example" : "Access Denied" + } + } + }, "BpnEdcMappingResponse" : { "type" : "object", "properties" : { @@ -7318,18 +7318,6 @@ } } }, - "ErrorResponse" : { - "type" : "object", - "properties" : { - "message" : { - "maxLength" : 1000, - "minLength" : 0, - "pattern" : "^.*$", - "type" : "string", - "example" : "Access Denied" - } - } - }, "StartQualityNotificationRequest" : { "required" : [ "severity" @@ -7578,13 +7566,7 @@ "type" : "string", "example" : "2099-02-21T21:27:10.734950Z" }, - "errorMessage" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "EDC not reachable" - }, - "qualityNotificationMessages" : { + "messages" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/QualityNotificationMessageResponse" @@ -7657,7 +7639,10 @@ ] }, "errorMessage" : { - "type" : "string" + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "EDC not reachable" } } }, @@ -8168,13 +8153,7 @@ "type" : "string", "example" : "2099-02-21T21:27:10.734950Z" }, - "errorMessage" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "EDC not reachable" - }, - "qualityNotificationMessages" : { + "messages" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/QualityNotificationMessageResponse" diff --git a/tx-backend/pom.xml b/tx-backend/pom.xml index ff88a211bc..b36b20f403 100644 --- a/tx-backend/pom.xml +++ b/tx-backend/pom.xml @@ -444,16 +444,6 @@ SPDX-License-Identifier: Apache-2.0 - - - dash-licenses-snapshots - https://repo.eclipse.org/content/repositories/dash-licenses-snapshots/ - - true - - - - traceability-app-${project.version} @@ -586,6 +576,10 @@ SPDX-License-Identifier: Apache-2.0 org.apache.maven.plugins maven-compiler-plugin + ${compiler-plugin.version} + + true + diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/rest/AssetAsBuiltController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/rest/AssetAsBuiltController.java index cfb2e258b7..0a6a83271a 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/rest/AssetAsBuiltController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/rest/AssetAsBuiltController.java @@ -374,7 +374,7 @@ public Map assetsCountryMap() { mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)))}) @GetMapping("/{assetId}") - public AssetAsBuiltResponse getAssetById(@PathVariable String assetId) { + public AssetAsBuiltResponse getAssetById(@PathVariable("assetId") String assetId) { return AssetAsBuiltResponseMapper.from(assetBaseService.getAssetById(assetId)); } @@ -430,7 +430,7 @@ public AssetAsBuiltResponse getAssetById(@PathVariable String assetId) { mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)))}) @GetMapping("/*/children/{childId}") - public AssetAsBuiltResponse getAssetChildId(@PathVariable String childId) { + public AssetAsBuiltResponse getAssetChildId(@PathVariable("childId") String childId) { return AssetAsBuiltResponseMapper.from(assetBaseService.getAssetByChildId(childId)); } @@ -485,7 +485,7 @@ public AssetAsBuiltResponse getAssetChildId(@PathVariable String childId) { mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)))}) @PatchMapping("/{assetId}") - public AssetAsBuiltResponse updateAsset(@PathVariable String assetId, @Valid @RequestBody UpdateAssetRequest updateAssetRequest) { + public AssetAsBuiltResponse updateAsset(@PathVariable("assetId") String assetId, @Valid @RequestBody UpdateAssetRequest updateAssetRequest) { return AssetAsBuiltResponseMapper.from( assetBaseService.updateQualityType(assetId, QualityTypeMapper.toDomain(updateAssetRequest.qualityType()))); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asplanned/rest/AssetAsPlannedController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asplanned/rest/AssetAsPlannedController.java index 78f88a0664..293c930076 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asplanned/rest/AssetAsPlannedController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asplanned/rest/AssetAsPlannedController.java @@ -31,6 +31,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; +import jakarta.ws.rs.DefaultValue; import jakarta.ws.rs.QueryParam; import org.eclipse.tractusx.traceability.assets.application.asbuilt.mapper.QualityTypeMapper; import org.eclipse.tractusx.traceability.assets.application.asplanned.mapper.AssetAsPlannedFieldMapper; @@ -51,6 +52,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; @@ -250,7 +252,7 @@ public PageResult assets(OwnPageable pageable, SearchCri mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)))}) @GetMapping("distinctFilterValues") - public List distinctFilterValues(@QueryParam("fieldName") String fieldName, @QueryParam("size") Integer size, @QueryParam("startWith") String startWith, @QueryParam("owner") Owner owner) { + public List distinctFilterValues(@RequestParam("fieldName") String fieldName, @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "startWith", required = false) String startWith, @RequestParam(value = "owner", required = false) Owner owner) { return assetService.getDistinctFilterValues(fieldMapper.mapRequestFieldName(fieldName), startWith, size, owner); } @@ -305,7 +307,7 @@ public List distinctFilterValues(@QueryParam("fieldName") String fieldNa mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)))}) @GetMapping("/{assetId}") - public AssetAsPlannedResponse getAssetById(@PathVariable String assetId) { + public AssetAsPlannedResponse getAssetById(@PathVariable("assetId") String assetId) { return AssetAsPlannedResponseMapper.from(assetService.getAssetById(assetId)); } @@ -416,7 +418,7 @@ public AssetAsPlannedResponse getAssetByChildId(@PathVariable("childId") String mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)))}) @PatchMapping("/{assetId}") - public AssetAsPlannedResponse updateAsset(@PathVariable String assetId, @Valid @RequestBody UpdateAssetRequest updateAssetRequest) { + public AssetAsPlannedResponse updateAsset(@PathVariable("assetId") String assetId, @Valid @RequestBody UpdateAssetRequest updateAssetRequest) { return AssetAsPlannedResponseMapper.from( assetService.updateQualityType(assetId, QualityTypeMapper.toDomain(updateAssetRequest.qualityType()))); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsClient.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsClient.java index 4e62e4a92f..6226139f70 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsClient.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsClient.java @@ -34,6 +34,7 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.Payload; import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; import org.jetbrains.annotations.Nullable; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpEntity; @@ -47,6 +48,9 @@ import java.util.List; import java.util.UUID; +import static org.eclipse.tractusx.traceability.common.config.RestTemplateConfiguration.IRS_ADMIN_TEMPLATE; +import static org.eclipse.tractusx.traceability.common.config.RestTemplateConfiguration.IRS_REGULAR_TEMPLATE; + @Slf4j @Component public class IrsClient { @@ -60,8 +64,8 @@ public class IrsClient { @Value("${traceability.irsPoliciesPath}") String policiesPath = null; - public IrsClient(RestTemplate irsAdminTemplate, - RestTemplate irsRegularTemplate, + public IrsClient(@Qualifier(IRS_ADMIN_TEMPLATE) RestTemplate irsAdminTemplate, + @Qualifier(IRS_REGULAR_TEMPLATE) RestTemplate irsRegularTemplate, TraceabilityProperties traceabilityProperties) { this.irsAdminTemplate = irsAdminTemplate; this.irsRegularTemplate = irsRegularTemplate; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/bpn/application/rest/BpnMappingController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/bpn/application/rest/BpnMappingController.java index 52131cf11d..9b92f8e121 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/bpn/application/rest/BpnMappingController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/bpn/application/rest/BpnMappingController.java @@ -293,7 +293,7 @@ public List updateBpnEdcUrlMapping(@RequestBody @Valid @S schema = @Schema(implementation = ErrorResponse.class)))}) @DeleteMapping("/{bpn}") @ResponseStatus(HttpStatus.NO_CONTENT) - public void deleteBpnEdcUrlMapping(@PathVariable String bpn) { + public void deleteBpnEdcUrlMapping(@PathVariable("bpn") String bpn) { log.info("BpnEdcController [deleteBpnEdcUrlMapping]"); service.deleteBpnMapping(bpn); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/EdcConfiguration.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/EdcConfiguration.java index 0b57d477a8..5341aa8d20 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/EdcConfiguration.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/EdcConfiguration.java @@ -26,6 +26,7 @@ import org.eclipse.tractusx.irs.edc.client.policy.service.EdcPolicyDefinitionService; import org.eclipse.tractusx.irs.edc.client.transformer.EdcTransformer; import org.eclipse.tractusx.irs.registryclient.decentral.DigitalTwinRegistryCreateShellService; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.ConfigurationPropertiesScan; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -36,6 +37,9 @@ import org.springframework.web.client.RestTemplate; import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import static org.eclipse.tractusx.traceability.common.config.RestTemplateConfiguration.DIGITAL_TWIN_REGISTRY_CREATE_SHELL_REST_TEMPLATE; +import static org.eclipse.tractusx.traceability.common.config.RestTemplateConfiguration.EDC_ASSET_REST_TEMPLATE; + @Configuration @ConfigurationPropertiesScan(basePackages = "org.eclipse.tractusx.traceability.*") @EnableWebMvc @@ -52,22 +56,22 @@ public class EdcConfiguration { String shellDescriptorUrl; @Bean - public EdcAssetService edcAssetService(org.eclipse.tractusx.irs.edc.client.EdcConfiguration edcConfiguration, EdcTransformer edcTransformer, RestTemplate edcDtrAssetRestTemplate) { - return new EdcAssetService(edcTransformer, edcConfiguration, edcDtrAssetRestTemplate); + public EdcAssetService edcAssetService(org.eclipse.tractusx.irs.edc.client.EdcConfiguration edcConfiguration, EdcTransformer edcTransformer,@Qualifier(EDC_ASSET_REST_TEMPLATE) RestTemplate edcAssetRestTemplate) { + return new EdcAssetService(edcTransformer, edcConfiguration, edcAssetRestTemplate); } @Bean - public EdcPolicyDefinitionService edcPolicyDefinitionService(org.eclipse.tractusx.irs.edc.client.EdcConfiguration edcConfiguration, RestTemplate edcDtrAssetRestTemplate) { - return new EdcPolicyDefinitionService(edcConfiguration, edcDtrAssetRestTemplate); + public EdcPolicyDefinitionService edcPolicyDefinitionService(org.eclipse.tractusx.irs.edc.client.EdcConfiguration edcConfiguration,@Qualifier(EDC_ASSET_REST_TEMPLATE) RestTemplate edcAssetRestTemplate) { + return new EdcPolicyDefinitionService(edcConfiguration, edcAssetRestTemplate); } @Bean - public EdcContractDefinitionService edcContractDefinitionService(org.eclipse.tractusx.irs.edc.client.EdcConfiguration edcConfiguration, RestTemplate edcDtrAssetRestTemplate) { - return new EdcContractDefinitionService(edcConfiguration, edcDtrAssetRestTemplate); + public EdcContractDefinitionService edcContractDefinitionService(org.eclipse.tractusx.irs.edc.client.EdcConfiguration edcConfiguration,@Qualifier(EDC_ASSET_REST_TEMPLATE) RestTemplate edcAssetRestTemplate) { + return new EdcContractDefinitionService(edcConfiguration, edcAssetRestTemplate); } @Bean - public DigitalTwinRegistryCreateShellService dtrCreateShellService(RestTemplate digitalTwinRegistryCreateShellRestTemplate) { + public DigitalTwinRegistryCreateShellService dtrCreateShellService(@Qualifier(DIGITAL_TWIN_REGISTRY_CREATE_SHELL_REST_TEMPLATE) RestTemplate digitalTwinRegistryCreateShellRestTemplate) { return new DigitalTwinRegistryCreateShellService(digitalTwinRegistryCreateShellRestTemplate, registryUrlWithPath + shellDescriptorUrl); } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java index d2140a4ca5..124aa58ee8 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java @@ -41,6 +41,7 @@ import org.eclipse.tractusx.traceability.common.request.exception.InvalidSortException; import org.eclipse.tractusx.traceability.common.security.TechnicalUserAuthorizationException; import org.eclipse.tractusx.traceability.contracts.domain.exception.ContractException; +import org.eclipse.tractusx.traceability.discovery.infrastructure.exception.DiscoveryFinderException; import org.eclipse.tractusx.traceability.qualitynotification.application.contract.model.CreateNotificationContractException; import org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertIllegalUpdate; @@ -116,6 +117,13 @@ ResponseEntity handleAssetNotFoundException(AssetNotFoundExceptio .body(new ErrorResponse(exception.getMessage())); } + @ExceptionHandler(DiscoveryFinderException.class) + ResponseEntity handleDiscoveryFinderException(DiscoveryFinderException exception) { + log.warn("handleDiscoveryFinderException", exception); + return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE) + .body(new ErrorResponse(exception.getMessage())); + } + @ExceptionHandler(PublishAssetException.class) ResponseEntity handlePublishAssetException(PublishAssetException exception) { log.warn("handlePublishAssetException", exception); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/JsonLdConfigurationTraceX.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/JsonLdConfigurationTraceX.java index 57170f8c97..1afa156c3c 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/JsonLdConfigurationTraceX.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/JsonLdConfigurationTraceX.java @@ -51,7 +51,7 @@ public class JsonLdConfigurationTraceX { public static final String NAMESPACE_TRACTUSX = "https://w3id.org/tractusx/v0.0.1/ns/"; public static final String NAMESPACE_DCT = "https://purl.org/dc/terms/"; - @Bean /* package */ TitaniumJsonLd titaniumJsonLdTraceX(final Monitor monitor) { + /* package */ TitaniumJsonLd titaniumJsonLdTraceX(final Monitor monitor) { final TitaniumJsonLd titaniumJsonLd = new TitaniumJsonLd(monitor); titaniumJsonLd.registerNamespace("odrl", JsonLdConfigurationTraceX.NAMESPACE_ODRL); titaniumJsonLd.registerNamespace("dct", NAMESPACE_DCT); @@ -62,7 +62,7 @@ public class JsonLdConfigurationTraceX { return titaniumJsonLd; } - @Bean /* package */ Monitor monitorTraceX() { + /* package */ Monitor monitorTraceX() { return new ConsoleMonitor(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/RestTemplateConfiguration.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/RestTemplateConfiguration.java index 87df042bca..c154069a01 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/RestTemplateConfiguration.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/RestTemplateConfiguration.java @@ -54,6 +54,16 @@ @Slf4j public class RestTemplateConfiguration { + public static final String EDC_REST_TEMPLATE = "edcRestTemplate"; + public static final String EDC_ASSET_REST_TEMPLATE = "edcDtrAssetRestTemplate"; + public static final String DIGITAL_TWIN_REGISTRY_CREATE_SHELL_REST_TEMPLATE = "digitalTwinRegistryCreateShellRestTemplate"; + public static final String EDC_NOTIFICATION_TEMPLATE = "edcNotificationTemplate"; + public static final String IRS_ADMIN_TEMPLATE = "irsAdminTemplate"; + public static final String IRS_REGULAR_TEMPLATE = "irsRegularTemplate"; + public static final String SUBMODEL_REST_TEMPLATE = "submodelRestTemplate"; + public static final String DIGITAL_TWIN_REGISTRY_REST_TEMPLATE = "digitalTwinRegistryRestTemplate"; + public static final String EDC_CLIENT_REST_TEMPLATE= "edcClientRestTemplate"; + private static final String EDC_API_KEY_HEADER_NAME = "X-Api-Key"; private static final String IRS_API_KEY_HEADER_NAME = "X-API-KEY"; @@ -62,7 +72,7 @@ public class RestTemplateConfiguration { /* RestTemplate used by trace x for the edc contracts used within the edc provider.*/ - @Bean + @Bean(EDC_REST_TEMPLATE) public RestTemplate edcRestTemplate(@Autowired EdcProperties edcProperties) { return new RestTemplateBuilder() .rootUri(edcProperties.getProviderEdcUrl()) @@ -72,7 +82,7 @@ public RestTemplate edcRestTemplate(@Autowired EdcProperties edcProperties) { .build(); } - @Bean + @Bean(EDC_ASSET_REST_TEMPLATE) public RestTemplate edcDtrAssetRestTemplate(@Autowired EdcProperties edcProperties) { return new RestTemplateBuilder() .rootUri(edcProperties.getProviderEdcUrl()) @@ -84,14 +94,14 @@ public RestTemplate edcDtrAssetRestTemplate(@Autowired EdcProperties edcProperti .build(); } - @Bean + @Bean(DIGITAL_TWIN_REGISTRY_CREATE_SHELL_REST_TEMPLATE) public RestTemplate digitalTwinRegistryCreateShellRestTemplate() { return new RestTemplateBuilder() .build(); } /* RestTemplate used by trace x for the notification transfer to the edc controlplane including edc api key*/ - @Bean + @Bean(EDC_NOTIFICATION_TEMPLATE) public RestTemplate edcNotificationTemplate(@Autowired EdcProperties edcProperties) { return new RestTemplateBuilder() .defaultHeader(EDC_API_KEY_HEADER_NAME, edcProperties.getApiAuthKey()) @@ -99,7 +109,7 @@ public RestTemplate edcNotificationTemplate(@Autowired EdcProperties edcProperti } /* RestTemplate used by trace x for the irs api with the admin api key*/ - @Bean + @Bean(IRS_ADMIN_TEMPLATE) public RestTemplate irsAdminTemplate(@Autowired TraceabilityProperties traceabilityProperties) { return new RestTemplateBuilder() .rootUri(traceabilityProperties.getIrsBase()) @@ -109,7 +119,7 @@ public RestTemplate irsAdminTemplate(@Autowired TraceabilityProperties traceabil } /* RestTemplate used by trace x for the irs api with the regular api key*/ - @Bean + @Bean(IRS_REGULAR_TEMPLATE) public RestTemplate irsRegularTemplate(@Autowired TraceabilityProperties traceabilityProperties) { return new RestTemplateBuilder() .rootUri(traceabilityProperties.getIrsBase()) @@ -120,7 +130,7 @@ public RestTemplate irsRegularTemplate(@Autowired TraceabilityProperties traceab } /* RestTemplate used by trace x for the submodel server*/ - @Bean + @Bean(SUBMODEL_REST_TEMPLATE) public RestTemplate submodelRestTemplate(@Autowired TraceabilityProperties traceabilityProperties, @Autowired FeignDefaultProperties feignDefaultProperties) { return new RestTemplateBuilder() .rootUri(traceabilityProperties.getSubmodelBase()) @@ -130,7 +140,7 @@ public RestTemplate submodelRestTemplate(@Autowired TraceabilityProperties trace } /* RestTemplate used by the digital twin registry client library*/ - @Bean + @Bean(DIGITAL_TWIN_REGISTRY_REST_TEMPLATE) public RestTemplate digitalTwinRegistryRestTemplate( final RestTemplateBuilder restTemplateBuilder, @Value("${digitalTwinRegistryClient.oAuthClientId}") final String clientRegistrationId) { @@ -141,7 +151,7 @@ public RestTemplate digitalTwinRegistryRestTemplate( } /* RestTemplate used by the edc client library*/ - @Bean + @Bean(EDC_CLIENT_REST_TEMPLATE) public RestTemplate edcClientRestTemplate() { return new RestTemplateBuilder() .build(); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/model/SecurityUtils.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/model/SecurityUtils.java index 4cc072bd5e..74c0ccf767 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/model/SecurityUtils.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/model/SecurityUtils.java @@ -69,17 +69,12 @@ public static StartQualityNotificationRequest sanitize(StartQualityNotificationR public static CloseQualityNotificationRequest sanitize(CloseQualityNotificationRequest closeInvestigationRequest) { String cleanReason = sanitize(closeInvestigationRequest.getReason()); - CloseQualityNotificationRequest cleanCloseInvestigationRequest = new CloseQualityNotificationRequest(); - cleanCloseInvestigationRequest.setReason(cleanReason); - return cleanCloseInvestigationRequest; + return CloseQualityNotificationRequest.builder().reason(cleanReason).build(); } public static UpdateQualityNotificationRequest sanitize(UpdateQualityNotificationRequest updateInvestigationRequest) { String cleanReason = sanitize(updateInvestigationRequest.getReason()); - UpdateQualityNotificationRequest cleanUpdateInvestigationRequest = new UpdateQualityNotificationRequest(); - cleanUpdateInvestigationRequest.setStatus(updateInvestigationRequest.getStatus()); - cleanUpdateInvestigationRequest.setReason(cleanReason); - return cleanUpdateInvestigationRequest; + return UpdateQualityNotificationRequest.builder().status(updateInvestigationRequest.getStatus()).reason(cleanReason).build(); } public static EDCNotification sanitize(EDCNotification edcNotification) { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/properties/EdcProperties.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/properties/EdcProperties.java index 3af860511f..6ef642c1a0 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/properties/EdcProperties.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/properties/EdcProperties.java @@ -21,14 +21,14 @@ package org.eclipse.tractusx.traceability.common.properties; import jakarta.validation.constraints.NotBlank; -import lombok.AllArgsConstructor; import lombok.Getter; +import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; -@AllArgsConstructor +@RequiredArgsConstructor @Getter -@ConfigurationProperties("edc") +@Configuration public class EdcProperties { @NotBlank diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/properties/FeignDefaultProperties.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/properties/FeignDefaultProperties.java index ebfc3b0d80..a4ed60f2a2 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/properties/FeignDefaultProperties.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/properties/FeignDefaultProperties.java @@ -21,15 +21,16 @@ package org.eclipse.tractusx.traceability.common.properties; -import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; -@ConfigurationProperties("feign.default") +@Configuration public class FeignDefaultProperties extends FeignProperties { - public FeignDefaultProperties(Long connectionTimeoutMillis, - Long readTimeoutMillis, - int maxIdleConnections, - Long keepAliveDurationMinutes) { + public FeignDefaultProperties(@Value("${feign.default.connectionTimeoutMillis}") Long connectionTimeoutMillis, + @Value("${feign.default.readTimeoutMillis}") Long readTimeoutMillis, + @Value("${feign.default.maxIdleConnections}") int maxIdleConnections, + @Value("${feign.default.keepAliveDurationMinutes}") Long keepAliveDurationMinutes) { super(connectionTimeoutMillis, readTimeoutMillis, maxIdleConnections, keepAliveDurationMinutes); } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/discovery/domain/service/DiscoveryServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/discovery/domain/service/DiscoveryServiceImpl.java index 2a83692fb9..e36ca98051 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/discovery/domain/service/DiscoveryServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/discovery/domain/service/DiscoveryServiceImpl.java @@ -22,9 +22,10 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.bpn.domain.service.BpnRepository; +import org.eclipse.tractusx.traceability.common.properties.EdcProperties; import org.eclipse.tractusx.traceability.discovery.domain.model.Discovery; import org.eclipse.tractusx.traceability.discovery.domain.repository.DiscoveryRepository; -import org.eclipse.tractusx.traceability.common.properties.EdcProperties; +import org.eclipse.tractusx.traceability.discovery.infrastructure.exception.DiscoveryFinderException; import org.jetbrains.annotations.NotNull; import org.springframework.stereotype.Component; @@ -50,17 +51,22 @@ public class DiscoveryServiceImpl implements DiscoveryService { @Override public Discovery getDiscoveryByBPN(String bpn) { List discoveryList = new ArrayList<>(); - Optional optionalDiscoveryFromDiscoveryService = getOptionalDiscoveryByBpnFromDiscoveryService(bpn); - optionalDiscoveryFromDiscoveryService.ifPresent(discovery -> { - discovery.setReceiverUrls( - discovery.getReceiverUrls().stream().map( - DiscoveryServiceImpl::removeTrailingSlash - ).toList() - ); - log.info("Retrieved discovery by bpn from edcDiscoveryService receiverUrls: {}, senderUrls: {}", discovery.getReceiverUrls().toString(), discovery.getSenderUrl()); - discoveryList.add(discovery); - }); - optionalDiscoveryFromDiscoveryService.ifPresent(discoveryList::add); + try { + Optional optionalDiscoveryFromDiscoveryService = getOptionalDiscoveryByBpnFromDiscoveryService(bpn); + optionalDiscoveryFromDiscoveryService.ifPresent(discovery -> { + discovery.setReceiverUrls( + discovery.getReceiverUrls().stream().map( + DiscoveryServiceImpl::removeTrailingSlash + ).toList() + ); + log.info("Retrieved discovery by bpn from edcDiscoveryService receiverUrls: {}, senderUrls: {}", discovery.getReceiverUrls().toString(), discovery.getSenderUrl()); + discoveryList.add(discovery); + }); + optionalDiscoveryFromDiscoveryService.ifPresent(discoveryList::add); + } catch (Exception e) { + throw new DiscoveryFinderException("DiscoverFinder not reachable."); + } + Optional optionalDiscoveryFromBpnDatabase = getOptionalDiscoveryFromBpnDatabase(bpn); optionalDiscoveryFromBpnDatabase.ifPresent(discovery -> log.info("Retrieved discovery by bpn from BPN Mapping Table receiverUrls: {}, senderUrls: {}", discovery.getReceiverUrls().toString(), discovery.getSenderUrl())); optionalDiscoveryFromBpnDatabase.ifPresent(discoveryList::add); diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationSideResponse.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/discovery/infrastructure/exception/DiscoveryFinderException.java similarity index 80% rename from tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationSideResponse.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/discovery/infrastructure/exception/DiscoveryFinderException.java index 57061da563..7d7978e6e6 100644 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationSideResponse.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/discovery/infrastructure/exception/DiscoveryFinderException.java @@ -16,11 +16,10 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ +package org.eclipse.tractusx.traceability.discovery.infrastructure.exception; -package org.eclipse.tractusx.traceability.test.tooling.rest.response; - -public enum QualityNotificationSideResponse { - SENDER, - RECEIVER; - +public class DiscoveryFinderException extends RuntimeException { + public DiscoveryFinderException(String message) { + super(message); + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java index fa47415ddb..2fdb24f7cb 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java @@ -259,7 +259,7 @@ public PageResult getAlerts(@Valid @RequestBody PageableFilterReq mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)))}) @GetMapping("/{alertId}") - public AlertResponse getAlert(@PathVariable Long alertId) { + public AlertResponse getAlert(@PathVariable("alertId") Long alertId) { log.info(API_LOG_START + "/{}", alertId); return AlertResponseMapper.from(alertService.find(alertId)); } @@ -323,7 +323,7 @@ public AlertResponse getAlert(@PathVariable Long alertId) { @PostMapping("/{alertId}/approve") @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") @ResponseStatus(HttpStatus.NO_CONTENT) - public void approveAlert(@PathVariable Long alertId) { + public void approveAlert(@PathVariable("alertId") Long alertId) { log.info(API_LOG_START + "/{}/approve", alertId); alertService.approve(alertId); } @@ -387,7 +387,7 @@ public void approveAlert(@PathVariable Long alertId) { @PostMapping("/{alertId}/cancel") @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") @ResponseStatus(HttpStatus.NO_CONTENT) - public void cancelAlert(@PathVariable Long alertId) { + public void cancelAlert(@PathVariable("alertId") Long alertId) { log.info(API_LOG_START + "/{}/cancel", alertId); alertService.cancel(alertId); } @@ -452,7 +452,7 @@ public void cancelAlert(@PathVariable Long alertId) { @PostMapping("/{alertId}/close") @ResponseStatus(HttpStatus.NO_CONTENT) public void closeAlert( - @PathVariable @ApiParam Long alertId, + @PathVariable("alertId") @ApiParam Long alertId, @Valid @RequestBody CloseQualityNotificationRequest closeAlertRequest) { CloseQualityNotificationRequest cleanCloseAlertRequest = sanitize(closeAlertRequest); log.info(API_LOG_START + "/{}/close with params {}", alertId, cleanCloseAlertRequest); @@ -516,7 +516,7 @@ public void closeAlert( @PostMapping("/{alertId}/update") @ResponseStatus(HttpStatus.NO_CONTENT) public void updateAlert( - @PathVariable Long alertId, + @PathVariable("alertId") Long alertId, @Valid @RequestBody UpdateQualityNotificationRequest updateAlertRequest) { UpdateQualityNotificationRequest cleanUpdateAlertRequest = sanitize(updateAlertRequest); validate(cleanUpdateAlertRequest); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java index 49aa4d522e..259062ba8c 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java @@ -258,7 +258,7 @@ public PageResult getInvestigations(@Valid @RequestBody P mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)))}) @GetMapping("/{investigationId}") - public InvestigationResponse getInvestigation(@PathVariable Long investigationId) { + public InvestigationResponse getInvestigation(@PathVariable("investigationId") Long investigationId) { log.info(API_LOG_START + "/{}", investigationId); return InvestigationResponseMapper.from(investigationService.find(investigationId)); } @@ -321,7 +321,7 @@ public InvestigationResponse getInvestigation(@PathVariable Long investigationId @PostMapping("/{investigationId}/approve") @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") @ResponseStatus(HttpStatus.NO_CONTENT) - public void approveInvestigation(@PathVariable Long investigationId) { + public void approveInvestigation(@PathVariable("investigationId") Long investigationId) { log.info(API_LOG_START + "/{}/approve", investigationId); investigationService.approve(investigationId); } @@ -384,7 +384,7 @@ public void approveInvestigation(@PathVariable Long investigationId) { @PostMapping("/{investigationId}/cancel") @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") @ResponseStatus(HttpStatus.NO_CONTENT) - public void cancelInvestigation(@PathVariable Long investigationId) { + public void cancelInvestigation(@PathVariable("investigationId") Long investigationId) { log.info(API_LOG_START + "/{}/cancel", investigationId); investigationService.cancel(investigationId); } @@ -446,7 +446,7 @@ public void cancelInvestigation(@PathVariable Long investigationId) { @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") @PostMapping("/{investigationId}/close") @ResponseStatus(HttpStatus.NO_CONTENT) - public void closeInvestigation(@PathVariable Long investigationId, @Valid @RequestBody CloseQualityNotificationRequest closeInvestigationRequest) { + public void closeInvestigation(@PathVariable("investigationId") Long investigationId, @Valid @RequestBody CloseQualityNotificationRequest closeInvestigationRequest) { CloseQualityNotificationRequest cleanCloseQualityNotificationRequest = sanitize(closeInvestigationRequest); log.info(API_LOG_START + "/{}/close with params {}", investigationId, cleanCloseQualityNotificationRequest); investigationService.update(investigationId, from(QualityNotificationStatusRequest.CLOSED), cleanCloseQualityNotificationRequest.getReason()); @@ -509,7 +509,7 @@ public void closeInvestigation(@PathVariable Long investigationId, @Valid @Reque @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") @PostMapping("/{investigationId}/update") @ResponseStatus(HttpStatus.NO_CONTENT) - public void updateInvestigation(@PathVariable Long investigationId, @Valid @RequestBody UpdateQualityNotificationRequest updateInvestigationRequest) { + public void updateInvestigation(@PathVariable("investigationId") Long investigationId, @Valid @RequestBody UpdateQualityNotificationRequest updateInvestigationRequest) { UpdateQualityNotificationRequest cleanUpdateQualityNotificationRequest = sanitize(updateInvestigationRequest); validate(cleanUpdateQualityNotificationRequest); log.info(API_LOG_START + "/{}/update with params {}", investigationId, cleanUpdateQualityNotificationRequest); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java index 7bb8432ff7..748f030c98 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java @@ -21,6 +21,7 @@ import lombok.Builder; import lombok.Data; import lombok.Getter; +import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.common.model.BPN; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationIllegalUpdate; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationStatusTransitionNotAllowed; @@ -28,10 +29,13 @@ import java.time.Instant; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.List; +import java.util.Optional; @Data @Builder(toBuilder = true) +@Slf4j public class QualityNotification { private BPN bpn; private QualityNotificationId notificationId; @@ -142,4 +146,35 @@ public boolean isActiveState() { return this.notificationStatus.isActiveState(); } + public List secondLatestNotifications() { + + Optional highestState = notifications.stream() + .max(Comparator.comparing(QualityNotificationMessage::getCreated)); + + if (highestState.isPresent()) { + QualityNotificationMessage highestMessage = highestState.get(); + QualityNotificationStatus highestStatus = highestMessage.getNotificationStatus(); + log.info("Highest status found: {}", highestStatus); + + Optional secondHighestState = notifications.stream() + .filter(message -> !message.getNotificationStatus().equals(highestStatus)) + .max(Comparator.comparing(QualityNotificationMessage::getCreated)); + + if (secondHighestState.isPresent()) { + log.info("Second highest status found: {}", secondHighestState.get().getNotificationStatus()); + return notifications.stream() + .filter(message -> message.getNotificationStatus().equals(secondHighestState.get().getNotificationStatus())) + .toList(); + } else { + log.info("No second highest status found. Returning notifications with highest status."); + return notifications.stream() + .filter(message -> message.getNotificationStatus().equals(highestStatus)) + .toList(); + } + } else { + log.warn("No notifications found. Returning empty list."); + return Collections.emptyList(); + } + } + } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/EdcNotificationServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/EdcNotificationServiceImpl.java index 6e7e930b1b..f7c98a05d5 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/EdcNotificationServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/EdcNotificationServiceImpl.java @@ -21,17 +21,19 @@ package org.eclipse.tractusx.traceability.qualitynotification.domain.base.service; +import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.common.config.AssetsAsyncConfig; import org.eclipse.tractusx.traceability.discovery.domain.model.Discovery; import org.eclipse.tractusx.traceability.discovery.domain.service.DiscoveryService; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.AlertRepository; +import org.eclipse.tractusx.traceability.discovery.infrastructure.exception.DiscoveryFinderException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.ContractNegotiationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.NoCatalogItemException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.NoEndpointDataReferenceException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.SendNotificationException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.springframework.context.annotation.Profile; @@ -39,6 +41,7 @@ import org.springframework.stereotype.Service; import java.util.List; +import java.util.Optional; import java.util.concurrent.CompletableFuture; import static org.apache.commons.collections4.ListUtils.emptyIfNull; @@ -47,15 +50,16 @@ @Slf4j @RequiredArgsConstructor @Service +@Transactional(dontRollbackOn = DiscoveryFinderException.class) @Profile(NOT_INTEGRATION_TESTS) public class EdcNotificationServiceImpl implements EdcNotificationService { private final InvestigationsEDCFacade edcFacade; private final DiscoveryService discoveryService; + private final InvestigationRepository investigationRepository; @Override @Async(value = AssetsAsyncConfig.UPDATE_NOTIFICATION_EXECUTOR) - public CompletableFuture asyncNotificationMessageExecutor(QualityNotificationMessage message) { log.info("::asyncNotificationExecutor::message {}", message); Discovery discovery = discoveryService.getDiscoveryByBPN(message.getSendTo()); @@ -84,20 +88,44 @@ public CompletableFuture asyncNotificationMessageExe return CompletableFuture.completedFuture(null); } - // #606 TODO add within the catch a service call which updates a message error message field with the error message from the exception so that we can execute a retry within the e2e testing. private boolean handleSendingNotification(QualityNotificationMessage message, String senderEdcUrl, String receiverUrl) { try { edcFacade.startEdcTransfer(message, receiverUrl, senderEdcUrl); return true; } catch (NoCatalogItemException e) { log.warn("Could not send message to {} no catalog item found. ", receiverUrl, e); + enrichQualityNotificationByError(e, message); } catch (SendNotificationException e) { log.warn("Could not send message to {} ", receiverUrl, e); + enrichQualityNotificationByError(e, message); } catch (NoEndpointDataReferenceException e) { log.warn("Could not send message to {} no endpoint data reference found", receiverUrl, e); + enrichQualityNotificationByError(e, message); } catch (ContractNegotiationException e) { log.warn("Could not send message to {} could not negotiate contract agreement", receiverUrl, e); + enrichQualityNotificationByError(e, message); } return false; } + + private void enrichQualityNotificationByError(Exception e, QualityNotificationMessage message) { + log.info("Retrieving quality notification by message id {}", message.getEdcNotificationId()); + + Optional optionalQualityNotificationById = investigationRepository.findByNotificationMessageId(message.getEdcNotificationId()); + log.info("Successfully executed retrieving quality notification by message id"); + if (optionalQualityNotificationById.isPresent()) { + log.info("Quality Notification for error message enrichment {}", optionalQualityNotificationById.get()); + optionalQualityNotificationById.get().getNotifications().forEach(message1 -> { + log.info("Message found {}", message1); + }); + optionalQualityNotificationById.get().secondLatestNotifications().forEach(qmMessage -> { + log.info("Message from second latest notification {}", qmMessage); + qmMessage.setErrorMessage(e.getMessage()); + }); + investigationRepository.updateErrorMessage(optionalQualityNotificationById.get()); + } else { + log.warn("Quality Notification NOT FOUND for error message enrichment notification id {}", message.getId()); + } + } } + diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/InvestigationsEDCFacade.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/InvestigationsEDCFacade.java index 984457f21e..27f47e18da 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/InvestigationsEDCFacade.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/InvestigationsEDCFacade.java @@ -49,6 +49,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotificationFactory; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; @@ -62,11 +63,12 @@ import static java.lang.String.format; import static org.eclipse.tractusx.traceability.common.config.JsonLdConfigurationTraceX.NAMESPACE_EDC; +import static org.eclipse.tractusx.traceability.common.config.RestTemplateConfiguration.EDC_NOTIFICATION_TEMPLATE; @Slf4j @Component @RequiredArgsConstructor -@Transactional +@Transactional(dontRollbackOn = {ContractNegotiationException.class, NoCatalogItemException.class, SendNotificationException.class, NoEndpointDataReferenceException.class}) public class InvestigationsEDCFacade { public static final String DEFAULT_PROTOCOL = "dataspace-protocol-http"; @@ -75,6 +77,7 @@ public class InvestigationsEDCFacade { private final EdcProperties edcProperties; + @Qualifier(EDC_NOTIFICATION_TEMPLATE) private final RestTemplate edcNotificationTemplate; private final InvestigationRepository investigationRepository; private final AlertRepository alertRepository; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java index 1662e14ed5..def4e04745 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java @@ -38,6 +38,8 @@ public interface QualityNotificationRepository { Optional findByEdcNotificationId(String edcNotificationId); + Optional findByNotificationMessageId(String id); + long countQualityNotificationEntitiesBySide(QualityNotificationSide investigationSide); QualityNotificationId saveQualityNotificationEntity(QualityNotification investigation); @@ -50,4 +52,6 @@ public interface QualityNotificationRepository { List getDistinctFieldValues(String fieldName, String startWith, Integer resultLimit, QualityNotificationSide owner); + void updateErrorMessage(QualityNotification investigation); + } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertNotificationEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertNotificationEntity.java index ccfb0dec1d..6be4d379ed 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertNotificationEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertNotificationEntity.java @@ -83,6 +83,7 @@ public static QualityNotificationMessage toDomain(AlertNotificationEntity alertN .created(alertNotificationEntity.getCreated()) .updated(alertNotificationEntity.getUpdated()) .type(QualityNotificationType.ALERT) + .errorMessage(alertNotificationEntity.getErrorMessage()) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java index dc89088d6d..4fdd8cd71f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java @@ -47,6 +47,7 @@ import org.springframework.stereotype.Component; import java.time.Clock; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -98,6 +99,25 @@ public void updateQualityNotificationEntity(QualityNotification alert) { jpaAlertRepository.save(alertEntity); } + @Override + public void updateErrorMessage(QualityNotification alert) { + + AlertEntity alertEntity = jpaAlertRepository.findById(alert.getNotificationId().value()).orElseThrow(() -> new IllegalArgumentException(String.format("Investigation with id %s not found!", alert.getNotificationId().value()))); + + for (QualityNotificationMessage notification : alert.getNotifications()) { + List assetEntitiesByAlert = getAssetAsBuiltEntitiesByAlert(alert); + AlertNotificationEntity notificationEntity = toNotificationEntity(alertEntity, notification, assetEntitiesByAlert); + Optional optionalNotification = notificationRepository.findById(notificationEntity.getId()); + optionalNotification.ifPresentOrElse(alertNotificationEntity -> { + alertNotificationEntity.setErrorMessage(notification.getErrorMessage()); + alertNotificationEntity.setUpdated(LocalDateTime.ofInstant(clock.instant(), clock.getZone())); + notificationRepository.save(notificationEntity); + + }, () -> log.info("Could not find notification by id {}. Error could not be enriched {}", notification.getId(), notification.getErrorMessage())); + } + jpaAlertRepository.save(alertEntity); + } + @Override public QualityNotificationId saveQualityNotificationEntity(QualityNotification alert) { @@ -120,6 +140,11 @@ public Optional findOptionalQualityNotificationById(Quality .map(AlertEntity::toDomain); } + @Override + public Optional findByNotificationMessageId(String id) { + return jpaAlertRepository.findByNotificationMessageId(id).map(AlertEntity::toDomain); + } + @Transactional @Override public long countPartsByStatusAndOwnership(List statuses, Owner owner) { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/JpaAlertRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/JpaAlertRepository.java index 036ab86418..f081de1363 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/JpaAlertRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/JpaAlertRepository.java @@ -45,5 +45,8 @@ public interface JpaAlertRepository extends JpaRepository, Jp @Query("SELECT alert FROM AlertEntity alert JOIN alert.notifications notification WHERE notification.edcNotificationId = :edcNotificationId") Optional findByNotificationsEdcNotificationId(@Param("edcNotificationId") String edcNotificationId); + @Query("SELECT alert FROM AlertEntity alert JOIN alert.notifications notification WHERE notification.id = :id") + Optional findByNotificationMessageId(@Param("id") String id); + List findAllByStatusIn(List statuses); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/model/InvestigationNotificationEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/model/InvestigationNotificationEntity.java index 9bef3137f6..be429f11f0 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/model/InvestigationNotificationEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/model/InvestigationNotificationEntity.java @@ -83,6 +83,7 @@ public static QualityNotificationMessage toDomain(InvestigationNotificationEntit .created(investigationNotificationEntity.getCreated()) .updated(investigationNotificationEntity.getUpdated()) .type(QualityNotificationType.INVESTIGATION) + .errorMessage(investigationNotificationEntity.getErrorMessage()) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java index b6cd5bf543..1d148537ba 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java @@ -33,6 +33,7 @@ import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.eclipse.tractusx.traceability.common.repository.CriteriaUtility; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.ContractNegotiationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; @@ -48,6 +49,7 @@ import org.springframework.stereotype.Component; import java.time.Clock; +import java.time.LocalDateTime; import java.util.Collection; import java.util.List; import java.util.Optional; @@ -75,39 +77,48 @@ public class InvestigationsRepositoryImpl implements InvestigationRepository { @Override public PageResult getNotifications(Pageable pageable, SearchCriteria searchCriteria) { - List investigationSpecifications = emptyIfNull(searchCriteria.getSearchCriteriaFilterList()).stream() - .map(InvestigationSpecification::new) - .toList(); + List investigationSpecifications = emptyIfNull(searchCriteria.getSearchCriteriaFilterList()).stream().map(InvestigationSpecification::new).toList(); Specification specification = InvestigationSpecification.toSpecification(investigationSpecifications); return new PageResult<>(jpaInvestigationRepository.findAll(specification, pageable), InvestigationEntity::toDomain); } @Override public long countOpenNotificationsByOwnership(List owners) { - return jpaInvestigationRepository.findAllByStatusIn(NotificationStatusBaseEntity.from(QualityNotificationStatus.ACTIVE_STATES)) - .stream() - .map(InvestigationEntity::getAssets) - .flatMap(Collection::stream) - .filter(assetAsBuiltEntity -> owners.contains(assetAsBuiltEntity.getOwner())) - .distinct() - .toList().size(); + return jpaInvestigationRepository.findAllByStatusIn(NotificationStatusBaseEntity.from(QualityNotificationStatus.ACTIVE_STATES)).stream().map(InvestigationEntity::getAssets).flatMap(Collection::stream).filter(assetAsBuiltEntity -> owners.contains(assetAsBuiltEntity.getOwner())).distinct().toList().size(); } @Override public void updateQualityNotificationEntity(QualityNotification investigation) { - InvestigationEntity investigationEntity = jpaInvestigationRepository.findById(investigation.getNotificationId().value()) - .orElseThrow(() -> new IllegalArgumentException(String.format("Investigation with id %s not found!", investigation.getNotificationId().value()))); + InvestigationEntity investigationEntity = jpaInvestigationRepository.findById(investigation.getNotificationId().value()).orElseThrow(() -> new IllegalArgumentException(String.format("Investigation with id %s not found!", investigation.getNotificationId().value()))); investigationEntity.setStatus(NotificationStatusBaseEntity.fromStringValue(investigation.getNotificationStatus().name())); investigationEntity.setUpdated(clock.instant()); investigationEntity.setCloseReason(investigation.getCloseReason()); investigationEntity.setAcceptReason(investigation.getAcceptReason()); investigationEntity.setDeclineReason(investigation.getDeclineReason()); - handleNotificationUpdate(investigationEntity, investigation); jpaInvestigationRepository.save(investigationEntity); } + @Override + public void updateErrorMessage(QualityNotification investigation) { + log.info("Starting update of error message with investigation {}", investigation); + InvestigationEntity investigationEntity = jpaInvestigationRepository.findById(investigation.getNotificationId().value()).orElseThrow(() -> new IllegalArgumentException(String.format("Investigation with id %s not found!", investigation.getNotificationId().value()))); + + for (QualityNotificationMessage notification : investigation.getNotifications()) { + List assetEntitiesByInvestigation = getAssetEntitiesByInvestigation(investigation); + InvestigationNotificationEntity notificationEntity = toNotificationEntity(investigationEntity, notification, assetEntitiesByInvestigation); + Optional optionalNotification = notificationRepository.findById(notificationEntity.getId()); + optionalNotification.ifPresentOrElse(investigationNotificationEntity -> { + investigationNotificationEntity.setErrorMessage(notification.getErrorMessage()); + investigationNotificationEntity.setUpdated(LocalDateTime.ofInstant(clock.instant(), clock.getZone())); + notificationRepository.save(notificationEntity); + log.info("Update of error message with notificationEntity {}", notificationEntity); + }, () -> log.info("Could not find notification by id {}. Error could not be enriched {}", notification.getId(), notification.getErrorMessage())); + } + jpaInvestigationRepository.save(investigationEntity); + } + @Override public QualityNotificationId saveQualityNotificationEntity(QualityNotification investigation) { @@ -118,8 +129,7 @@ public QualityNotificationId saveQualityNotificationEntity(QualityNotification i jpaInvestigationRepository.save(investigationEntity); - investigation.getNotifications() - .forEach(notification -> handleNotificationCreate(investigationEntity, notification, assetEntities)); + investigation.getNotifications().forEach(notification -> handleNotificationCreate(investigationEntity, notification, assetEntities)); return new QualityNotificationId(investigationEntity.getId()); } else { @@ -129,14 +139,17 @@ public QualityNotificationId saveQualityNotificationEntity(QualityNotification i @Override public Optional findOptionalQualityNotificationById(QualityNotificationId investigationId) { - return jpaInvestigationRepository.findById(investigationId.value()) - .map(InvestigationEntity::toDomain); + return jpaInvestigationRepository.findById(investigationId.value()).map(InvestigationEntity::toDomain); } @Override public Optional findByEdcNotificationId(String edcNotificationId) { - return jpaInvestigationRepository.findByNotificationsEdcNotificationId(edcNotificationId) - .map(InvestigationEntity::toDomain); + return jpaInvestigationRepository.findByNotificationsEdcNotificationId(edcNotificationId).map(InvestigationEntity::toDomain); + } + + @Override + public Optional findByNotificationMessageId(String id) { + return jpaInvestigationRepository.findByNotificationMessageId(id).map(InvestigationEntity::toDomain); } @Override @@ -170,8 +183,7 @@ private void handleNotificationCreate(InvestigationEntity investigationEntity, Q log.info("Investigation has the following new notification with id {} and status {}", notificationEntity.getId(), notificationEntity.getStatus().name()); notificationRepository.save(notificationEntity); log.info("Successfully persisted notification entity {}", notificationEntity); - } - ); + }); } @@ -185,17 +197,15 @@ private InvestigationNotificationEntity toNotificationEntity(InvestigationEntity } private List filterNotificationAssets(QualityNotificationMessage notification, List assets) { - Set notificationAffectedAssetIds = notification.getAffectedParts().stream() - .map(QualityNotificationAffectedPart::assetId) - .collect(Collectors.toSet()); + Set notificationAffectedAssetIds = notification.getAffectedParts().stream().map(QualityNotificationAffectedPart::assetId).collect(Collectors.toSet()); - return assets.stream() - .filter(it -> notificationAffectedAssetIds.contains(it.getId())) - .toList(); + return assets.stream().filter(it -> notificationAffectedAssetIds.contains(it.getId())).toList(); } @Override public List getDistinctFieldValues(String fieldName, String startWith, Integer resultLimit, QualityNotificationSide side) { return CriteriaUtility.getDistinctNotificationFieldValues(fieldName, startWith, resultLimit, side, InvestigationEntity.class, entityManager); } + + } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationRepository.java index cb17745096..d0d09117af 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationRepository.java @@ -41,5 +41,8 @@ public interface JpaInvestigationRepository extends JpaRepository findByNotificationsEdcNotificationId(@Param("edcNotificationId") String edcNotificationId); + @Query("SELECT investigation FROM InvestigationEntity investigation JOIN investigation.notifications notification WHERE notification.id = :id") + Optional findByNotificationMessageId(@Param("id") String id); + List findAllByStatusIn(List statuses); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/application/rest/SubmodelController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/application/rest/SubmodelController.java index e222af8a9a..65e1a54c1c 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/application/rest/SubmodelController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/application/rest/SubmodelController.java @@ -20,6 +20,7 @@ package org.eclipse.tractusx.traceability.submodel.application.rest; import assets.importpoc.ErrorResponse; +import io.swagger.annotations.ApiParam; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; @@ -106,7 +107,7 @@ public class SubmodelController { mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)))}) @GetMapping("/{submodelId}") - public String getSubmodel(@PathVariable String submodelId) { + public String getSubmodel(@PathVariable("submodelId") @ApiParam String submodelId) { return submodelService.getById(submodelId).getPayload(); } @@ -162,7 +163,7 @@ public String getSubmodel(@PathVariable String submodelId) { schema = @Schema(implementation = ErrorResponse.class)))}) @PostMapping("/{submodelId}") @ResponseStatus(HttpStatus.NO_CONTENT) - public void saveSubmodel(@PathVariable String submodelId, @RequestBody String submodelPayload) { + public void saveSubmodel(@PathVariable("submodelId") @ApiParam String submodelId, @RequestBody String submodelPayload) { submodelService.save(Submodel.builder() .id(submodelId) .payload(submodelPayload) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/repository/SubmodelClient.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/repository/SubmodelClient.java index 0f208ca910..da67c22485 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/repository/SubmodelClient.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/repository/SubmodelClient.java @@ -18,23 +18,26 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.submodel.infrastructure.repository; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.client.RestTemplate; +import static org.eclipse.tractusx.traceability.common.config.RestTemplateConfiguration.SUBMODEL_REST_TEMPLATE; + @Component public class SubmodelClient { private final RestTemplate submodelRestTemplate; - public SubmodelClient(RestTemplate submodelRestTemplate) { + public SubmodelClient(@Qualifier(SUBMODEL_REST_TEMPLATE) RestTemplate submodelRestTemplate) { this.submodelRestTemplate = submodelRestTemplate; } - public void createSubmodel(String submodelId, @RequestBody String payload) { + public void createSubmodel(String submodelId, String payload) { submodelRestTemplate.exchange("/api/submodel/data/" + submodelId, HttpMethod.POST, new HttpEntity<>(payload), Void.class); } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/model/EdcNotificationModelTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/model/EdcNotificationModelTest.java index 1687698c7c..03bc0b5607 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/model/EdcNotificationModelTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/model/EdcNotificationModelTest.java @@ -18,6 +18,7 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.infrastructure.edc.model; +import lombok.val; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotificationContent; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotificationHeader; @@ -101,8 +102,8 @@ public void testSanitizeStartQualityNotificationRequest() { @Test public void testSanitizeCloseInvestigationRequest() { //GIVEN - CloseQualityNotificationRequest closeQualityNotificationRequest = new CloseQualityNotificationRequest(); - closeQualityNotificationRequest.setReason("Reason\n"); + CloseQualityNotificationRequest closeQualityNotificationRequest = CloseQualityNotificationRequest.builder() + .reason("Reason\n").build(); //WHEN CloseQualityNotificationRequest cleanCloseQualityNotificationRequest = sanitize(closeQualityNotificationRequest); @@ -116,9 +117,11 @@ public void testSanitizeCloseInvestigationRequest() { @Test public void testSanitizeUpdateQualityNotificationRequest() { //GIVEN - UpdateQualityNotificationRequest updateQualityNotificationRequest = new UpdateQualityNotificationRequest(); - updateQualityNotificationRequest.setReason("Reason\n"); - updateQualityNotificationRequest.setStatus(UpdateQualityNotificationStatusRequest.ACCEPTED); + UpdateQualityNotificationRequest updateQualityNotificationRequest = UpdateQualityNotificationRequest + .builder() + .reason("Reason\n") + .status(UpdateQualityNotificationStatusRequest.ACCEPTED) + .build(); //WHEN UpdateQualityNotificationRequest cleanUpdateQualityNotificationRequest = sanitize(updateQualityNotificationRequest); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java index f9bcf95d9e..197a63c0ac 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java @@ -231,9 +231,12 @@ void givenDescriptionOverMaxLength_whenStartAlert_thenBadRequest() throws JsonPr void givenTooLongAlertReason_whenUpdateAlert_thenBadRequest() throws JsonProcessingException, JoseException { // given String description = RandomStringUtils.random(1001); - val request = new UpdateQualityNotificationRequest(); - request.setStatus(UpdateQualityNotificationStatusRequest.ACCEPTED); - request.setReason(description); + + UpdateQualityNotificationRequest request = UpdateQualityNotificationRequest + .builder() + .status(UpdateQualityNotificationStatusRequest.ACCEPTED) + .reason(description) + .build(); // when/then given() @@ -251,9 +254,13 @@ void givenTooLongAlertReason_whenUpdateAlert_thenBadRequest() throws JsonProcess void givenWrongStatus_whenUpdateAlert_thenBadRequest() throws JsonProcessingException, JoseException { // given String description = RandomStringUtils.random(15); - val request = new UpdateQualityNotificationRequest(); - request.setStatus(UpdateQualityNotificationStatusRequest.ACCEPTED); - request.setReason(description); + + + UpdateQualityNotificationRequest request = UpdateQualityNotificationRequest + .builder() + .status(UpdateQualityNotificationStatusRequest.ACCEPTED) + .reason(description) + .build(); // when/then given() @@ -440,8 +447,12 @@ void shouldCloseAlertStatus() throws JsonProcessingException, JoseException { .body("content", Matchers.hasSize(1)) .body("content[0].sendTo", Matchers.is(Matchers.not(Matchers.blankOrNullString()))); // when - var closeAlertRequest = new CloseQualityNotificationRequest(); - closeAlertRequest.setReason("this is the close reason for that investigation"); + + CloseQualityNotificationRequest closeAlertRequest = CloseQualityNotificationRequest + .builder() + .reason("this is the close reason for that investigation") + .build(); + given() .contentType(ContentType.JSON) .body(objectMapper.writeValueAsString(closeAlertRequest)) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java index c1fd6015dc..84695b0267 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java @@ -222,11 +222,14 @@ void givenDescriptionExceedsMaxLength_whenStartInvestigation_thenBadRequest() th void givenInvestigationReasonTooLong_whenUpdate_thenBadRequest() throws JsonProcessingException, JoseException { // given String description = RandomStringUtils.random(1001); - val request = new UpdateQualityNotificationRequest(); - request.setReason(description); - request.setStatus(UpdateQualityNotificationStatusRequest.ACCEPTED); - // when/then + UpdateQualityNotificationRequest request = + UpdateQualityNotificationRequest + .builder() + .reason(description) + .status(UpdateQualityNotificationStatusRequest.ACCEPTED) + .build(); + // when/then given() .contentType(ContentType.JSON) .body(objectMapper.writeValueAsString(request)) @@ -242,9 +245,13 @@ void givenInvestigationReasonTooLong_whenUpdate_thenBadRequest() throws JsonProc void givenWrongStatus_whenUpdateInvestigation_thenBadRequest() throws JsonProcessingException, JoseException { // given String description = RandomStringUtils.random(15); - val request = new UpdateQualityNotificationRequest(); - request.setStatus(UpdateQualityNotificationStatusRequest.ACCEPTED); - request.setReason(description); + + UpdateQualityNotificationRequest request = + UpdateQualityNotificationRequest + .builder() + .reason(description) + .status(UpdateQualityNotificationStatusRequest.ACCEPTED) + .build(); // when/then given() @@ -424,8 +431,11 @@ void shouldCloseInvestigationStatus() throws JsonProcessingException, JoseExcept .body("content[0].sendTo", Matchers.is(Matchers.not(Matchers.blankOrNullString()))); // when - val closeInvestigationRequest = new CloseQualityNotificationRequest(); - closeInvestigationRequest.setReason("this is the close reason for that investigation"); + CloseQualityNotificationRequest closeInvestigationRequest = + CloseQualityNotificationRequest + .builder() + .reason("this is the close reason for that investigation") + .build(); given() .contentType(ContentType.JSON) .body(objectMapper.writeValueAsString(closeInvestigationRequest)) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java index e3ca9104f4..a9e51a7291 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java @@ -151,8 +151,8 @@ void givenRequest_whenCancelAlert_thenProcessCorrectly() { void givenRequest_whenCloseAlert_thenProcessCorrectly() { // given final Long param = 1L; - final CloseQualityNotificationRequest request = new CloseQualityNotificationRequest(); - request.setReason("just because"); + + CloseQualityNotificationRequest request = CloseQualityNotificationRequest.builder().reason("just because").build(); // when controller.closeAlert(param, request); @@ -165,9 +165,14 @@ void givenRequest_whenCloseAlert_thenProcessCorrectly() { void givenRequest_whenUpdateAlert_thenProcessCorrectly() { // given final Long param = 1L; - final UpdateQualityNotificationRequest request = new UpdateQualityNotificationRequest(); - request.setReason("just because I say so"); - request.setStatus(UpdateQualityNotificationStatusRequest.ACCEPTED); + + + UpdateQualityNotificationRequest request = + UpdateQualityNotificationRequest.builder() + .status(UpdateQualityNotificationStatusRequest.ACCEPTED) + .reason("just because I say so") + .build(); + // when controller.updateAlert(param, request); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationTest.java new file mode 100644 index 0000000000..6a1ac1f8b9 --- /dev/null +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationTest.java @@ -0,0 +1,52 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +package org.eclipse.tractusx.traceability.qualitynotification.domain.base.model; + +import org.junit.jupiter.api.Test; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + + +class QualityNotificationTest { + + @Test + void testSecondLatestNotifications() { + // Given + List notifications = new ArrayList<>(); + QualityNotificationMessage message1 = QualityNotificationMessage.builder().notificationStatus(QualityNotificationStatus.ACKNOWLEDGED).created(LocalDateTime.now()).build(); + QualityNotificationMessage message2 = QualityNotificationMessage.builder().notificationStatus(QualityNotificationStatus.ACKNOWLEDGED).created(LocalDateTime.now()).build(); + notifications.add(message1); + notifications.add(message2); + + QualityNotification qualityNotification = QualityNotification.builder().notifications(notifications).build(); + + // When + List result = qualityNotification.secondLatestNotifications(); + + // Then + assertNotNull(result); + assertTrue(result.contains(message1)); + + } +} diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/EdcNotificationServiceImplTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/EdcNotificationServiceImplTest.java index b7de41cd8b..34d7fbe6ac 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/EdcNotificationServiceImplTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/EdcNotificationServiceImplTest.java @@ -27,6 +27,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.NoCatalogItemException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.NoEndpointDataReferenceException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.SendNotificationException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; @@ -40,6 +41,7 @@ import java.time.Instant; import java.util.List; +import java.util.Optional; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; @@ -131,7 +133,8 @@ void givenNoCatalogItemException_whenHandleSendingInvestigation_thenHandleIt() { .severity(QualityNotificationSeverity.MINOR) .build(); doThrow(new NoCatalogItemException()).when(edcFacade).startEdcTransfer(notification, edcReceiverUrl, edcSenderUrl); - + QualityNotification qualityNotification = QualityNotification.builder().build(); + when(investigationRepository.findByNotificationMessageId(any())).thenReturn(Optional.of(qualityNotification)); // when notificationsService.asyncNotificationMessageExecutor(notification); @@ -155,7 +158,8 @@ void givenSendNotificationException_whenHandleSendingInvestigation_thenHandleIt( .severity(QualityNotificationSeverity.MINOR) .build(); doThrow(new SendNotificationException("message", new RuntimeException())).when(edcFacade).startEdcTransfer(notification, edcReceiverUrl, edcSenderUrl); - + QualityNotification qualityNotification = QualityNotification.builder().build(); + when(investigationRepository.findByNotificationMessageId(any())).thenReturn(Optional.of(qualityNotification)); // when notificationsService.asyncNotificationMessageExecutor(notification); @@ -179,7 +183,8 @@ void givenSendNoEndpointDataReferenceException_whenHandleSendingInvestigation_th .severity(QualityNotificationSeverity.MINOR) .build(); doThrow(new NoEndpointDataReferenceException("message")).when(edcFacade).startEdcTransfer(notification, edcReceiverUrl, edcSenderUrl); - + QualityNotification qualityNotification = QualityNotification.builder().build(); + when(investigationRepository.findByNotificationMessageId(any())).thenReturn(Optional.of(qualityNotification)); // when notificationsService.asyncNotificationMessageExecutor(notification); @@ -203,7 +208,8 @@ void givenContractNegotiationException_whenHandleSendingInvestigation_thenHandle .severity(QualityNotificationSeverity.MINOR) .build(); doThrow(new ContractNegotiationException("message")).when(edcFacade).startEdcTransfer(notification, edcReceiverUrl, edcSenderUrl); - + QualityNotification qualityNotification = QualityNotification.builder().build(); + when(investigationRepository.findByNotificationMessageId(any())).thenReturn(Optional.of(qualityNotification)); // when notificationsService.asyncNotificationMessageExecutor(notification); @@ -228,6 +234,8 @@ void givenNoCatalogItemException_whenHandleSendingAlert_thenHandleIt() { .severity(QualityNotificationSeverity.MINOR) .build(); doThrow(new NoCatalogItemException()).when(edcFacade).startEdcTransfer(notification, edcReceiverUrl, edcSenderUrl); + QualityNotification qualityNotification = QualityNotification.builder().build(); + when(investigationRepository.findByNotificationMessageId(any())).thenReturn(Optional.of(qualityNotification)); // when notificationsService.asyncNotificationMessageExecutor(notification); @@ -245,6 +253,7 @@ void givenSendNotificationException_whenHandleSendingAlert_thenHandleIt() { Discovery discovery = Discovery.builder().senderUrl(edcSenderUrl).receiverUrls(List.of(edcReceiverUrl)).build(); when(discoveryService.getDiscoveryByBPN(bpn)).thenReturn(discovery); + QualityNotificationMessage notification = QualityNotificationMessage.builder() .sendTo(bpn) .type(QualityNotificationType.ALERT) @@ -253,6 +262,9 @@ void givenSendNotificationException_whenHandleSendingAlert_thenHandleIt() { .build(); doThrow(new SendNotificationException("message", new RuntimeException())).when(edcFacade).startEdcTransfer(notification, edcReceiverUrl, edcSenderUrl); + QualityNotification qualityNotification = QualityNotification.builder().build(); + when(investigationRepository.findByNotificationMessageId(any())).thenReturn(Optional.of(qualityNotification)); + // when notificationsService.asyncNotificationMessageExecutor(notification); @@ -276,7 +288,8 @@ void givenSendNoEndpointDataReferenceException_whenHandleSendingAlert_thenHandle .severity(QualityNotificationSeverity.MINOR) .build(); doThrow(new NoEndpointDataReferenceException("message")).when(edcFacade).startEdcTransfer(notification, edcReceiverUrl, edcSenderUrl); - + QualityNotification qualityNotification = QualityNotification.builder().build(); + when(investigationRepository.findByNotificationMessageId(any())).thenReturn(Optional.of(qualityNotification)); // when notificationsService.asyncNotificationMessageExecutor(notification); @@ -300,7 +313,8 @@ void givenContractNegotiationException_whenHandleSendingAlert_thenHandleIt() { .severity(QualityNotificationSeverity.MINOR) .build(); doThrow(new ContractNegotiationException("message")).when(edcFacade).startEdcTransfer(notification, edcReceiverUrl, edcSenderUrl); - + QualityNotification qualityNotification = QualityNotification.builder().build(); + when(investigationRepository.findByNotificationMessageId(any())).thenReturn(Optional.of(qualityNotification)); // when notificationsService.asyncNotificationMessageExecutor(notification); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/AlertsRepositoryImplTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/AlertsRepositoryImplTest.java new file mode 100644 index 0000000000..9a744f9d0e --- /dev/null +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/AlertsRepositoryImplTest.java @@ -0,0 +1,89 @@ +/******************************************************************************** + * Copyright (c) 20234Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.repository; + +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; +import org.eclipse.tractusx.traceability.common.model.BPN; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertNotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.repository.AlertsRepositoryImpl; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.repository.JpaAlertNotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.repository.JpaAlertRepository; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.time.Clock; +import java.time.Instant; +import java.time.ZoneId; +import java.util.List; +import java.util.Optional; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +class AlertsRepositoryImplTest { + + @InjectMocks + private AlertsRepositoryImpl alertRepository; + + @Mock + private JpaAlertRepository jpaAlertRepository; + + @Mock + private JpaAlertNotificationRepository notificationRepository; + + @Mock + private JpaAssetAsBuiltRepository assetsRepository; + + @Mock + private Clock clock; + + @Test + void updateErrorMessage() { + + // Given + QualityNotificationMessage message = QualityNotificationMessage.builder().notificationStatus(QualityNotificationStatus.ACKNOWLEDGED).affectedParts(List.of(new QualityNotificationAffectedPart("123"))).build(); + QualityNotification qualityNotification = QualityNotification.builder().notificationStatus(QualityNotificationStatus.ACKNOWLEDGED).assetIds(List.of("123")).notificationId(new QualityNotificationId(123L)).bpn(BPN.of("ABC")).notifications(List.of(message)).build(); + AssetAsBuiltEntity assetAsBuiltEntity = AssetAsBuiltEntity.builder().id("123").build(); + AlertEntity entity = AlertEntity.builder().assets(List.of(assetAsBuiltEntity)).build(); + AlertNotificationEntity notificationEntity = AlertNotificationEntity.from(entity, message, List.of(assetAsBuiltEntity)); + when(assetsRepository.findByIdIn(any())).thenReturn(List.of(assetAsBuiltEntity)); + when(jpaAlertRepository.findById(any())).thenReturn(Optional.of(entity)); + when(notificationRepository.findById(notificationEntity.getId())).thenReturn(Optional.of(notificationEntity)); + when(clock.instant()).thenReturn(Instant.now()); + when(clock.getZone()).thenReturn(ZoneId.systemDefault()); + // When + alertRepository.updateErrorMessage(qualityNotification); + // Then + verify(notificationRepository, times(1)).save(any()); + + } +} diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImplTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImplTest.java new file mode 100644 index 0000000000..2200842d89 --- /dev/null +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImplTest.java @@ -0,0 +1,86 @@ +/******************************************************************************** + * Copyright (c) 20234Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.repository; + +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; +import org.eclipse.tractusx.traceability.common.model.BPN; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.time.Clock; +import java.time.Instant; +import java.time.ZoneId; +import java.util.List; +import java.util.Optional; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +class InvestigationsRepositoryImplTest { + + @InjectMocks + private InvestigationsRepositoryImpl investigationsRepository; + + @Mock + private JpaInvestigationRepository jpaInvestigationRepository; + + @Mock + private JpaInvestigationNotificationRepository notificationRepository; + + @Mock + private JpaAssetAsBuiltRepository assetsRepository; + + @Mock + private Clock clock; + + @Test + void updateErrorMessage() { + + // Given + QualityNotificationMessage message = QualityNotificationMessage.builder().notificationStatus(QualityNotificationStatus.ACKNOWLEDGED).affectedParts(List.of(new QualityNotificationAffectedPart("123"))).build(); + QualityNotification qualityNotification = QualityNotification.builder().notificationStatus(QualityNotificationStatus.ACKNOWLEDGED).assetIds(List.of("123")).notificationId(new QualityNotificationId(123L)).bpn(BPN.of("ABC")).notifications(List.of(message)).build(); + AssetAsBuiltEntity assetAsBuiltEntity = AssetAsBuiltEntity.builder().id("123").build(); + InvestigationEntity entity = InvestigationEntity.builder().assets(List.of(assetAsBuiltEntity)).build(); + InvestigationNotificationEntity notificationEntity = InvestigationNotificationEntity.from(entity, message, List.of(assetAsBuiltEntity)); + when(assetsRepository.findByIdIn(any())).thenReturn(List.of(assetAsBuiltEntity)); + when(jpaInvestigationRepository.findById(any())).thenReturn(Optional.of(entity)); + when(notificationRepository.findById(notificationEntity.getId())).thenReturn(Optional.of(notificationEntity)); + when(clock.instant()).thenReturn(Instant.now()); + when(clock.getZone()).thenReturn(ZoneId.systemDefault()); + // When + investigationsRepository.updateErrorMessage(qualityNotification); + // Then + verify(notificationRepository, times(1)).save(any()); + + } +} diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/investigation/rest/validation/UpdateQualityNotificationValidatorTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/investigation/rest/validation/UpdateQualityNotificationValidatorTest.java index 70f0f312f2..5563fd2e3b 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/investigation/rest/validation/UpdateQualityNotificationValidatorTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/investigation/rest/validation/UpdateQualityNotificationValidatorTest.java @@ -49,7 +49,7 @@ void testUnsuccessfulValidationForInvalidReason() { String reason = "some-reason-for-update"; String errorMessage = "Update investigation reason can't be present for ACKNOWLEDGED status"; - UpdateQualityNotificationRequest request = new UpdateQualityNotificationRequest(); + UpdateQualityNotificationRequest request = UpdateQualityNotificationRequest.builder().build(); request.setReason(reason); request.setStatus(acknowledged); UpdateQualityNotificationValidationException exception = assertThrows(UpdateQualityNotificationValidationException.class, () -> UpdateQualityNotificationValidator.validate(request)); @@ -61,7 +61,7 @@ void testUnsuccessfulValidationForInvalidReason() { @DisplayName("Execute Validation successfully") void testSuccessfulValidation() { UpdateQualityNotificationStatusRequest accepted = UpdateQualityNotificationStatusRequest.ACCEPTED; - UpdateQualityNotificationRequest request = new UpdateQualityNotificationRequest(); + UpdateQualityNotificationRequest request = UpdateQualityNotificationRequest.builder().build(); request.setReason("abcdefg12313212321123"); request.setStatus(accepted); UpdateQualityNotificationValidator.validate(request); diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/TraceabilityTestStepDefinition.java b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/TraceabilityTestStepDefinition.java index f6c3029faf..5cb7455899 100644 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/TraceabilityTestStepDefinition.java +++ b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/TraceabilityTestStepDefinition.java @@ -32,10 +32,11 @@ import org.eclipse.tractusx.traceability.test.exteption.MissingStepDefinitionException; import org.eclipse.tractusx.traceability.test.tooling.TraceXEnvironmentEnum; import org.eclipse.tractusx.traceability.test.tooling.rest.RestProvider; -import org.eclipse.tractusx.traceability.test.tooling.rest.response.QualityNotificationResponse; import org.eclipse.tractusx.traceability.test.validator.NotificationValidator; import org.hamcrest.Matchers; +import qualitynotification.base.request.UpdateQualityNotificationStatusRequest; import qualitynotification.base.response.QualityNotificationIdResponse; +import qualitynotification.base.response.QualityNotificationResponse; import java.time.Instant; import java.util.Arrays; @@ -52,9 +53,6 @@ import static org.eclipse.tractusx.traceability.test.tooling.NotificationTypeEnum.INVESTIGATION; import static org.eclipse.tractusx.traceability.test.tooling.TraceXEnvironmentEnum.TRACE_X_A; import static org.eclipse.tractusx.traceability.test.tooling.TraceXEnvironmentEnum.TRACE_X_B; -import static org.eclipse.tractusx.traceability.test.tooling.rest.request.UpdateQualityNotificationStatusRequest.ACCEPTED; -import static org.eclipse.tractusx.traceability.test.tooling.rest.request.UpdateQualityNotificationStatusRequest.ACKNOWLEDGED; -import static org.eclipse.tractusx.traceability.test.tooling.rest.request.UpdateQualityNotificationStatusRequest.DECLINED; import static org.eclipse.tractusx.traceability.test.validator.TestUtils.normalize; import static org.eclipse.tractusx.traceability.test.validator.TestUtils.wrapStringWithTimestamp; @@ -197,28 +195,28 @@ public void iCanSeeAlertWasNotReceived() { @When("I acknowledge quality investigation") public void iAcknowledgeQualityInvestigation() { - restProvider.updateNotification(INVESTIGATION, getNotificationIdBasedOnEnv(), ACKNOWLEDGED, ""); + restProvider.updateNotification(INVESTIGATION, getNotificationIdBasedOnEnv(), UpdateQualityNotificationStatusRequest.ACKNOWLEDGED, ""); } @When("I accept quality investigation") public void iAcceptQualityInvestigation(DataTable dataTable) { String reason = normalize(dataTable.asMap()).get("reason"); System.out.println("reason: " + reason); - restProvider.updateNotification(INVESTIGATION, getNotificationIdBasedOnEnv(), ACCEPTED, reason); + restProvider.updateNotification(INVESTIGATION, getNotificationIdBasedOnEnv(), UpdateQualityNotificationStatusRequest.ACCEPTED, reason); } @When("I decline quality investigation") public void iDeclineQualityInvestigation(DataTable dataTable) { String reason = normalize(dataTable.asMap()).get("reason"); System.out.println("reason: " + reason); - restProvider.updateNotification(INVESTIGATION, getNotificationIdBasedOnEnv(), DECLINED, reason); + restProvider.updateNotification(INVESTIGATION, getNotificationIdBasedOnEnv(), UpdateQualityNotificationStatusRequest.DECLINED, reason); } @When("I decline quality alert") public void iDeclineQualityAlert(DataTable dataTable) { String reason = normalize(dataTable.asMap()).get("reason"); System.out.println("reason: " + reason); - restProvider.updateNotification(ALERT, getNotificationIdBasedOnEnv(), DECLINED, reason); + restProvider.updateNotification(ALERT, getNotificationIdBasedOnEnv(), UpdateQualityNotificationStatusRequest.DECLINED, reason); } private Long getNotificationIdBasedOnEnv() { @@ -315,7 +313,7 @@ public void iCanSeeQualityAlertWasReceived() { @When("I acknowledge quality alert") public void iAcknowledgeQualityAlert() { - restProvider.updateNotification(ALERT, getNotificationIdBasedOnEnv(), ACKNOWLEDGED, ""); + restProvider.updateNotification(ALERT, getNotificationIdBasedOnEnv(), UpdateQualityNotificationStatusRequest.ACKNOWLEDGED, ""); } @@ -323,6 +321,6 @@ public void iAcknowledgeQualityAlert() { public void iAcceptQualityAlert(DataTable dataTable) { String reason = normalize(dataTable.asMap()).get("reason"); System.out.println("reason: " + reason); - restProvider.updateNotification(ALERT, getNotificationIdBasedOnEnv(), ACCEPTED, reason); + restProvider.updateNotification(ALERT, getNotificationIdBasedOnEnv(), UpdateQualityNotificationStatusRequest.ACCEPTED, reason); } } diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/RestProvider.java b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/RestProvider.java index f67521d3de..fe913c4d7f 100644 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/RestProvider.java +++ b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/RestProvider.java @@ -28,20 +28,24 @@ import io.restassured.config.ObjectMapperConfig; import io.restassured.config.RestAssuredConfig; import io.restassured.http.ContentType; +import io.restassured.response.ValidatableResponse; import io.restassured.specification.RequestSpecification; import lombok.Getter; import org.apache.http.HttpStatus; +import org.awaitility.Duration; import org.eclipse.tractusx.traceability.test.tooling.EnvVariablesResolver; import org.eclipse.tractusx.traceability.test.tooling.NotificationTypeEnum; import org.eclipse.tractusx.traceability.test.tooling.TraceXEnvironmentEnum; -import org.eclipse.tractusx.traceability.test.tooling.rest.request.StartQualityNotificationRequest; -import org.eclipse.tractusx.traceability.test.tooling.rest.request.UpdateQualityNotificationRequest; -import org.eclipse.tractusx.traceability.test.tooling.rest.request.UpdateQualityNotificationStatusRequest; -import org.eclipse.tractusx.traceability.test.tooling.rest.response.QualityNotificationResponse; +import qualitynotification.base.request.QualityNotificationSeverityRequest; +import qualitynotification.base.request.StartQualityNotificationRequest; +import qualitynotification.base.request.UpdateQualityNotificationRequest; +import qualitynotification.base.request.UpdateQualityNotificationStatusRequest; import qualitynotification.base.response.QualityNotificationIdResponse; +import qualitynotification.base.response.QualityNotificationResponse; import java.time.Instant; import java.util.List; +import java.util.concurrent.TimeUnit; import static com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES; import static com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES; @@ -49,6 +53,7 @@ import static com.fasterxml.jackson.databind.DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE; import static com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS; import static io.restassured.RestAssured.given; +import static org.awaitility.Awaitility.await; import static org.eclipse.tractusx.traceability.test.tooling.TraceXEnvironmentEnum.TRACE_X_A; import static org.eclipse.tractusx.traceability.test.tooling.TraceXEnvironmentEnum.TRACE_X_B; @@ -95,9 +100,10 @@ public QualityNotificationIdResponse createNotification( NotificationTypeEnum notificationType) { final StartQualityNotificationRequest requestBody = StartQualityNotificationRequest.builder() .partIds(partIds) + .isAsBuilt(true) .description(description) .targetDate(targetDate) - .severity(severity) + .severity(QualityNotificationSeverityRequest.fromValue(severity)) .receiverBpn(receiverBpn) .build(); return given().log().body() @@ -114,15 +120,28 @@ public QualityNotificationIdResponse createNotification( } public void approveNotification(final Long notificationId, NotificationTypeEnum notificationType) { - given().spec(getRequestSpecification()) - .contentType(ContentType.JSON) - .when() - .post("api/" + notificationType.label + "/{notificationId}/approve".replace( - "{notificationId}", - notificationId.toString() - )) - .then() - .statusCode(HttpStatus.SC_NO_CONTENT); + await() + .atMost(Duration.FIVE_MINUTES) + .pollInterval(10, TimeUnit.SECONDS) + .ignoreExceptions() + .until(() -> { + ValidatableResponse validatableResponse = given().spec(getRequestSpecification()) + .contentType(ContentType.JSON) + .when() + .post("api/" + notificationType.label + "/{notificationId}/approve".replace( + "{notificationId}", + notificationId.toString() + )) + .then(); + try { + validatableResponse.statusCode(HttpStatus.SC_NO_CONTENT); + return true; + } catch (Exception e) { + System.out.println("Retry action"); + return false; + } + }); + } public void cancelNotification(final Long notificationId, NotificationTypeEnum notificationType) { @@ -139,17 +158,28 @@ public void cancelNotification(final Long notificationId, NotificationTypeEnum n } public void closeNotification(final Long notificationId, NotificationTypeEnum notificationType) { + await() + .atMost(Duration.FIVE_MINUTES) + .pollInterval(10, TimeUnit.SECONDS) + .ignoreExceptions() + .until(() -> { + ValidatableResponse result = given().spec(getRequestSpecification()) + .contentType(ContentType.JSON) + .when() + .body("{\"reason\": \"stringstringstr\"}") + .post("api/" + notificationType.label + "/{notificationId}/close".replace( + "{notificationId}", + notificationId.toString() + )) + .then(); + try { + ValidatableResponse validatableResponse = result.statusCode(HttpStatus.SC_NO_CONTENT); + return true; + } catch (Exception e) { + return false; + } + }); - given().spec(getRequestSpecification()) - .contentType(ContentType.JSON) - .when() - .body("{\"reason\": \"stringstringstr\"}") - .post("api/" + notificationType.label + "/{notificationId}/close".replace( - "{notificationId}", - notificationId.toString() - )) - .then() - .statusCode(HttpStatus.SC_NO_CONTENT); } public void updateNotification(NotificationTypeEnum notificationType, final Long notificationId, @@ -159,17 +189,30 @@ public void updateNotification(NotificationTypeEnum notificationType, final Long .reason(reason) .build(); - given().spec(getRequestSpecification()) - .contentType(ContentType.JSON) - .body(requestBody) - .when() - .post("api/" + notificationType.label + "/{notificationId}/update".replace( - "{notificationId}", - notificationId.toString() - )) - .then() - .log().all() - .statusCode(HttpStatus.SC_NO_CONTENT); + await() + .atMost(Duration.FIVE_MINUTES) + .pollInterval(10, TimeUnit.SECONDS) + .ignoreExceptions() + .until(() -> { + ValidatableResponse validatableResponse = given().spec(getRequestSpecification()) + .contentType(ContentType.JSON) + .body(requestBody) + .when() + .post("api/" + notificationType.label + "/{notificationId}/update".replace( + "{notificationId}", + notificationId.toString() + )) + .then() + .log().all(); + + try { + validatableResponse.statusCode(HttpStatus.SC_NO_CONTENT); + return true; + } catch (Exception e) { + return false; + } + }); + } public List getReceivedNotifications(NotificationTypeEnum notificationType) { diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/request/StartQualityNotificationRequest.java b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/request/StartQualityNotificationRequest.java deleted file mode 100644 index f70e5f3325..0000000000 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/request/StartQualityNotificationRequest.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.test.tooling.rest.request; - -import lombok.Builder; -import lombok.Data; - -import java.time.Instant; -import java.util.List; - -@Data -@Builder -public class StartQualityNotificationRequest { - private List partIds; - private String description; - private Instant targetDate; - private String severity; - private String receiverBpn; -} diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/request/UpdateQualityNotificationRequest.java b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/request/UpdateQualityNotificationRequest.java deleted file mode 100644 index 0011fb0286..0000000000 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/request/UpdateQualityNotificationRequest.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.test.tooling.rest.request; - -import lombok.Builder; -import lombok.Data; - -@Builder -@Data -public class UpdateQualityNotificationRequest { - private UpdateQualityNotificationStatusRequest status; - private String reason; -} diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/request/UpdateQualityNotificationStatusRequest.java b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/request/UpdateQualityNotificationStatusRequest.java deleted file mode 100644 index 1f4730a8ab..0000000000 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/request/UpdateQualityNotificationStatusRequest.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.test.tooling.rest.request; - -import com.fasterxml.jackson.annotation.JsonCreator; - -import java.util.NoSuchElementException; -import java.util.stream.Stream; - -public enum UpdateQualityNotificationStatusRequest { - ACKNOWLEDGED, - ACCEPTED, - DECLINED; - - - @JsonCreator - public static UpdateQualityNotificationStatusRequest fromValue(final String value) { - return Stream.of(UpdateQualityNotificationStatusRequest.values()) - .filter(updateInvestigationStatus -> updateInvestigationStatus.name().equals(value)) - .findFirst() - .orElseThrow(() -> new NoSuchElementException("Unsupported UpdateInvestigationStatus")); - } - - -} diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/PageResult.java b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/PageResult.java deleted file mode 100644 index 2e7791ea17..0000000000 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/PageResult.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.test.tooling.rest.response; - -import java.util.List; - -public record PageResult( - List content, - Integer page, - Integer pageCount, - Integer pageSize, - Long totalItems -) { -} diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationReasonResponse.java b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationReasonResponse.java deleted file mode 100644 index a8982f7a3b..0000000000 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationReasonResponse.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2022, 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - * Copyright (c) 2022, 2023 ZF Friedrichshafen AG - * Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.test.tooling.rest.response; - - -public record QualityNotificationReasonResponse( - String close, - String accept, - String decline) { -} diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationResponse.java b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationResponse.java deleted file mode 100644 index a54dfc9e6d..0000000000 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationResponse.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.test.tooling.rest.response; - -import lombok.Data; -import lombok.experimental.SuperBuilder; -import lombok.extern.jackson.Jacksonized; - -import java.util.List; - -@Data -@SuperBuilder -@Jacksonized -public class QualityNotificationResponse { - private Long id; - - private QualityNotificationStatusResponse status; - - private String description; - private String createdBy; - - private String createdByName; - private String createdDate; - - private List assetIds; - - private QualityNotificationSideResponse channel; - - private QualityNotificationReasonResponse reason; - - private String sendTo; - - private String sendToName; - - private QualityNotificationSeverityResponse severity; - - private String targetDate; -} diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationSeverityResponse.java b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationSeverityResponse.java deleted file mode 100644 index 0b571a96f4..0000000000 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationSeverityResponse.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.test.tooling.rest.response; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -import java.util.NoSuchElementException; -import java.util.stream.Stream; - -public enum QualityNotificationSeverityResponse { - MINOR("MINOR"), - MAJOR("MAJOR"), - CRITICAL("CRITICAL"), - LIFE_THREATENING("LIFE-THREATENING"); - - private final String realName; - - QualityNotificationSeverityResponse(String realName) { - this.realName = realName; - } - - @JsonCreator - public static QualityNotificationSeverityResponse fromValue(final String value) { - return Stream.of(QualityNotificationSeverityResponse.values()) - .filter(severity -> severity.getRealName().equals(value)) - .findFirst() - .orElseThrow(() -> new NoSuchElementException("Unsupported QualityNotificationSeverityRequest")); - } - - @JsonValue - public String getRealName() { - return realName; - } -} diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationStatusResponse.java b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationStatusResponse.java deleted file mode 100644 index 53d79289ff..0000000000 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/tooling/rest/response/QualityNotificationStatusResponse.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.test.tooling.rest.response; - -import java.util.Arrays; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - -import static java.util.Collections.emptySet; -import static java.util.Set.of; - -public enum QualityNotificationStatusResponse { - CREATED(QualityNotificationSideResponse.SENDER, emptySet()), - SENT(QualityNotificationSideResponse.SENDER, Set.of(QualityNotificationSideResponse.SENDER)), - RECEIVED(QualityNotificationSideResponse.RECEIVER, emptySet()), - ACKNOWLEDGED(QualityNotificationSideResponse.RECEIVER, Set.of(QualityNotificationSideResponse.RECEIVER, QualityNotificationSideResponse.SENDER)), - ACCEPTED(QualityNotificationSideResponse.RECEIVER, Set.of(QualityNotificationSideResponse.RECEIVER)), - DECLINED(QualityNotificationSideResponse.RECEIVER, Set.of(QualityNotificationSideResponse.RECEIVER)), - CANCELED(QualityNotificationSideResponse.SENDER, Set.of(QualityNotificationSideResponse.SENDER)), - CLOSED(QualityNotificationSideResponse.SENDER, of(QualityNotificationSideResponse.SENDER, QualityNotificationSideResponse.RECEIVER)); - - private static final Map> STATE_MACHINE; - private static final Set NO_TRANSITION_ALLOWED = emptySet(); - private static final Map MAPPINGS; - - static { - STATE_MACHINE = Map.of( - CREATED, of(SENT, CANCELED), - SENT, of(RECEIVED, CLOSED, ACKNOWLEDGED), - RECEIVED, of(ACKNOWLEDGED, CLOSED), - ACKNOWLEDGED, of(DECLINED, ACCEPTED, CLOSED), - ACCEPTED, of(CLOSED), - DECLINED, of(CLOSED), - CLOSED, NO_TRANSITION_ALLOWED, - CANCELED, NO_TRANSITION_ALLOWED - ); - - MAPPINGS = Arrays.stream(QualityNotificationStatusResponse.values()) - .collect(Collectors.toMap(Enum::name, qualityNotificationStatus -> qualityNotificationStatus)); - } - - private final QualityNotificationSideResponse qualityNotificationSide; - private final Set allowedTransitionFromSide; - - QualityNotificationStatusResponse(QualityNotificationSideResponse qualityNotificationSide, Set allowedTransitionFromSide) { - this.qualityNotificationSide = qualityNotificationSide; - this.allowedTransitionFromSide = allowedTransitionFromSide; - } - - public static Optional fromValue(String value) { - return Optional.ofNullable(MAPPINGS.get(value)); - } - - public static QualityNotificationStatusResponse fromStringValue(String value) { - return MAPPINGS.get(value); - } - - - public boolean transitionAllowed(QualityNotificationStatusResponse to) { - - Set allowedStatusesToTransition = STATE_MACHINE.get(this); - - if (!allowedStatusesToTransition.contains(to)) { - return false; - } - - return isSideEligibleForTransition(this, to); - } - - private boolean isSideEligibleForTransition(QualityNotificationStatusResponse from, QualityNotificationStatusResponse to) { - return to.allowedTransitionFromSide.contains(from.qualityNotificationSide); - } -} diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/validator/NotificationValidator.java b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/validator/NotificationValidator.java index 7bf139ac58..83ac5f9681 100644 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/validator/NotificationValidator.java +++ b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/validator/NotificationValidator.java @@ -20,7 +20,8 @@ package org.eclipse.tractusx.traceability.test.validator; import lombok.Getter; -import org.eclipse.tractusx.traceability.test.tooling.rest.response.QualityNotificationResponse; +import qualitynotification.base.response.QualityNotificationResponse; + import java.util.Arrays; import java.util.List; diff --git a/tx-cucumber-tests/src/test/resources/features/9_TRACEFOSS-2354.feature b/tx-cucumber-tests/src/test/resources/features/10_TRACEFOSS-2354.feature similarity index 88% rename from tx-cucumber-tests/src/test/resources/features/9_TRACEFOSS-2354.feature rename to tx-cucumber-tests/src/test/resources/features/10_TRACEFOSS-2354.feature index da2dc65f46..dd8c56f02d 100644 --- a/tx-cucumber-tests/src/test/resources/features/9_TRACEFOSS-2354.feature +++ b/tx-cucumber-tests/src/test/resources/features/10_TRACEFOSS-2354.feature @@ -68,14 +68,14 @@ Feature: 👍[BE][TABLE_FEATURE] Implementation of Sorting in table views #Check if *owner filter* in *assets* is working correctly including: #* filter without owner specification returns assets of all owner #* filter for owner specification only return desired assets - @TRACEFOSS-1221 @TRACEFOSS-1101 @INTEGRATION_TEST - Scenario Outline: [BE] Check correct filtering of owner in assets - When I am logged into TRACE_X_A application - And I request assets with - Then I check, if only assets with are responded - - Examples: - | owner-filter | - | "SUPPLIER" | - | "CUSTOMER" | - | "OWN" | + @TRACEFOSS-1221 @TRACEFOSS-3128 @TRACEFOSS-2910 @TRACEFOSS-2715 @TRACEFOSS-1101 @INTEGRATION_TEST + Scenario Outline: [BE] Check correct filtering of owner in assets + When I am logged into TRACE_X_A application + And I request assets with + Then I check, if only assets with are responded + + Examples: + | owner-filter | + | "SUPPLIER" | + | "CUSTOMER" | + | "OWN" | \ No newline at end of file diff --git a/tx-cucumber-tests/src/test/resources/features/10_TRACEFOSS-1125.feature b/tx-cucumber-tests/src/test/resources/features/11_TRACEFOSS-1125.feature similarity index 50% rename from tx-cucumber-tests/src/test/resources/features/10_TRACEFOSS-1125.feature rename to tx-cucumber-tests/src/test/resources/features/11_TRACEFOSS-1125.feature index 52715c4c06..57c5617d73 100644 --- a/tx-cucumber-tests/src/test/resources/features/10_TRACEFOSS-1125.feature +++ b/tx-cucumber-tests/src/test/resources/features/11_TRACEFOSS-1125.feature @@ -33,36 +33,36 @@ Feature: ⭐[BE] User select severity for Quality Investigation # * Add new secrets to the code # #  - @TRACEFOSS-1220 @TRACEFOSS-1920 @TEST-1217 @TRACEFOSS-1138 @TRACEFOSS-1139 @TRACEFOSS-1101 @TRACEFOSS-1673 @TEST-904 @INTEGRATION_TEST - Scenario Outline: [BE] Check correct processing of severity in quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' - And I create quality investigation - | "severity" | | - | "description" | "Testing severity TRACEFOSS-1220" | - Then I check, if quality investigation has proper values - | "severity" | | - | "description" | "Testing severity TRACEFOSS-1220" | - | "status" | "CREATED" | - When I approve quality investigation - Then I check, if quality investigation has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has been received - Then I check, if quality investigation has proper values - | "severity" | | - | "description" | "Testing severity TRACEFOSS-1220" | - | "status" | "RECEIVED" | - When I acknowledge quality investigation - Then I check, if quality investigation has proper values - | "status" | "ACKNOWLEDGED" | - When I am logged into TRACE_X_A application - Then I check, if quality investigation has proper values - | "status" | "ACKNOWLEDGED" | - - Examples: - | severity | - | "MINOR" | - | "MAJOR" | - | "CRITICAL" | - | "LIFE-THREATENING" | + @TRACEFOSS-1220 @TRACEFOSS-3128 @TRACEFOSS-2910 @TEST-1217 @TRACEFOSS-2715 @TEST-904 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @TRACEFOSS-1139 @TRACEFOSS-1138 @INTEGRATION_TEST @[QualityInvestigation] + Scenario Outline: [BE] Check correct processing of severity in quality investigation + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' + And I create quality investigation + | "severity" | | + | "description" | "Testing severity TRACEFOSS-1220" | + Then I check, if quality investigation has proper values + | "severity" | | + | "description" | "Testing severity TRACEFOSS-1220" | + | "status" | "CREATED" | + When I approve quality investigation + Then I check, if quality investigation has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality investigation has been received + Then I check, if quality investigation has proper values + | "severity" | | + | "description" | "Testing severity TRACEFOSS-1220" | + | "status" | "RECEIVED" | + When I acknowledge quality investigation + Then I check, if quality investigation has proper values + | "status" | "ACKNOWLEDGED" | + When I am logged into TRACE_X_A application + Then I check, if quality investigation has proper values + | "status" | "ACKNOWLEDGED" | + + Examples: + |severity| + |"MINOR"| + |"MAJOR"| + |"CRITICAL"| + |"LIFE-THREATENING"| \ No newline at end of file diff --git a/tx-cucumber-tests/src/test/resources/features/1_TRACEFOSS-1393.feature b/tx-cucumber-tests/src/test/resources/features/1_TRACEFOSS-1393.feature index 2ea0a7058a..a22cc7a01e 100644 --- a/tx-cucumber-tests/src/test/resources/features/1_TRACEFOSS-1393.feature +++ b/tx-cucumber-tests/src/test/resources/features/1_TRACEFOSS-1393.feature @@ -1,12 +1,12 @@ @TRACEFOSS-1393 Feature: ⭐ [BE][QUALITY_ALERTS] Create (POST) quality alerts (Rest API) - #h2. User Story + #h2. User Story # #*As a* user #*I want to* be able to see all quality alerts / notifications based on their status and type with the date created in a separate Quality Alerts inbox #*so that* I can have an overview and perform actions like view details on the notifications. # - #h2. Outcome + #h2. Outcome # #- (-) New table is added which shows "Quality Alerts" @@ -14,273 +14,19 @@ Feature: ⭐ [BE][QUALITY_ALERTS] Create (POST) quality alerts (Rest API) #* correct CANCELLATION on receiver side #* correct reception of status update on sender side #* correct reason on receiver and sender side - @TRACEFOSS-1864 @TRACEFOSS-1920 @TEST-1217 @TEST-904 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of CANCELLATION of quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1864" | - Then I check, if quality alert has proper values - | "description" | "Testing ACCEPTANCE TRACEFOSS-1864" | - | "status" | "CREATED" | - When I cancel quality alert - Then I check, if quality alert has proper values - | "status" | "CANCELED" | - - When I am logged into TRACE_X_B application - Then I check, if quality alert has not been received - - #Check if *CLOSURE* of quality alerts is processed correctly which contains following checks: - #* correct CLOSURE on receiver side - #* correct reception of status update on sender side - #* correct reason on receiver and sender side - @TRACEFOSS-1863 @TRACEFOSS-1920 @TEST-1217 @TEST-904 @TRACEFOSS-1101 @TRACEFOSS-1673 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of CLOSURE of quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1863" | - Then I check, if quality alert has proper values - | "description" | "Testing ACCEPTANCE TRACEFOSS-1863" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - And I check, if quality alert has proper values - | "status" | "RECEIVED" | - When I acknowledge quality alert - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - - When I am logged into TRACE_X_A application - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - When I close quality alert - Then I check, if quality alert has proper values - | "status" | "CLOSED" | - - When I am logged into TRACE_X_B application - Then I check, if quality alert has proper values - | "status" | "CLOSED" | - - #Check if *several parts* are processed correctly in *one* created quality alert which contains following checks: - #* correct sending of several parts in *one* alert - #* correct reception of several parts in *one* alert on receiver side - #* correct update of *one* alert with several parts - @TRACEFOSS-1670 @TRACEFOSS-1920 @TRACEFOSS-1101 @TRACEFOSS-1673 @TEST-904 @TEST-1217 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of several parts in quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd,urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MINOR" | - | "description" | "Testing severity TRACEFOSS-1670" | - Then I check, if quality alert has proper values - | "description" | "Testing severity TRACEFOSS-1670" | - | "status" | "CREATED" | - | "assetIdCount" | "2" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "description" | "Testing severity TRACEFOSS-1670" | - | "status" | "RECEIVED" | - | "assetIdCount" | "2" | - When I acknowledge quality alert - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - When I am logged into TRACE_X_A application - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - | "assetIdCount" | "2" | - - #Check if *bpn names* of *sender and receiver* are processed correctly for created quality alerts which contains following checks: - #* correct creation on sender side - #* correct reception on receiver side - @TRACEFOSS-1547 @TRACEFOSS-1101 @TRACEFOSS-1920 @TRACEFOSS-1673 @TEST-904 @TEST-1217 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of bpn names in quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "description" | "Testing BPNs TRACEFOSS-1547" | - | "severity" | "MINOR" | - Then I check, if quality alert has proper values - | "description" | "Testing BPNs TRACEFOSS-1547" | - | "createdBy" | "BPNL00000003CML1" | - | "sendTo" | "BPNL00000003CNKC" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "description" | "Testing BPNs TRACEFOSS-1547" | - | "createdBy" | "BPNL00000003CML1" | - | "sendTo" | "BPNL00000003CNKC" | - | "status" | "RECEIVED" | - - #Check if *targetDate = null* is processed correctly for created quality alerts which contains following checks: - #* correct sending of _targetDate_ = *null* - #* correct reception on receiver side - @TRACEFOSS-1546 @TRACEFOSS-1101 @TRACEFOSS-1920 @TRACEFOSS-1673 @TEST-904 @TEST-1217 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of targetDate = null in quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MINOR" | - | "description" | "Testing without targetDate TRACEFOSS-1546" | - Then I check, if quality alert has proper values - | "description" | "Testing without targetDate TRACEFOSS-1546" | - | "targetDate" | "" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "description" | "Testing without targetDate TRACEFOSS-1546" | - | "targetDate" | "" | - | "status" | "RECEIVED" | - - #Check if *DECLINATION* of quality alerts is processed correctly which contains following checks: - #* correct DECLINATION status on receiver side - #* correct reception of status update on sender side - #* correct reason on receiver and sender side - @TRACEFOSS-1545 @TRACEFOSS-1101 @TRACEFOSS-1920 @TRACEFOSS-1673 @TEST-904 @TEST-1217 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of DECLINATION of quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MAJOR" | - | "description" | "Testing DECLINATION TRACEFOSS-1545" | - Then I check, if quality alert has proper values - | "severity" | "MAJOR" | - | "description" | "Testing DECLINATION TRACEFOSS-1545" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "severity" | "MAJOR" | - | "description" | "Testing DECLINATION TRACEFOSS-1545" | - | "status" | "RECEIVED" | - When I acknowledge quality alert - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - When I decline quality alert - | "reason" | "declined in TRACEFOSS-1545" | - Then I check, if quality alert has proper values - | "status" | "DECLINED" | - When I am logged into TRACE_X_A application - Then I check, if quality alert has proper values - | "status" | "DECLINED" | - And I check, if quality alert has proper values - | "declineReason" | "declined in TRACEFOSS-1545" | - - #Check if *ACCEPTANCE* of quality alerts is processed correctly which contains following checks: - #* correct ACCEPTANCE on receiver side - #* correct reception of status update on sender side - #* correct reason on receiver and sender side - @TRACEFOSS-1544 @TRACEFOSS-1101 @TRACEFOSS-1920 @TEST-904 @TRACEFOSS-1673 @TEST-1217 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of ACCEPTANCE of quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1544" | - Then I check, if quality alert has proper values - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1544" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1544" | - | "status" | "RECEIVED" | - When I acknowledge quality alert - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - When I accept quality alert - | "reason" | "accepted in TRACEFOSS-1544" | - Then I check, if quality alert has proper values - | "status" | "ACCEPTED" | - When I am logged into TRACE_X_A application - Then I check, if quality alert has proper values - | "status" | "ACCEPTED" | - And I check, if quality alert has proper values - | "acceptReason" | "accepted in TRACEFOSS-1544" | - - #Check if *targetDate* is processed correctly for created quality alerts which contains following checks: - #* correct sending of _targetDate_ - #* correct reception on receiver side - @TRACEFOSS-1543 @TRACEFOSS-1920 @TEST-904 @TRACEFOSS-1673 @TRACEFOSS-1101 @TEST-1217 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of targetDate in quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MINOR" | - | "description" | "Testing targetDate TRACEFOSS-1543" | - | "targetDate" | "2055-05-30T20:43:06.333827Z" | - Then I check, if quality alert has proper values - | "description" | "Testing targetDate TRACEFOSS-1543" | - | "targetDate" | "2055-05-30T20:43:06.333827Z" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "description" | "Testing targetDate TRACEFOSS-1543" | - | "targetDate" | "2055-05-30T20:43:06.333827Z" | - | "status" | "RECEIVED" | - - #Check if *severity* is processed correctly for created quality alerts which contains following checks: - #* correct creation - #* correct reception on receiver side - @TRACEFOSS-1539 @TRACEFOSS-1920 @TRACEFOSS-1101 @TRACEFOSS-1673 @TEST-904 @TEST-1217 @INTEGRATION_TEST - Scenario Outline: [BE] Check correct processing of severity in quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | | - | "description" | "Testing severity TRACEFOSS-1539" | - Then I check, if quality alert has proper values - | "severity" | | - | "description" | "Testing severity TRACEFOSS-1539" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "severity" | | - | "description" | "Testing severity TRACEFOSS-1539" | - | "status" | "RECEIVED" | - When I acknowledge quality alert - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - When I am logged into TRACE_X_A application - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - - Examples: - | severity | - | "MINOR" | - | "MAJOR" | - | "CRITICAL" | - | "LIFE-THREATENING" | + @TRACEFOSS-1864 @TRACEFOSS-3128 @TRACEFOSS-2910 @TEST-1217 @TRACEFOSS-2715 @TEST-904 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST @[QUALITY_ALERTS] + Scenario: [BE] Check correct processing of CANCELLATION of quality alerts + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa02' + And I create quality alert + | "severity" | "MAJOR" | + | "description" | "Testing ACCEPTANCE TRACEFOSS-1864" | + Then I check, if quality alert has proper values + | "description" | "Testing ACCEPTANCE TRACEFOSS-1864" | + | "status" | "CREATED" | + When I cancel quality alert + Then I check, if quality alert has proper values + | "status" | "CANCELED" | + + When I am logged into TRACE_X_B application + Then I check, if quality alert has not been received \ No newline at end of file diff --git a/tx-cucumber-tests/src/test/resources/features/2_TRACEFOSS-600.feature b/tx-cucumber-tests/src/test/resources/features/2_TRACEFOSS-600.feature index 80cd5f64d1..85615c8d2f 100644 --- a/tx-cucumber-tests/src/test/resources/features/2_TRACEFOSS-600.feature +++ b/tx-cucumber-tests/src/test/resources/features/2_TRACEFOSS-600.feature @@ -29,245 +29,224 @@ Feature: ⭐ [BE][QUALITY_ALERTS] Enable Quality Alerts # ** [https://github.com/catenax-ng/tx-traceability-foss/pull/264/files#diff-de4cfce80ee64138f3cdf6ab0af7b29aed8687212738a0a2d18567e29e7b9472R31] # **   - #Check if *CANCELLATION* of quality alerts is processed correctly which contains following checks: - #* correct CANCELLATION on receiver side - #* correct reception of status update on sender side - #* correct reason on receiver and sender side - @TRACEFOSS-1864 @TRACEFOSS-1920 @TEST-1217 @TEST-904 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of CANCELLATION of quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1864" | - Then I check, if quality alert has proper values - | "description" | "Testing ACCEPTANCE TRACEFOSS-1864" | - | "status" | "CREATED" | - When I cancel quality alert - Then I check, if quality alert has proper values - | "status" | "CANCELED" | - - When I am logged into TRACE_X_B application - Then I check, if quality alert has not been received - #Check if *CLOSURE* of quality alerts is processed correctly which contains following checks: #* correct CLOSURE on receiver side #* correct reception of status update on sender side #* correct reason on receiver and sender side - @TRACEFOSS-1863 @TRACEFOSS-1920 @TEST-1217 @TEST-904 @TRACEFOSS-1101 @TRACEFOSS-1673 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of CLOSURE of quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1863" | - Then I check, if quality alert has proper values - | "description" | "Testing ACCEPTANCE TRACEFOSS-1863" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - And I check, if quality alert has proper values - | "status" | "RECEIVED" | - When I acknowledge quality alert - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - - When I am logged into TRACE_X_A application - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - When I close quality alert - Then I check, if quality alert has proper values - | "status" | "CLOSED" | - - When I am logged into TRACE_X_B application - Then I check, if quality alert has proper values - | "status" | "CLOSED" | + @TRACEFOSS-1863 @TRACEFOSS-3128 @TRACEFOSS-2910 @TEST-1217 @TRACEFOSS-2715 @TEST-904 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST @[QUALITY_ALERTS] + Scenario: [BE] Check correct processing of CLOSURE of quality alerts + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa02' + And I create quality alert + | "severity" | "MAJOR" | + | "description" | "Testing ACCEPTANCE TRACEFOSS-1863" | + Then I check, if quality alert has proper values + | "description" | "Testing ACCEPTANCE TRACEFOSS-1863" | + | "status" | "CREATED" | + When I approve quality alert + Then I check, if quality alert has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality alert has been received + And I check, if quality alert has proper values + | "status" | "RECEIVED" | + When I acknowledge quality alert + Then I check, if quality alert has proper values + | "status" | "ACKNOWLEDGED" | + + When I am logged into TRACE_X_A application + Then I check, if quality alert has proper values + | "status" | "ACKNOWLEDGED" | + When I close quality alert + Then I check, if quality alert has proper values + | "status" | "CLOSED" | + + When I am logged into TRACE_X_B application + Then I check, if quality alert has proper values + | "status" | "CLOSED" | #Check if *bpn names* of *sender and receiver* are processed correctly for created quality alerts which contains following checks: #* correct creation on sender side #* correct reception on receiver side - @TRACEFOSS-1547 @TRACEFOSS-1101 @TRACEFOSS-1920 @TRACEFOSS-1673 @TEST-904 @TEST-1217 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of bpn names in quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "description" | "Testing BPNs TRACEFOSS-1547" | - | "severity" | "MINOR" | - Then I check, if quality alert has proper values - | "description" | "Testing BPNs TRACEFOSS-1547" | - | "createdBy" | "BPNL00000003CML1" | - | "sendTo" | "BPNL00000003CNKC" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "description" | "Testing BPNs TRACEFOSS-1547" | - | "createdBy" | "BPNL00000003CML1" | - | "sendTo" | "BPNL00000003CNKC" | - | "status" | "RECEIVED" | + @TRACEFOSS-1547 @TRACEFOSS-3128 @TRACEFOSS-2910 @TRACEFOSS-2715 @TEST-904 @TEST-1217 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST @[QUALITY_ALERTS] + Scenario: [BE] Check correct processing of bpn names in quality alerts + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa02' + And I create quality alert + | "description" | "Testing BPNs TRACEFOSS-1547" | + | "severity" | "MINOR" | + Then I check, if quality alert has proper values + | "description" | "Testing BPNs TRACEFOSS-1547" | + | "createdBy" | "BPNL00000003CML1" | + | "sendTo" | "BPNL00000003CNKC" | + | "status" | "CREATED" | + When I approve quality alert + Then I check, if quality alert has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality alert has been received + Then I check, if quality alert has proper values + | "description" | "Testing BPNs TRACEFOSS-1547" | + | "createdBy" | "BPNL00000003CML1" | + | "sendTo" | "BPNL00000003CNKC" | + | "status" | "RECEIVED" | #Check if *targetDate = null* is processed correctly for created quality alerts which contains following checks: #* correct sending of _targetDate_ = *null* #* correct reception on receiver side - @TRACEFOSS-1546 @TRACEFOSS-1101 @TRACEFOSS-1920 @TRACEFOSS-1673 @TEST-904 @TEST-1217 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of targetDate = null in quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MINOR" | - | "description" | "Testing without targetDate TRACEFOSS-1546" | - Then I check, if quality alert has proper values - | "description" | "Testing without targetDate TRACEFOSS-1546" | - | "targetDate" | "" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "description" | "Testing without targetDate TRACEFOSS-1546" | - | "targetDate" | "" | - | "status" | "RECEIVED" | + @TRACEFOSS-1546 @TRACEFOSS-3128 @TRACEFOSS-2910 @TRACEFOSS-2715 @TEST-904 @TEST-1217 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST @[QUALITY_ALERTS] + Scenario: [BE] Check correct processing of targetDate = null in quality alerts + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa02' + And I create quality alert + | "severity" | "MINOR" | + | "description" | "Testing without targetDate TRACEFOSS-1546" | + Then I check, if quality alert has proper values + | "description" | "Testing without targetDate TRACEFOSS-1546" | + | "targetDate" | "" | + | "status" | "CREATED" | + When I approve quality alert + Then I check, if quality alert has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality alert has been received + Then I check, if quality alert has proper values + | "description" | "Testing without targetDate TRACEFOSS-1546" | + | "targetDate" | "" | + | "status" | "RECEIVED" | #Check if *DECLINATION* of quality alerts is processed correctly which contains following checks: #* correct DECLINATION status on receiver side #* correct reception of status update on sender side #* correct reason on receiver and sender side - @TRACEFOSS-1545 @TRACEFOSS-1101 @TRACEFOSS-1920 @TRACEFOSS-1673 @TEST-904 @TEST-1217 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of DECLINATION of quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MAJOR" | - | "description" | "Testing DECLINATION TRACEFOSS-1545" | - Then I check, if quality alert has proper values - | "severity" | "MAJOR" | - | "description" | "Testing DECLINATION TRACEFOSS-1545" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "severity" | "MAJOR" | - | "description" | "Testing DECLINATION TRACEFOSS-1545" | - | "status" | "RECEIVED" | - When I acknowledge quality alert - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - When I decline quality alert - | "reason" | "declined in TRACEFOSS-1545" | - Then I check, if quality alert has proper values - | "status" | "DECLINED" | - When I am logged into TRACE_X_A application - Then I check, if quality alert has proper values - | "status" | "DECLINED" | - And I check, if quality alert has proper values - | "declineReason" | "declined in TRACEFOSS-1545" | + @TRACEFOSS-1545 @TRACEFOSS-3128 @TRACEFOSS-2910 @TRACEFOSS-2715 @TEST-904 @TEST-1217 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST @[QUALITY_ALERTS] + Scenario: [BE] Check correct processing of DECLINATION of quality alerts + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa02' + And I create quality alert + | "severity" | "MAJOR" | + | "description" | "Testing DECLINATION TRACEFOSS-1545" | + Then I check, if quality alert has proper values + | "severity" | "MAJOR" | + | "description" | "Testing DECLINATION TRACEFOSS-1545" | + | "status" | "CREATED" | + When I approve quality alert + Then I check, if quality alert has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality alert has been received + Then I check, if quality alert has proper values + | "severity" | "MAJOR" | + | "description" | "Testing DECLINATION TRACEFOSS-1545" | + | "status" | "RECEIVED" | + When I acknowledge quality alert + Then I check, if quality alert has proper values + | "status" | "ACKNOWLEDGED" | + When I decline quality alert + | "reason" | "declined in TRACEFOSS-1545" | + Then I check, if quality alert has proper values + | "status" | "DECLINED" | + When I am logged into TRACE_X_A application + Then I check, if quality alert has proper values + | "status" | "DECLINED" | + And I check, if quality alert has proper values + | "declineReason" | "declined in TRACEFOSS-1545" | #Check if *ACCEPTANCE* of quality alerts is processed correctly which contains following checks: #* correct ACCEPTANCE on receiver side #* correct reception of status update on sender side #* correct reason on receiver and sender side - @TRACEFOSS-1544 @TRACEFOSS-1101 @TRACEFOSS-1920 @TEST-904 @TRACEFOSS-1673 @TEST-1217 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of ACCEPTANCE of quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1544" | - Then I check, if quality alert has proper values - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1544" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1544" | - | "status" | "RECEIVED" | - When I acknowledge quality alert - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - When I accept quality alert - | "reason" | "accepted in TRACEFOSS-1544" | - Then I check, if quality alert has proper values - | "status" | "ACCEPTED" | - When I am logged into TRACE_X_A application - Then I check, if quality alert has proper values - | "status" | "ACCEPTED" | - And I check, if quality alert has proper values - | "acceptReason" | "accepted in TRACEFOSS-1544" | + @TRACEFOSS-1544 @TRACEFOSS-3128 @TRACEFOSS-2910 @TRACEFOSS-2715 @TEST-904 @TEST-1217 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST @[QUALITY_ALERTS] + Scenario: [BE] Check correct processing of ACCEPTANCE of quality alerts + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa02' + And I create quality alert + | "severity" | "MAJOR" | + | "description" | "Testing ACCEPTANCE TRACEFOSS-1544" | + Then I check, if quality alert has proper values + | "severity" | "MAJOR" | + | "description" | "Testing ACCEPTANCE TRACEFOSS-1544" | + | "status" | "CREATED" | + When I approve quality alert + Then I check, if quality alert has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality alert has been received + Then I check, if quality alert has proper values + | "severity" | "MAJOR" | + | "description" | "Testing ACCEPTANCE TRACEFOSS-1544" | + | "status" | "RECEIVED" | + When I acknowledge quality alert + Then I check, if quality alert has proper values + | "status" | "ACKNOWLEDGED" | + When I accept quality alert + | "reason" | "accepted in TRACEFOSS-1544" | + Then I check, if quality alert has proper values + | "status" | "ACCEPTED" | + When I am logged into TRACE_X_A application + Then I check, if quality alert has proper values + | "status" | "ACCEPTED" | + And I check, if quality alert has proper values + | "acceptReason" | "accepted in TRACEFOSS-1544" | #Check if *targetDate* is processed correctly for created quality alerts which contains following checks: #* correct sending of _targetDate_ #* correct reception on receiver side - @TRACEFOSS-1543 @TRACEFOSS-1920 @TEST-904 @TRACEFOSS-1673 @TRACEFOSS-1101 @TEST-1217 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of targetDate in quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MINOR" | - | "description" | "Testing targetDate TRACEFOSS-1543" | - | "targetDate" | "2055-05-30T20:43:06.333827Z" | - Then I check, if quality alert has proper values - | "description" | "Testing targetDate TRACEFOSS-1543" | - | "targetDate" | "2055-05-30T20:43:06.333827Z" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "description" | "Testing targetDate TRACEFOSS-1543" | - | "targetDate" | "2055-05-30T20:43:06.333827Z" | - | "status" | "RECEIVED" | + @TRACEFOSS-1543 @TRACEFOSS-3128 @TRACEFOSS-2910 @TRACEFOSS-2715 @TEST-904 @TEST-1217 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST @[QUALITY_ALERTS] + Scenario: [BE] Check correct processing of targetDate in quality alerts + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa02' + And I create quality alert + | "severity" | "MINOR" | + | "description" | "Testing targetDate TRACEFOSS-1543" | + | "targetDate" | "2055-05-30T20:43:06.333827Z" | + Then I check, if quality alert has proper values + | "description" | "Testing targetDate TRACEFOSS-1543" | + | "targetDate" | "2055-05-30T20:43:06.333827Z" | + | "status" | "CREATED" | + When I approve quality alert + Then I check, if quality alert has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality alert has been received + Then I check, if quality alert has proper values + | "description" | "Testing targetDate TRACEFOSS-1543" | + | "targetDate" | "2055-05-30T20:43:06.333827Z" | + | "status" | "RECEIVED" | #Check if *severity* is processed correctly for created quality alerts which contains following checks: #* correct creation #* correct reception on receiver side - @TRACEFOSS-1539 @TRACEFOSS-1920 @TRACEFOSS-1101 @TRACEFOSS-1673 @TEST-904 @TEST-1217 @INTEGRATION_TEST - Scenario Outline: [BE] Check correct processing of severity in quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | | - | "description" | "Testing severity TRACEFOSS-1539" | - Then I check, if quality alert has proper values - | "severity" | | - | "description" | "Testing severity TRACEFOSS-1539" | - | "status" | "CREATED" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "severity" | | - | "description" | "Testing severity TRACEFOSS-1539" | - | "status" | "RECEIVED" | - When I acknowledge quality alert - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - When I am logged into TRACE_X_A application - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - - Examples: - | severity | - | "MINOR" | - | "MAJOR" | - | "CRITICAL" | - | "LIFE-THREATENING" | + @TRACEFOSS-1539 @TRACEFOSS-3128 @TRACEFOSS-2910 @TEST-1217 @TRACEFOSS-2715 @TEST-904 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST @[QUALITY_ALERTS] + Scenario Outline: [BE] Check correct processing of severity in quality alerts + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa02' + And I create quality alert + | "severity" | | + | "description" | "Testing severity TRACEFOSS-1539" | + Then I check, if quality alert has proper values + | "severity" | | + | "description" | "Testing severity TRACEFOSS-1539" | + | "status" | "CREATED" | + When I approve quality alert + Then I check, if quality alert has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality alert has been received + Then I check, if quality alert has proper values + | "severity" | | + | "description" | "Testing severity TRACEFOSS-1539" | + | "status" | "RECEIVED" | + When I acknowledge quality alert + Then I check, if quality alert has proper values + | "status" | "ACKNOWLEDGED" | + When I am logged into TRACE_X_A application + Then I check, if quality alert has proper values + | "status" | "ACKNOWLEDGED" | + + Examples: + |severity| + |"MINOR"| + |"MAJOR"| + |"CRITICAL"| + |"LIFE-THREATENING"| \ No newline at end of file diff --git a/tx-cucumber-tests/src/test/resources/features/3_TRACEFOSS-936.feature b/tx-cucumber-tests/src/test/resources/features/3_TRACEFOSS-936.feature deleted file mode 100644 index d22d304d11..0000000000 --- a/tx-cucumber-tests/src/test/resources/features/3_TRACEFOSS-936.feature +++ /dev/null @@ -1,149 +0,0 @@ -@TRACEFOSS-936 -Feature: ⭐[BE] Include reason for receiver and sender investigations - #*As a* Dev - # - #*I want to* update contract of: - # - #/investigations/created (sender side of notifications) - #/investigations/received (receiver side of notifications) - # - #with following object: - #{code:java} - #{ - # "reason" : { - # "close" : $string, - # "accept": $string, | nullable - # "decline": $string | nullable - # } - #} {code} - #Where for accept and decline reason, it's either one or another. Reasons are passed from receiver to sender and from sender to receiver via EDC and stored in the database. - # - #*so that* the information provided with the update is also stored and provided to sender and receiver sides. - - #Check if *CANCELLATION* of quality investigations is processed correctly which contains following checks: - #* correct CANCELLATION on receiver side - #* correct reception of status update on sender side - #* correct reason on receiver and sender side - @TRACEFOSS-1862 @TRACEFOSS-1920 @TEST-1217 @TEST-904 @TRACEFOSS-1101 @TRACEFOSS-1673 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of CANCELLATION of quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' - And I create quality investigation - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1862" | - Then I check, if quality investigation has proper values - | "description" | "Testing ACCEPTANCE TRACEFOSS-1862" | - | "status" | "CREATED" | - When I cancel quality investigation - Then I check, if quality investigation has proper values - | "status" | "CANCELED" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has not been received - - #Check if *CLOSURE* of quality investigations is processed correctly which contains following checks: - #* correct CLOSE on receiver side - #* correct reception of status update on sender side - #* correct reason on receiver and sender side - @TRACEFOSS-1861 @TRACEFOSS-1920 @TEST-1217 @TRACEFOSS-1101 @TEST-904 @TRACEFOSS-1673 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of CLOSURE of quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' - And I create quality investigation - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1861" | - Then I check, if quality investigation has proper values - | "description" | "Testing ACCEPTANCE TRACEFOSS-1861" | - | "status" | "CREATED" | - When I approve quality investigation - Then I check, if quality investigation has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has been received - And I check, if quality investigation has proper values - | "status" | "RECEIVED" | - When I acknowledge quality investigation - Then I check, if quality investigation has proper values - | "status" | "ACKNOWLEDGED" | - - When I am logged into TRACE_X_A application - Then I check, if quality investigation has proper values - | "status" | "ACKNOWLEDGED" | - When I close quality investigation - Then I check, if quality investigation has proper values - | "status" | "CLOSED" | - - When I am logged into TRACE_X_B application - Then I check, if quality investigation has proper values - | "status" | "CLOSED" | - - #Check if *DECLINATION* of quality investigations is processed correctly which contains following checks: - #* correct DECLINATION status on receiver side - #* correct reception of status update on sender side - #* correct reason on receiver and sender side - @TRACEFOSS-1223 @TRACEFOSS-1920 @TRACEFOSS-1673 @TEST-1217 @TRACEFOSS-1139 @TEST-904 @TRACEFOSS-1138 @TRACEFOSS-1101 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of DECLINATION of quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' - And I create quality investigation - | "severity" | "MAJOR" | - | "description" | "Testing DECLINATION TRACEFOSS-1223" | - Then I check, if quality investigation has proper values - | "severity" | "MAJOR" | - | "description" | "Testing DECLINATION TRACEFOSS-1223" | - | "status" | "CREATED" | - When I approve quality investigation - Then I check, if quality investigation has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has been received - Then I check, if quality investigation has proper values - | "severity" | "MAJOR" | - | "description" | "Testing DECLINATION TRACEFOSS-1223" | - | "status" | "RECEIVED" | - When I acknowledge quality investigation - Then I check, if quality investigation has proper values - | "status" | "ACKNOWLEDGED" | - When I decline quality investigation - | "reason" | "declined in TRACEFOSS-1223" | - Then I check, if quality investigation has proper values - | "status" | "DECLINED" | - When I am logged into TRACE_X_A application - Then I check, if quality investigation has proper values - | "status" | "DECLINED" | - | "declineReason" | "declined in TRACEFOSS-1223" | - - #Check if *ACCEPTANCE* of quality investigations is processed correctly which contains following checks: - #* correct ACCEPTANCE on receiver side - #* correct reception of status update on sender side - #* correct reason on receiver and sender side - @TRACEFOSS-1222 @TRACEFOSS-1920 @TRACEFOSS-1673 @TEST-1217 @TRACEFOSS-1139 @TRACEFOSS-1138 @TRACEFOSS-1101 @TEST-904 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of ACCEPTANCE of quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' - And I create quality investigation - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1222" | - Then I check, if quality investigation has proper values - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1222" | - | "status" | "CREATED" | - When I approve quality investigation - Then I check, if quality investigation has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has been received - Then I check, if quality investigation has proper values - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1222" | - | "status" | "RECEIVED" | - When I acknowledge quality investigation - Then I check, if quality investigation has proper values - | "status" | "ACKNOWLEDGED" | - When I accept quality investigation - | "reason" | "accepted in TRACEFOSS-1222" | - Then I check, if quality investigation has proper values - | "status" | "ACCEPTED" | - When I am logged into TRACE_X_A application - Then I check, if quality investigation has proper values - | "status" | "ACCEPTED" | - | "acceptReason" | "accepted in TRACEFOSS-1222" | diff --git a/tx-cucumber-tests/src/test/resources/features/3_TRACEFOSS-938.feature b/tx-cucumber-tests/src/test/resources/features/3_TRACEFOSS-938.feature new file mode 100644 index 0000000000..ffff53fabe --- /dev/null +++ b/tx-cucumber-tests/src/test/resources/features/3_TRACEFOSS-938.feature @@ -0,0 +1,52 @@ +@TRACEFOSS-938 +Feature: ⭐[TEST] Update Quality Investigation (over EDC) + #h2. User Story + # + #*As* Supervisor + #*I want* to be able to update a quality investigation that I received + #*so that* the corresponding partner knows in which status the notification is on my side. + #h2. Hints / Details / . Hints & NFR (Technical, Design & Content))* :  + # + #1. BPN B receives a notification + #2. BPN B updates notification + #3. BPN A receives notification update with corresponding status + # * The right notification asset needs to be looked up in the Catalog offer of the counter side + # * Lookup based on asset:props + # * Keep in mind that some fields are optional and might be empty + # ** Handle based on documentation / agreement like for send/receive + # ** E.g. "information" will be empty for Update from REC to ACK + # * Utilize EDC Update functionality in order to send investigation update over EDC from BNP B to BPN A. + # + #Docs: [Notification Update Docu|https://confluence.catena-x.net/pages/viewpage.action?pageId=69429778#id-(TRS)[Release3]%F0%9F%93%9CTraceabilityApp(ImplementationSpecification)-HttpPOSTendpointtoupdateanotification] + # + #!screenshot-1.png|thumbnail! + #h2. TODO: + # * (-) Fill out description + # * (-) Fill out Story Points + # * (-) Assign an Assignee + # * (-) define Acceptance Criteria + # * (-) [DoR |https://confluence.catena-x.net/pages/viewpage.action?pageId=917505]  + # + #h2. LOP + # * (/) [~thomas.braun3@zf.com] Update AC and describe error handling, retry and rollback. + # * (/) Add pbi for "Close notification on sender side". --> TRACEFOSS-961 + + #Check if *CANCELLATION* of quality investigations is processed correctly which contains following checks: + #* correct CANCELLATION on receiver side + #* correct reception of status update on sender side + #* correct reason on receiver and sender side + @TRACEFOSS-1862 @TRACEFOSS-3128 @TRACEFOSS-2910 @TEST-1217 @TRACEFOSS-2715 @TEST-904 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST @[QualityInvestigation] + Scenario: [BE] Check correct processing of CANCELLATION of quality investigation + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' + And I create quality investigation + | "severity" | "MAJOR" | + | "description" | "Testing ACCEPTANCE TRACEFOSS-1862" | + Then I check, if quality investigation has proper values + | "description" | "Testing ACCEPTANCE TRACEFOSS-1862" | + | "status" | "CREATED" | + When I cancel quality investigation + Then I check, if quality investigation has proper values + | "status" | "CANCELED" | + When I am logged into TRACE_X_B application + Then I check, if quality investigation has not been received \ No newline at end of file diff --git a/tx-cucumber-tests/src/test/resources/features/4_TRACEFOSS-936.feature b/tx-cucumber-tests/src/test/resources/features/4_TRACEFOSS-936.feature new file mode 100644 index 0000000000..ac5293918a --- /dev/null +++ b/tx-cucumber-tests/src/test/resources/features/4_TRACEFOSS-936.feature @@ -0,0 +1,93 @@ +@TRACEFOSS-936 +Feature: ⭐[BE] Include reason for receiver and sender investigations + #*As a* Dev + # + #*I want to* update contract of: + # + #/investigations/created (sender side of notifications) + #/investigations/received (receiver side of notifications) + # + #with following object: + #{code:java} + #{ + # "reason" : { + # "close" : $string, + # "accept": $string, | nullable + # "decline": $string | nullable + # } + #} {code} + #Where for accept and decline reason, it's either one or another. Reasons are passed from receiver to sender and from sender to receiver via EDC and stored in the database. + # + #*so that* the information provided with the update is also stored and provided to sender and receiver sides. + + #Check if *CLOSURE* of quality investigations is processed correctly which contains following checks: + #* correct CLOSE on receiver side + #* correct reception of status update on sender side + #* correct reason on receiver and sender side + @TRACEFOSS-1861 @TRACEFOSS-3128 @TRACEFOSS-2910 @TEST-1217 @TRACEFOSS-2715 @TEST-904 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST @[QualityInvestigation] + Scenario: [BE] Check correct processing of CLOSURE of quality investigation + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' + And I create quality investigation + | "severity" | "MAJOR" | + | "description" | "Testing CLOSURE TRACEFOSS-1861" | + Then I check, if quality investigation has proper values + | "description" | "Testing CLOSURE TRACEFOSS-1861" | + | "status" | "CREATED" | + When I approve quality investigation + Then I check, if quality investigation has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality investigation has been received + And I check, if quality investigation has proper values + | "status" | "RECEIVED" | + When I acknowledge quality investigation + Then I check, if quality investigation has proper values + | "status" | "ACKNOWLEDGED" | + + When I am logged into TRACE_X_A application + Then I check, if quality investigation has proper values + | "status" | "ACKNOWLEDGED" | + When I close quality investigation + Then I check, if quality investigation has proper values + | "status" | "CLOSED" | + + When I am logged into TRACE_X_B application + Then I check, if quality investigation has proper values + | "status" | "CLOSED" | + + #Check if *ACCEPTANCE* of quality investigations is processed correctly which contains following checks: + #* correct ACCEPTANCE on receiver side + #* correct reception of status update on sender side + #* correct reason on receiver and sender side + @TRACEFOSS-1222 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1139 @TRACEFOSS-1138 @TRACEFOSS-1101 @TRACEFOSS-2910 @TRACEFOSS-2715 @TEST-1217 @TEST-904 @TRACEFOSS-3128 @INTEGRATION_TEST @[QualityInvestigation] + Scenario: [BE] Check correct processing of ACCEPTANCE of quality investigation + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' + And I create quality investigation + | "severity" | "MAJOR" | + | "description" | "Testing ACCEPTANCE TRACEFOSS-1222" | + Then I check, if quality investigation has proper values + | "severity" | "MAJOR" | + | "description" | "Testing ACCEPTANCE TRACEFOSS-1222" | + | "status" | "CREATED" | + When I approve quality investigation + Then I check, if quality investigation has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality investigation has been received + Then I check, if quality investigation has proper values + | "severity" | "MAJOR" | + | "description" | "Testing ACCEPTANCE TRACEFOSS-1222" | + | "status" | "RECEIVED" | + When I acknowledge quality investigation + Then I check, if quality investigation has proper values + | "status" | "ACKNOWLEDGED" | + When I accept quality investigation + | "reason" | "accepted in TRACEFOSS-1222" | + Then I check, if quality investigation has proper values + | "status" | "ACCEPTED" | + When I am logged into TRACE_X_A application + Then I check, if quality investigation has proper values + | "status" | "ACCEPTED" | + | "acceptReason" | "accepted in TRACEFOSS-1222" | \ No newline at end of file diff --git a/tx-cucumber-tests/src/test/resources/features/4_TRACEFOSS-938.feature b/tx-cucumber-tests/src/test/resources/features/4_TRACEFOSS-938.feature deleted file mode 100644 index 325baa66f4..0000000000 --- a/tx-cucumber-tests/src/test/resources/features/4_TRACEFOSS-938.feature +++ /dev/null @@ -1,160 +0,0 @@ -@TRACEFOSS-938 -Feature: ⭐[TEST] Update Quality Investigation (over EDC) - #h2. User Story - # - #*As* Supervisor - #*I want* to be able to update a quality investigation that I received - #*so that* the corresponding partner knows in which status the notification is on my side. - #h2. Hints / Details / . Hints & NFR (Technical, Design & Content))* :  - # - #1. BPN B receives a notification - #2. BPN B updates notification - #3. BPN A receives notification update with corresponding status - # * The right notification asset needs to be looked up in the Catalog offer of the counter side - # * Lookup based on asset:props - # * Keep in mind that some fields are optional and might be empty - # ** Handle based on documentation / agreement like for send/receive - # ** E.g. "information" will be empty for Update from REC to ACK - # * Utilize EDC Update functionality in order to send investigation update over EDC from BNP B to BPN A. - # - #Docs: [Notification Update Docu|https://confluence.catena-x.net/pages/viewpage.action?pageId=69429778#id-(TRS)[Release3]%F0%9F%93%9CTraceabilityApp(ImplementationSpecification)-HttpPOSTendpointtoupdateanotification] - # - #!screenshot-1.png|thumbnail! - #h2. TODO: - # * (-) Fill out description - # * (-) Fill out Story Points - # * (-) Assign an Assignee - # * (-) define Acceptance Criteria - # * (-) [DoR |https://confluence.catena-x.net/pages/viewpage.action?pageId=917505]  - # - #h2. LOP - # * (/) [~thomas.braun3@zf.com] Update AC and describe error handling, retry and rollback. - # * (/) Add pbi for "Close notification on sender side". --> TRACEFOSS-961 - - #Check if *CANCELLATION* of quality investigations is processed correctly which contains following checks: - #* correct CANCELLATION on receiver side - #* correct reception of status update on sender side - #* correct reason on receiver and sender side - @TRACEFOSS-1862 @TRACEFOSS-1920 @TEST-1217 @TEST-904 @TRACEFOSS-1101 @TRACEFOSS-1673 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of CANCELLATION of quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' - And I create quality investigation - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1862" | - Then I check, if quality investigation has proper values - | "description" | "Testing ACCEPTANCE TRACEFOSS-1862" | - | "status" | "CREATED" | - When I cancel quality investigation - Then I check, if quality investigation has proper values - | "status" | "CANCELED" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has not been received - - #Check if *CLOSURE* of quality investigations is processed correctly which contains following checks: - #* correct CLOSE on receiver side - #* correct reception of status update on sender side - #* correct reason on receiver and sender side - @TRACEFOSS-1861 @TRACEFOSS-1920 @TEST-1217 @TRACEFOSS-1101 @TEST-904 @TRACEFOSS-1673 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of CLOSURE of quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' - And I create quality investigation - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1861" | - Then I check, if quality investigation has proper values - | "description" | "Testing ACCEPTANCE TRACEFOSS-1861" | - | "status" | "CREATED" | - When I approve quality investigation - Then I check, if quality investigation has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has been received - And I check, if quality investigation has proper values - | "status" | "RECEIVED" | - When I acknowledge quality investigation - Then I check, if quality investigation has proper values - | "status" | "ACKNOWLEDGED" | - - When I am logged into TRACE_X_A application - Then I check, if quality investigation has proper values - | "status" | "ACKNOWLEDGED" | - When I close quality investigation - Then I check, if quality investigation has proper values - | "status" | "CLOSED" | - - When I am logged into TRACE_X_B application - Then I check, if quality investigation has proper values - | "status" | "CLOSED" | - - #Check if *DECLINATION* of quality investigations is processed correctly which contains following checks: - #* correct DECLINATION status on receiver side - #* correct reception of status update on sender side - #* correct reason on receiver and sender side - @TRACEFOSS-1223 @TRACEFOSS-1920 @TRACEFOSS-1673 @TEST-1217 @TRACEFOSS-1139 @TEST-904 @TRACEFOSS-1138 @TRACEFOSS-1101 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of DECLINATION of quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' - And I create quality investigation - | "severity" | "MAJOR" | - | "description" | "Testing DECLINATION TRACEFOSS-1223" | - Then I check, if quality investigation has proper values - | "severity" | "MAJOR" | - | "description" | "Testing DECLINATION TRACEFOSS-1223" | - | "status" | "CREATED" | - When I approve quality investigation - Then I check, if quality investigation has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has been received - Then I check, if quality investigation has proper values - | "severity" | "MAJOR" | - | "description" | "Testing DECLINATION TRACEFOSS-1223" | - | "status" | "RECEIVED" | - When I acknowledge quality investigation - Then I check, if quality investigation has proper values - | "status" | "ACKNOWLEDGED" | - When I decline quality investigation - | "reason" | "declined in TRACEFOSS-1223" | - Then I check, if quality investigation has proper values - | "status" | "DECLINED" | - When I am logged into TRACE_X_A application - Then I check, if quality investigation has proper values - | "status" | "DECLINED" | - | "declineReason" | "declined in TRACEFOSS-1223" | - - #Check if *ACCEPTANCE* of quality investigations is processed correctly which contains following checks: - #* correct ACCEPTANCE on receiver side - #* correct reception of status update on sender side - #* correct reason on receiver and sender side - @TRACEFOSS-1222 @TRACEFOSS-1920 @TRACEFOSS-1673 @TEST-1217 @TRACEFOSS-1139 @TRACEFOSS-1138 @TRACEFOSS-1101 @TEST-904 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of ACCEPTANCE of quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' - And I create quality investigation - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1222" | - Then I check, if quality investigation has proper values - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1222" | - | "status" | "CREATED" | - When I approve quality investigation - Then I check, if quality investigation has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has been received - Then I check, if quality investigation has proper values - | "severity" | "MAJOR" | - | "description" | "Testing ACCEPTANCE TRACEFOSS-1222" | - | "status" | "RECEIVED" | - When I acknowledge quality investigation - Then I check, if quality investigation has proper values - | "status" | "ACKNOWLEDGED" | - When I accept quality investigation - | "reason" | "accepted in TRACEFOSS-1222" | - Then I check, if quality investigation has proper values - | "status" | "ACCEPTED" | - When I am logged into TRACE_X_A application - Then I check, if quality investigation has proper values - | "status" | "ACCEPTED" | - | "acceptReason" | "accepted in TRACEFOSS-1222" | diff --git a/tx-cucumber-tests/src/test/resources/features/5_TRACEFOSS-1625.feature b/tx-cucumber-tests/src/test/resources/features/5_TRACEFOSS-1625.feature index 9a2e83a256..7da7dd0b3f 100644 --- a/tx-cucumber-tests/src/test/resources/features/5_TRACEFOSS-1625.feature +++ b/tx-cucumber-tests/src/test/resources/features/5_TRACEFOSS-1625.feature @@ -18,30 +18,30 @@ Feature: [BE][FE]Handling of several parts in one quality alert #* correct sending of several parts in *one* alert #* correct reception of several parts in *one* alert on receiver side #* correct update of *one* alert with several parts - @TRACEFOSS-1670 @TRACEFOSS-1920 @TRACEFOSS-1101 @TRACEFOSS-1673 @TEST-904 @TEST-1217 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of several parts in quality alerts - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd,urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality alert - | "severity" | "MINOR" | - | "description" | "Testing severity TRACEFOSS-1670" | - Then I check, if quality alert has proper values - | "description" | "Testing severity TRACEFOSS-1670" | - | "status" | "CREATED" | - | "assetIdCount" | "2" | - When I approve quality alert - Then I check, if quality alert has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality alert has been received - Then I check, if quality alert has proper values - | "description" | "Testing severity TRACEFOSS-1670" | - | "status" | "RECEIVED" | - | "assetIdCount" | "2" | - When I acknowledge quality alert - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - When I am logged into TRACE_X_A application - Then I check, if quality alert has proper values - | "status" | "ACKNOWLEDGED" | - | "assetIdCount" | "2" | + @TRACEFOSS-1670 @TRACEFOSS-3128 @TRACEFOSS-2910 @TRACEFOSS-2715 @TEST-904 @TEST-1217 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @INTEGRATION_TEST @[QUALITY_ALERTS] + Scenario: [BE] Check correct processing of several parts in quality alerts + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:6b2296cc-26c0-4f38-8a22-092338c36e22,urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa02' + And I create quality alert + | "severity" | "MINOR" | + | "description" | "Testing severity TRACEFOSS-1670" | + Then I check, if quality alert has proper values + | "description" | "Testing severity TRACEFOSS-1670" | + | "status" | "CREATED" | + | "assetIdCount" | "2" | + When I approve quality alert + Then I check, if quality alert has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality alert has been received + Then I check, if quality alert has proper values + | "description" | "Testing severity TRACEFOSS-1670" | + | "status" | "RECEIVED" | + | "assetIdCount" | "2" | + When I acknowledge quality alert + Then I check, if quality alert has proper values + | "status" | "ACKNOWLEDGED" | + When I am logged into TRACE_X_A application + Then I check, if quality alert has proper values + | "status" | "ACKNOWLEDGED" | + | "assetIdCount" | "2" | \ No newline at end of file diff --git a/tx-cucumber-tests/src/test/resources/features/6_TRACEFOSS-382.feature b/tx-cucumber-tests/src/test/resources/features/6_TRACEFOSS-382.feature index 743f65d62c..3cc5ca9bc2 100644 --- a/tx-cucumber-tests/src/test/resources/features/6_TRACEFOSS-382.feature +++ b/tx-cucumber-tests/src/test/resources/features/6_TRACEFOSS-382.feature @@ -1,13 +1,13 @@ @TRACEFOSS-382 Feature: Create Request for quality investigation / store in queue - #h2. Remarks - #* (-) Test the solution - #* (-) Provide test data - #* (-) TRACEFOSS-392 - #* (-) TRACEFOSS-384 - #* (-) - # - #h2. User story + #h2. Remarks + #* (-) Test the solution + #* (-) Provide test data + #* (-) TRACEFOSS-392 + #* (-) TRACEFOSS-384 + #* (-) + # + #h2. User story #As a user # #I want to be able to create a quality investigation for selected parts with a description of the defect @@ -31,30 +31,30 @@ Feature: Create Request for quality investigation / store in queue #* correct sending of several parts in *one* investigation #* correct reception of several parts in *one* investigation on receiver side #* correct update of *one* investigation with several parts - @TRACEFOSS-1652 @TRACEFOSS-1101 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of several parts in quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd,urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' - And I create quality investigation - | "severity" | "MINOR" | - | "description" | "Testing severity TRACEFOSS-1652" | - Then I check, if quality investigation has proper values - | "description" | "Testing severity TRACEFOSS-1652" | - | "status" | "CREATED" | - | "assetIdCount" | "2" | - When I approve quality investigation - Then I check, if quality investigation has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has been received - Then I check, if quality investigation has proper values - | "description" | "Testing severity TRACEFOSS-1652" | - | "status" | "RECEIVED" | - | "assetIdCount" | "2" | - When I acknowledge quality investigation - Then I check, if quality investigation has proper values - | "status" | "ACKNOWLEDGED" | - When I am logged into TRACE_X_A application - Then I check, if quality investigation has proper values - | "status" | "ACKNOWLEDGED" | - | "assetIdCount" | "2" | + @TRACEFOSS-1652 @TRACEFOSS-3128 @TRACEFOSS-2910 @TRACEFOSS-2715 @TRACEFOSS-1101 @INTEGRATION_TEST @[QualityInvestigation] + Scenario: [BE] Check correct processing of several parts in quality investigation + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd,urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a' + And I create quality investigation + | "severity" | "MINOR" | + | "description" | "Testing severity TRACEFOSS-1652" | + Then I check, if quality investigation has proper values + | "description" | "Testing severity TRACEFOSS-1652" | + | "status" | "CREATED" | + | "assetIdCount" | "2" | + When I approve quality investigation + Then I check, if quality investigation has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality investigation has been received + Then I check, if quality investigation has proper values + | "description" | "Testing severity TRACEFOSS-1652" | + | "status" | "RECEIVED" | + | "assetIdCount" | "2" | + When I acknowledge quality investigation + Then I check, if quality investigation has proper values + | "status" | "ACKNOWLEDGED" | + When I am logged into TRACE_X_A application + Then I check, if quality investigation has proper values + | "status" | "ACKNOWLEDGED" | + | "assetIdCount" | "2" | \ No newline at end of file diff --git a/tx-cucumber-tests/src/test/resources/features/7_TRACEFOSS-1090.feature b/tx-cucumber-tests/src/test/resources/features/7_TRACEFOSS-1090.feature index 294bb57394..0b3da19ee6 100644 --- a/tx-cucumber-tests/src/test/resources/features/7_TRACEFOSS-1090.feature +++ b/tx-cucumber-tests/src/test/resources/features/7_TRACEFOSS-1090.feature @@ -10,35 +10,35 @@ Feature: 🪓⭐[BE] Add information to notification inbox # * Add an additional field for severity # # - #h3. Hint - #* BPN name and severity is published over the API that it could be requested by the frontend API . - #* Mapping between BPN number and company name is part of the job response of IRS. - # - #h3. Sprint Planning 2 + #h3. Hint + #* BPN name and severity is published over the API that it could be requested by the frontend API . + #* Mapping between BPN number and company name is part of the job response of IRS. + # + #h3. Sprint Planning 2 #* Add BPN and severity to the investigation response. #Check if *bpn names* of *sender and receiver* are processed correctly for created quality investigations which contains following checks: #* correct creation on sender side #* correct reception on receiver side - @TRACEFOSS-1344 @TRACEFOSS-1920 @TRACEFOSS-1101 @TRACEFOSS-1138 @TRACEFOSS-1673 @TEST-1217 @TRACEFOSS-1139 @TEST-904 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of bpn names in quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' - And I create quality investigation - | "description" | "Testing BPNs TRACEFOSS-1344" | - | "severity" | "MINOR" | - Then I check, if quality investigation has proper values - | "description" | "Testing BPNs TRACEFOSS-1344" | - | "createdBy" | "BPNL00000003CML1" | - | "sendTo" | "BPNL00000003CNKC" | - | "status" | "CREATED" | - When I approve quality investigation - Then I check, if quality investigation has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has been received - Then I check, if quality investigation has proper values - | "description" | "Testing BPNs TRACEFOSS-1344" | - | "createdBy" | "BPNL00000003CML1" | - | "sendTo" | "BPNL00000003CNKC" | - | "status" | "RECEIVED" | + @TRACEFOSS-1344 @TRACEFOSS-3128 @TRACEFOSS-2910 @TEST-1217 @TRACEFOSS-2715 @TEST-904 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @TRACEFOSS-1139 @TRACEFOSS-1138 @INTEGRATION_TEST @[QualityInvestigation] + Scenario: [BE] Check correct processing of bpn names in quality investigation + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' + And I create quality investigation + | "description" | "Testing BPNs TRACEFOSS-1344" | + | "severity" | "MINOR" | + Then I check, if quality investigation has proper values + | "description" | "Testing BPNs TRACEFOSS-1344" | + | "createdBy" | "BPNL00000003CML1" | + | "sendTo" | "BPNL00000003CNKC" | + | "status" | "CREATED" | + When I approve quality investigation + Then I check, if quality investigation has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality investigation has been received + Then I check, if quality investigation has proper values + | "description" | "Testing BPNs TRACEFOSS-1344" | + | "createdBy" | "BPNL00000003CML1" | + | "sendTo" | "BPNL00000003CNKC" | + | "status" | "RECEIVED" | \ No newline at end of file diff --git a/tx-cucumber-tests/src/test/resources/features/8_TRACEFOSS-608.feature b/tx-cucumber-tests/src/test/resources/features/8_TRACEFOSS-608.feature index e069e4c25a..796858da41 100644 --- a/tx-cucumber-tests/src/test/resources/features/8_TRACEFOSS-608.feature +++ b/tx-cucumber-tests/src/test/resources/features/8_TRACEFOSS-608.feature @@ -4,54 +4,54 @@ Feature: ⭐[TEST] [BE] Set and show notification target date #*I want to* be able to set a target date for my notification while creating it #*so that* I am able to monitor if a reply was given in time. # - #h2. Hints + #h2. Hints #[Concept | https://confluence.catena-x.net/pages/viewpage.action?pageId=69429778] #Check if *targetDate = null* is processed correctly for created quality investigations which contains following checks: #* correct sending of _targetDate_ = *null* #* correct reception on receiver side - @TRACEFOSS-1247 @TRACEFOSS-1920 @TEST-1217 @TRACEFOSS-1139 @TEST-904 @TRACEFOSS-1673 @TRACEFOSS-1138 @TRACEFOSS-1101 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of targetDate = null in quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' - And I create quality investigation - | "severity" | "MINOR" | - | "description" | "Testing without targetDate TRACEFOSS-1247" | - Then I check, if quality investigation has proper values - | "description" | "Testing without targetDate TRACEFOSS-1247" | - | "targetDate" | "" | - | "status" | "CREATED" | - When I approve quality investigation - Then I check, if quality investigation has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has been received - Then I check, if quality investigation has proper values - | "description" | "Testing without targetDate TRACEFOSS-1247" | - | "targetDate" | "" | - | "status" | "RECEIVED" | + @TRACEFOSS-1247 @TRACEFOSS-1920 @TRACEFOSS-1139 @TRACEFOSS-1673 @TRACEFOSS-2715 @TRACEFOSS-2910 @TRACEFOSS-1138 @TRACEFOSS-1101 @TEST-1217 @TRACEFOSS-3128 @TEST-904 @INTEGRATION_TEST @[QualityInvestigation] + Scenario: [BE] Check correct processing of targetDate = null in quality investigation + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' + And I create quality investigation + | "severity" | "MINOR" | + | "description" | "Testing without targetDate TRACEFOSS-1247" | + Then I check, if quality investigation has proper values + | "description" | "Testing without targetDate TRACEFOSS-1247" | + | "targetDate" | "" | + | "status" | "CREATED" | + When I approve quality investigation + Then I check, if quality investigation has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality investigation has been received + Then I check, if quality investigation has proper values + | "description" | "Testing without targetDate TRACEFOSS-1247" | + | "targetDate" | "" | + | "status" | "RECEIVED" | #Check if *targetDate* is processed correctly for created quality investigations which contains following checks: #* correct sending of _targetDate_ #* correct reception on receiver side - @TRACEFOSS-1216 @TRACEFOSS-1920 @TEST-1217 @TRACEFOSS-1139 @TRACEFOSS-1673 @TRACEFOSS-1138 @TRACEFOSS-1101 @TEST-904 @INTEGRATION_TEST - Scenario: [BE] Check correct processing of targetDate in quality investigation - When I am logged into TRACE_X_A application - When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' - And I create quality investigation - | "severity" | "MINOR" | - | "description" | "Testing targetDate TRACEFOSS-1216" | - | "targetDate" | "2099-03-11T22:44:06.333827Z" | - Then I check, if quality investigation has proper values - | "description" | "Testing targetDate TRACEFOSS-1216" | - | "targetDate" | "2099-03-11T22:44:06.333827Z" | - | "status" | "CREATED" | - When I approve quality investigation - Then I check, if quality investigation has proper values - | "status" | "SENT" | - When I am logged into TRACE_X_B application - Then I check, if quality investigation has been received - Then I check, if quality investigation has proper values - | "description" | "Testing targetDate TRACEFOSS-1216" | - | "targetDate" | "2099-03-11T22:44:06.333827Z" | - | "status" | "RECEIVED" | + @TRACEFOSS-1216 @TRACEFOSS-1920 @TRACEFOSS-1139 @TRACEFOSS-1673 @TRACEFOSS-1138 @TRACEFOSS-1101 @TRACEFOSS-2715 @TRACEFOSS-2910 @TEST-1217 @TEST-904 @TRACEFOSS-3128 @INTEGRATION_TEST @[QualityInvestigation] + Scenario: [BE] Check correct processing of targetDate in quality investigation + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' + And I create quality investigation + | "severity" | "MINOR" | + | "description" | "Testing targetDate TRACEFOSS-1216" | + | "targetDate" | "2099-03-11T22:44:06.333827Z" | + Then I check, if quality investigation has proper values + | "description" | "Testing targetDate TRACEFOSS-1216" | + | "targetDate" | "2099-03-11T22:44:06.333827Z" | + | "status" | "CREATED" | + When I approve quality investigation + Then I check, if quality investigation has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality investigation has been received + Then I check, if quality investigation has proper values + | "description" | "Testing targetDate TRACEFOSS-1216" | + | "targetDate" | "2099-03-11T22:44:06.333827Z" | + | "status" | "RECEIVED" | \ No newline at end of file diff --git a/tx-cucumber-tests/src/test/resources/features/9_TRACEFOSS-607.feature b/tx-cucumber-tests/src/test/resources/features/9_TRACEFOSS-607.feature new file mode 100644 index 0000000000..9b372e752a --- /dev/null +++ b/tx-cucumber-tests/src/test/resources/features/9_TRACEFOSS-607.feature @@ -0,0 +1,65 @@ +@TRACEFOSS-607 +Feature: ⭐ [BE] Provisioning of Receiver update Quality Investigation over Backend API + #As a Supervisor + #I want to be able to update a quality investigation that I received + #So that the corresponding partner knows in which status the notification is on my side. + # + #*Additional information* + # * Update from RECEIVED to ACKNOWLEDGED without further input + # * Update from ACKNOWLEDGED to ACCEPTED with text information + # * Update from ACKNOWLEDGED to DECLINED with text information + # * No Update to CLOSED possible on Receiver side (Once the Notification is closed it is read-only and could not be changed/modified any more ) + # + #*Workflow Diagram* + # + #!NotificationStatusWorkflow.png|thumbnail! + #h2. Backend Topics + # + #  + #h2. Sprint Planning 2:  + # * Backend: 5 SP + # * Frontend: 5 SP + # + #h3. Backend + # * Endpoint "Create Notification" [~jedrzej.serwa@partner.doubleslash.de]  Please update this  + # * Endpoint "Status Update" + # * Endpoint "" + # * Real-time notification + # + #  + + #Check if *DECLINATION* of quality investigations is processed correctly which contains following checks: + #* correct DECLINATION status on receiver side + #* correct reception of status update on sender side + #* correct reason on receiver and sender side + @TRACEFOSS-1223 @TRACEFOSS-3128 @TRACEFOSS-2910 @TEST-1217 @TRACEFOSS-2715 @TEST-904 @TRACEFOSS-1920 @TRACEFOSS-1673 @TRACEFOSS-1101 @TRACEFOSS-1139 @TRACEFOSS-1138 @INTEGRATION_TEST @[QualityInvestigation] + Scenario: [BE] Check correct processing of DECLINATION of quality investigation + When I am logged into TRACE_X_A application + When I use assets with ids 'urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd' + And I create quality investigation + | "severity" | "MAJOR" | + | "description" | "Testing DECLINATION TRACEFOSS-1223" | + Then I check, if quality investigation has proper values + | "severity" | "MAJOR" | + | "description" | "Testing DECLINATION TRACEFOSS-1223" | + | "status" | "CREATED" | + When I approve quality investigation + Then I check, if quality investigation has proper values + | "status" | "SENT" | + When I am logged into TRACE_X_B application + Then I check, if quality investigation has been received + Then I check, if quality investigation has proper values + | "severity" | "MAJOR" | + | "description" | "Testing DECLINATION TRACEFOSS-1223" | + | "status" | "RECEIVED" | + When I acknowledge quality investigation + Then I check, if quality investigation has proper values + | "status" | "ACKNOWLEDGED" | + When I decline quality investigation + | "reason" | "declined in TRACEFOSS-1223" | + Then I check, if quality investigation has proper values + | "status" | "DECLINED" | + When I am logged into TRACE_X_A application + Then I check, if quality investigation has proper values + | "status" | "DECLINED" | + | "declineReason" | "declined in TRACEFOSS-1223" | \ No newline at end of file diff --git a/tx-models/src/main/java/qualitynotification/base/request/CloseQualityNotificationRequest.java b/tx-models/src/main/java/qualitynotification/base/request/CloseQualityNotificationRequest.java index 5c72c68d99..2d24398bc0 100644 --- a/tx-models/src/main/java/qualitynotification/base/request/CloseQualityNotificationRequest.java +++ b/tx-models/src/main/java/qualitynotification/base/request/CloseQualityNotificationRequest.java @@ -24,13 +24,22 @@ import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Size; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @Setter @Getter @ToString +@Builder +@Data +@RequiredArgsConstructor +@AllArgsConstructor public class CloseQualityNotificationRequest { @Schema(example = "The reason.", minLength = 15, maxLength = 1000) @Size(min = 15, max = 1000, message = "Close reason should have at least 15 characters and at most 1000 characters") diff --git a/tx-models/src/main/java/qualitynotification/base/request/QualityNotificationSeverityRequest.java b/tx-models/src/main/java/qualitynotification/base/request/QualityNotificationSeverityRequest.java index a327247f0c..3668d6ee7f 100644 --- a/tx-models/src/main/java/qualitynotification/base/request/QualityNotificationSeverityRequest.java +++ b/tx-models/src/main/java/qualitynotification/base/request/QualityNotificationSeverityRequest.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import java.util.NoSuchElementException; @@ -55,9 +56,9 @@ private static String supportedQualityNotificationSeverityRequest() { .collect(Collectors.joining(", ")); } - + @JsonValue public String getRealName() { - return this.realName; + return realName; } } diff --git a/tx-models/src/main/java/qualitynotification/base/request/UpdateQualityNotificationRequest.java b/tx-models/src/main/java/qualitynotification/base/request/UpdateQualityNotificationRequest.java index e10333c36a..e990a05ba4 100644 --- a/tx-models/src/main/java/qualitynotification/base/request/UpdateQualityNotificationRequest.java +++ b/tx-models/src/main/java/qualitynotification/base/request/UpdateQualityNotificationRequest.java @@ -24,9 +24,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.RequiredArgsConstructor; @Data +@Builder +@AllArgsConstructor +@RequiredArgsConstructor public class UpdateQualityNotificationRequest { @NotNull(message = "status must be present") private UpdateQualityNotificationStatusRequest status; diff --git a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationMessageResponse.java b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationMessageResponse.java index 1c92eb0ad6..02b360c9e2 100644 --- a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationMessageResponse.java +++ b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationMessageResponse.java @@ -22,13 +22,17 @@ import jakarta.persistence.EnumType; import jakarta.persistence.Enumerated; import jakarta.validation.constraints.Size; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; +import lombok.RequiredArgsConstructor; import java.time.Instant; import java.time.LocalDateTime; @Data @Builder +@AllArgsConstructor +@RequiredArgsConstructor public class QualityNotificationMessageResponse { private String id; diff --git a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java index f7d567ea75..64ca222d17 100644 --- a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java +++ b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java @@ -20,13 +20,19 @@ import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Size; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.RequiredArgsConstructor; import lombok.experimental.SuperBuilder; +import java.util.Comparator; import java.util.List; +import java.util.Optional; @Data @SuperBuilder +@AllArgsConstructor +@RequiredArgsConstructor public class QualityNotificationResponse { @Schema(example = "66", maxLength = 255) @@ -82,4 +88,9 @@ public class QualityNotificationResponse { private List messages; + + public Optional latestNotification() { + return messages.stream().max(Comparator.comparing(QualityNotificationMessageResponse::getCreated)).stream().findFirst(); + } + } diff --git a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationSeverityResponse.java b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationSeverityResponse.java index 90da051ad0..0e8f8057d9 100644 --- a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationSeverityResponse.java +++ b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationSeverityResponse.java @@ -18,6 +18,7 @@ ********************************************************************************/ package qualitynotification.base.response; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; @@ -33,9 +34,11 @@ public enum QualityNotificationSeverityResponse { this.realName = realName; } + + @JsonCreator public static QualityNotificationSeverityResponse fromString(String str) { for (QualityNotificationSeverityResponse s : QualityNotificationSeverityResponse.values()) { - if (s.realName.equalsIgnoreCase(str)) { + if (s.getRealName().equalsIgnoreCase(str)) { return s; } }