diff --git a/clients/fossid-webapp/src/main/kotlin/model/identification/markedAsIdentified/Comment.kt b/clients/fossid-webapp/src/main/kotlin/model/identification/markedAsIdentified/Comment.kt new file mode 100644 index 0000000000000..7b9034d4b71fa --- /dev/null +++ b/clients/fossid-webapp/src/main/kotlin/model/identification/markedAsIdentified/Comment.kt @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2023 The ORT Project Authors (see ) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License 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 + * License-Filename: LICENSE + */ + +package org.ossreviewtoolkit.clients.fossid.model.identification.markedAsIdentified + +data class Comment(val id: Int, val identificationId: Int, val comment: String) diff --git a/clients/fossid-webapp/src/main/kotlin/model/identification/markedAsIdentified/MarkedAsIdentifiedFile.kt b/clients/fossid-webapp/src/main/kotlin/model/identification/markedAsIdentified/MarkedAsIdentifiedFile.kt index 6f3bd80d3f5f2..6fcca6ee4f2f8 100644 --- a/clients/fossid-webapp/src/main/kotlin/model/identification/markedAsIdentified/MarkedAsIdentifiedFile.kt +++ b/clients/fossid-webapp/src/main/kotlin/model/identification/markedAsIdentified/MarkedAsIdentifiedFile.kt @@ -28,6 +28,7 @@ import org.ossreviewtoolkit.clients.fossid.model.summary.SummaryIdentifiedFile data class MarkedAsIdentifiedFile( val comment: String?, + val comments: Map = emptyMap(), val identificationId: Int, diff --git a/clients/fossid-webapp/src/test/assets/return-type/mappings/apiphp-list_marked_as_identified_files_not_empty.json b/clients/fossid-webapp/src/test/assets/return-type/mappings/apiphp-list_marked_as_identified_files_not_empty.json index 70826e5e32188..d5611ae5ce56a 100644 --- a/clients/fossid-webapp/src/test/assets/return-type/mappings/apiphp-list_marked_as_identified_files_not_empty.json +++ b/clients/fossid-webapp/src/test/assets/return-type/mappings/apiphp-list_marked_as_identified_files_not_empty.json @@ -12,7 +12,7 @@ }, "response" : { "status" : 200, - "body" : "{\"operation\":\"get_marked_as_identified_files\",\"status\":\"1\",\"data\":{\"2\": {\n \"row_id\": \"2\",\n \"file_path\": \"src\\/FileWithoutLicense.java\",\n \"file_id\": \"754803\",\n \"is_distributed\": \"1\",\n \"file_md5\": \"f6ed9e5e51888ca574a987536c9f422b\",\n \"file_sha1\": \"fcf5a18336476cdd9248a4a4fb19f5bd623fbc22\",\n \"file_sha256\": \"cb75d8a36aed92b6ebbb57e7c7ff0bb8777254594ac036ee707df164d27bef9d\",\n \"file_size\": \"1587\",\n \"identification_id\": \"1309401\",\n \"identification_copyright\": \"\",\n \"component_id\": null,\n \"component_name\": null,\n \"component_version\": null,\n \"component_copyright\": null,\n \"component_cpe\": null,\n \"component_license_name\": null,\n \"component_license_identifier\": null,\n \"component_license_is_foss\": null,\n \"component_license_is_spdx_standard\": null,\n \"component_include_in_report\": null,\n \"component_is_copyleft\": null,\n \"comment\": null\n }}}}", + "body" : "{ \"operation\": \"get_marked_as_identified_files\", \"status\": \"1\", \"data\": { \"2\": { \"row_id\": \"2\", \"file_path\": \"src\\/FileWithoutLicense.java\", \"file_id\": \"754803\", \"is_distributed\": \"1\", \"file_md5\": \"f6ed9e5e51888ca574a987536c9f422b\", \"file_sha1\": \"fcf5a18336476cdd9248a4a4fb19f5bd623fbc22\", \"file_sha256\": \"cb75d8a36aed92b6ebbb57e7c7ff0bb8777254594ac036ee707df164d27bef9d\", \"file_size\": \"1587\", \"identification_id\": \"1309401\", \"identification_copyright\": \"\", \"component_id\": null, \"component_name\": null, \"component_version\": null, \"component_copyright\": null, \"component_cpe\": null, \"component_license_name\": null, \"component_license_identifier\": null, \"component_license_is_foss\": null, \"component_license_is_spdx_standard\": null, \"component_include_in_report\": null, \"component_is_copyleft\": null, \"comment\": null,\n \"comments\": { \"243909\": { \"id\": 243909, \"identification_id\": 10397697, \"comment\": \"Test Nino\" }, \"243910\": { \"id\": 243910, \"identification_id\": 10397697, \"comment\": \"TestORT\" } } } }}", "headers" : { "Content-Type" : "text/html; charset=UTF-8", "Date" : "Thu, 03 Dec 2020 08:04:04 GMT", diff --git a/plugins/scanners/fossid/src/test/kotlin/FossIdLicenseMappingTest.kt b/plugins/scanners/fossid/src/test/kotlin/FossIdLicenseMappingTest.kt index 70dffcfe885c1..0f1c69ef2519c 100644 --- a/plugins/scanners/fossid/src/test/kotlin/FossIdLicenseMappingTest.kt +++ b/plugins/scanners/fossid/src/test/kotlin/FossIdLicenseMappingTest.kt @@ -133,6 +133,7 @@ private fun createMarkAsIdentifiedFile(license: String): MarkedAsIdentifiedFile return MarkedAsIdentifiedFile( "comment", + emptyMap(), 1, "copyright", 1,