diff --git a/.github/workflows/nightly-e2e-tests.yml b/.github/workflows/nightly-e2e-tests.yml index 6f8410ae36..0eb17a5d4d 100644 --- a/.github/workflows/nightly-e2e-tests.yml +++ b/.github/workflows/nightly-e2e-tests.yml @@ -10,10 +10,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Chrome Tests (Public User) @@ -27,10 +27,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Firefox Tests (Public User) @@ -44,10 +44,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Internet Explorer Tests (Public User) @@ -61,10 +61,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Edge Tests (Public User) @@ -78,10 +78,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Safari Tests (Public User) @@ -101,10 +101,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Chrome Tests (Dataprovider) @@ -124,10 +124,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Firefox Tests (Dataprovider) @@ -147,10 +147,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Internet Explorer Tests (Dataprovider) @@ -170,10 +170,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Edge Tests (Dataprovider) @@ -193,10 +193,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Safari Tests (Dataprovider) @@ -216,10 +216,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Chrome Tests (Publisher) @@ -239,10 +239,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Firefox Tests (Publisher) @@ -262,10 +262,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Internet Explorer Tests (Publisher) @@ -285,10 +285,10 @@ jobs: - uses: actions/checkout@v1 with: ref: development - - name: Setup Python 3.8.x + - name: Setup Python 3.8.0 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.8.0' - name: Install robotframework dependencies run: ./src/test/robotframework/setup.sh - name: Nightly Edge Tests (Publisher) @@ -307,10 +307,10 @@ jobs: # - uses: actions/checkout@v1 # with: # ref: development - # - name: Setup Python 3.8.x + # - name: Setup Python 3.8.0 # uses: actions/setup-python@v2 # with: - # python-version: '3.8.x' + # python-version: '3.8.0' # - name: Install robotframework dependencies # run: ./src/test/robotframework/setup.sh # - name: Nightly Safari Tests (Publisher) diff --git a/Gruntfile.js b/Gruntfile.js index 5ed35610d5..54599a3865 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -660,6 +660,8 @@ module.exports = function(grunt) { sources: { src: [ 'src/main/webapp/scripts/datapackagemanagement/**/translations*.js', + 'src/main/webapp/scripts/analysispackagemanagement/**' + + '/translations*.js', 'src/main/webapp/scripts/conceptmanagement/**/translations*.js', 'src/main/webapp/scripts/surveymanagement/**/translations*.js', 'src/main/webapp/scripts/instrumentmanagement/**/translations*.js', @@ -728,6 +730,9 @@ module.exports = function(grunt) { if (filename.includes('datapackagemanagement')) { return 'DataPackage'; } + if (filename.includes('analysispackagemanagement')) { + return 'AnalysisPackage'; + } if (filename.includes('surveymanagement')) { return 'Survey'; } diff --git a/README.md b/README.md index 7d02e03924..8721f8c743 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,9 @@ Please checkout the development branch before starting to code and create a new Before you can build this project, you must install and configure the following dependencies on your machine: -1. Java: You need to install java 15 sdk on your system. On Ubuntu you should use [SDKMAN!][] -2. Maven: You need to install maven 3.6.1 or above on your system. On Ubuntu you should use [SDKMAN!][] -3. [Node.js][]: Node.js 14 and npm (coming with node.js) are required as well. On Ubuntu you should install node using [NVM][] +1. Java: You need to install java 15 sdk on your system. On Ubuntu you should use [SDKMAN!][] (`sdk install java 15.0.2.hs-adpt`) +2. Maven: You need to install maven 3.6.1 or above on your system. On Ubuntu you should use [SDKMAN!][] (`sdk install maven`) +3. [Node.js][]: Node.js 14 and npm (coming with node.js) are required as well. On Ubuntu you should install node using [NVM][] (`nvm install v14`) We use [Grunt][] as our client build system. Install the grunt command-line tool globally with: @@ -44,9 +44,26 @@ Make sure that you have read-write-access on the ***data*** directory (in your p to start all services the metadatamanagement depends on. Mongodb and Elasticsearch will be listening on its default ports. +You will need to setup your `~/.m2/settings.xml` so that maven can download a dependency from Github: + +```xml + + + + github + ${GITHUB_USERNAME} + ${GITHUB_TOKEN} + + + +``` + In order to have all java dependencies for the server and all nodejs dependencies for the client and in order to build everything, simply run (and lean back for a while): - mvn clean install + mvn -Pdev clean verify Run the following commands in two separate terminals to create a blissful development experience where your browser auto-refreshes when files change on your hard drive. diff --git a/docker-compose-app.yml b/docker-compose-app.yml index 6cc9b1ef86..fa56d9b26f 100644 --- a/docker-compose-app.yml +++ b/docker-compose-app.yml @@ -23,3 +23,4 @@ services: - mongodb - elasticsearch - maildev + - identity-provider diff --git a/docker-compose.yml b/docker-compose.yml index 2186f8b92d..2a4f6b281b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,3 +32,8 @@ services: ports: - "8081:80" - "1025:25" + identity_provider: + image: sanduhrs/identity-provider + container_name: identity-provider + ports: + - "8082:80" diff --git a/docs/source/04_Eingabemaske.rst b/docs/source/04_Eingabemaske.rst index a5aac7cd0d..3e40688f8f 100644 --- a/docs/source/04_Eingabemaske.rst +++ b/docs/source/04_Eingabemaske.rst @@ -96,7 +96,7 @@ Die Eingabemaske auf Datenpaketebene besteht aus den folgenden Abschnitten: - Tags (Schlagwörter) zum Datenpaket - Materialien zu diesem Datenpaket -Im Folgenden wird auf die einzelnen Abschnitte genauer eingegangen. Allgemeine Informationen zu den Eingabemasken finden Sie :ref:`hier `. +Allgemeine Informationen zu den Eingabemasken finden Sie :ref:`hier `. .. _Surveys: @@ -112,9 +112,9 @@ Die Eingabemaske auf Erhebungsebene besteht aus den folgenden Abschnitten: - Weitere Informationen zum Rücklauf - Materialien zu der Erhebung -Im Folgenden wird auf die einzelnen Abschnitte genauer eingegangen. Allgemeine Informationen zu den Eingabemasken finden Sie :ref:`hier `. +Allgemeine Informationen zu den Eingabemasken finden Sie :ref:`hier `. -Bitte beachten Sie, dass Sie die Ordnungsnummer sich auf die Reihenfolge der Erhebungs im Erhebungsdesign bezieht. So ist die Ordnungsnummer einer dritten Panelwelle 3, auch wenn sie (aus welchen Gründen auch immer) die einzige Erhebung in einem Datenpaket darstellt. Die Sortierung mehrerer Erhebungen in einem Datenpaket orientiert sich an den Ordnungsnummern. +Bitte beachten Sie, dass Sie die Ordnungsnummer sich auf die Reihenfolge der Erhebungen im Erhebungsdesign bezieht. So ist die Ordnungsnummer einer dritten Panelwelle die 3, auch wenn sie (aus welchen Gründen auch immer) die einzige Erhebung in einem Datenpaket darstellt. Die Sortierung mehrerer Erhebungen in einem Datenpaket orientiert sich an den Ordnungsnummern. .. _Instruments: diff --git a/docs/source/id_vergabe.rst b/docs/source/id_vergabe.rst index f3fe741ad6..f4018914f0 100644 --- a/docs/source/id_vergabe.rst +++ b/docs/source/id_vergabe.rst @@ -24,6 +24,8 @@ Logik +-----------------------------------+----------------------------------------+ | Data Package | "stu-" + DAP-id + "$" | +-----------------------------------+----------------------------------------+ +| Analysis Package | "ana-" + DAP-id + "$" | ++-----------------------------------+----------------------------------------+ | Survey | "sur-" + DAP-id + "-" + "sy" + | | | survey.number + "$" | +-----------------------------------+----------------------------------------+ @@ -41,7 +43,9 @@ Logik | | instrumentNumber + "-" + number + | | | "$" | +-----------------------------------+----------------------------------------+ -| relatedPublication | "pub-" + citaviId + "$" | +| Publication | "pub-" + citaviId + "$" | ++-----------------------------------+----------------------------------------+ +| Concept | "con-" + alphanum + "$" | +-----------------------------------+----------------------------------------+ .. _Projekte: https://github.com/dzhw/metadatamanagement-io/wiki/unterlagen/study_ids.xlsx diff --git a/package-lock.json b/package-lock.json index 61bc015dcd..edcedbf2a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Metadatamanagement", - "version": "1.0.114", + "version": "1.0.115", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -326,9 +326,9 @@ } }, "@citation-js/plugin-doi": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@citation-js/plugin-doi/-/plugin-doi-0.5.1.tgz", - "integrity": "sha512-oCqzl5eY69h6m7xESvzx7g5xS7bqfnbL/p88kQdN2vQxYYmovWfw3sSk0hqQv+MekKPCAXOBvbXPlM4YiNqM9g==" + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@citation-js/plugin-doi/-/plugin-doi-0.5.2.tgz", + "integrity": "sha512-AX9G++Dwfidwi7STU4F2ICx6Ym5K3uVKbxO+njKJ43XHxtcKok8pblaRdncQWYE4tyqEpBIBO4mfq51zI3RJOg==" }, "@citation-js/plugin-ris": { "version": "0.5.1", @@ -1744,6 +1744,11 @@ "commander": "^5.1.0" } }, + "@citation-js/plugin-doi": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@citation-js/plugin-doi/-/plugin-doi-0.5.1.tgz", + "integrity": "sha512-oCqzl5eY69h6m7xESvzx7g5xS7bqfnbL/p88kQdN2vQxYYmovWfw3sSk0hqQv+MekKPCAXOBvbXPlM4YiNqM9g==" + }, "commander": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", @@ -1762,9 +1767,9 @@ "integrity": "sha1-ZqDmQBGBbjcZaCj9yMjBRzEshjQ=" }, "clean-css": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.1.5.tgz", - "integrity": "sha512-9dr/cU/LjMpU57PXlSvDkVRh0rPxJBXiBtD0+SgYt8ahTCsXtfKjCkNYgIoTC6mBg8CFr5EKhW3DKCaGMUbUfQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.1.tgz", + "integrity": "sha512-ooQCa1/70oRfVdUUGjKpbHuxgMgm8BsDT5EBqBGvPxMoRoGXf4PNx5mMnkjzJ9Ptx4vvmDdha0QVh86QtYIk1g==", "dev": true, "requires": { "source-map": "~0.6.0" @@ -1795,9 +1800,9 @@ }, "dependencies": { "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -4968,34 +4973,49 @@ } }, "grunt-contrib-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/grunt-contrib-concat/-/grunt-contrib-concat-1.0.1.tgz", - "integrity": "sha1-YVCYYwhOhx1+ht5IwBUlntl3Rb0=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-concat/-/grunt-contrib-concat-2.0.0.tgz", + "integrity": "sha512-/cfWwsGiprVTOl7c2bZwMdQ8hIf3e1f4szm1i7qhY9hOnR/X2KL+Xe7dynNweTYHa6aWPZx2B5GPsUpxAXNCaA==", "dev": true, "requires": { - "chalk": "^1.0.0", + "chalk": "^4.1.2", "source-map": "^0.5.3" }, "dependencies": { "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } }, "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -5003,10 +5023,13 @@ "dev": true }, "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } } } }, @@ -5123,14 +5146,14 @@ } }, "grunt-contrib-jshint": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-jshint/-/grunt-contrib-jshint-3.0.0.tgz", - "integrity": "sha512-o0V3HNK54+w2Lss/AP0LsAUCEmPDQIcgsDFvTy0sE8sdPXq/8vHdNdMEitK9Wcfoq7H6v02v6soiiwJ0wavT7A==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-jshint/-/grunt-contrib-jshint-3.1.1.tgz", + "integrity": "sha512-EwMY6L91FqTcMlZTVoDeeq/EZL+7MoFyo1rxIea9sxyv73geVggeE37jcUhNbu5hLbxHE82CGIUqitHuR2/q+g==", "dev": true, "requires": { "chalk": "^4.1.0", "hooker": "^0.2.3", - "jshint": "~2.12.0" + "jshint": "~2.13.0" }, "dependencies": { "ansi-styles": { @@ -5143,9 +5166,9 @@ } }, "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -5967,9 +5990,9 @@ "integrity": "sha512-zBUkP33s3pQh1Yc0FJkS0m3BtFSmTGh1kQt2kmpa9QMpMFMuQdBEWheAMp840GBrNsVjgeY1u9pbSBvsIizbWw==" }, "i": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", - "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/i/-/i-0.3.7.tgz", + "integrity": "sha512-FYz4wlXgkQwIPqhzC5TdNMLSE5+GS1IIDJZY/1ZiEPCT2S3COUVZeT5OW4BmW4r5LHLQuOosSwsvnroG9GR59Q==", "dev": true }, "iconv-lite": { @@ -6716,16 +6739,16 @@ } }, "jshint": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.12.0.tgz", - "integrity": "sha512-TwuuaUDmra0JMkuqvqy+WGo2xGHSNjv1BA1nTIgtH2K5z1jHuAEeAgp7laaR+hLRmajRjcrM71+vByBDanCyYA==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.13.1.tgz", + "integrity": "sha512-vymzfR3OysF5P774x6zYv0bD4EpH6NWRxpq54wO9mA9RuY49yb1teKSICkLx2Ryx+mfzlVVNNbTBtsRtg78t7g==", "dev": true, "requires": { "cli": "~1.0.0", "console-browserify": "1.1.x", "exit": "0.1.x", "htmlparser2": "3.8.x", - "lodash": "~4.17.19", + "lodash": "~4.17.21", "minimatch": "~3.0.2", "shelljs": "0.3.x", "strip-json-comments": "1.0.x" @@ -10752,9 +10775,9 @@ "dev": true }, "snyk": { - "version": "1.704.0", - "resolved": "https://registry.npmjs.org/snyk/-/snyk-1.704.0.tgz", - "integrity": "sha512-vYt8Zp2O5Rce//JAqkivWKTSEGvSIvFMEPy6UM2tCUfRoQdk+398YP0l1yLsGfu8in4Q9A7H+Vy3om4fcFliYQ==", + "version": "1.733.0", + "resolved": "https://registry.npmjs.org/snyk/-/snyk-1.733.0.tgz", + "integrity": "sha512-Mi/wk9tw8ma4P2+2QwgzGDHcIG0Tfj0Wn7cliuUqd7CM8bg+Oryq3g4NcNK6mJZz0VaISF8MCIcIzbqV8v0JYg==", "dev": true }, "socket.io": { diff --git a/package.json b/package.json index f4a1f68e4a..7ad2aaeb0a 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "Metadatamanagement", - "version": "1.0.114", + "version": "1.0.115", "description": "Data Search for Higher Education Research and Science Studies", "private": true, "dependencies": { - "@citation-js/plugin-doi": "0.5.1", + "@citation-js/plugin-doi": "0.5.2", "angular": "1.8.2", "angular-animate": "1.8.2", "angular-aria": "1.8.2", @@ -61,7 +61,7 @@ "devDependencies": { "angular-mocks": "1.8.2", "browser-sync": "2.27.5", - "clean-css": ">=5.1.5", + "clean-css": ">=5.2.1", "diff": ">=5.0.0", "event-stream": "4.0.1", "grunt": "1.4.1", @@ -70,11 +70,11 @@ "grunt-browser-sync": "2.2.0", "grunt-build-control": "0.7.1", "grunt-contrib-clean": "2.0.0", - "grunt-contrib-concat": "1.0.1", + "grunt-contrib-concat": "2.0.0", "grunt-contrib-copy": "1.0.0", "grunt-contrib-cssmin": "4.0.0", "grunt-contrib-htmlmin": "3.1.0", - "grunt-contrib-jshint": "3.0.0", + "grunt-contrib-jshint": "3.1.1", "grunt-contrib-uglify-es": "git://github.com/gruntjs/grunt-contrib-uglify.git#harmony", "grunt-contrib-watch": "1.1.0", "grunt-html-angular-validate": "0.6.1", @@ -103,7 +103,7 @@ "node-sass": "^6.0.1", "phantomjs-prebuilt": "2.1.16", "requirejs": "2.3", - "snyk": "^1.704.0", + "snyk": "^1.733.0", "sync-pom-version-to-package": "^1.6.1", "tar": "6.1.11", "time-grunt": "2.0.0", diff --git a/pom.xml b/pom.xml index c19f629f5e..529f250939 100644 --- a/pom.xml +++ b/pom.xml @@ -5,13 +5,13 @@ org.springframework.boot spring-boot-starter-parent - 2.5.4 + 2.5.5 eu.dzhw.fdz metadatamanagement - 1.0.114 + 1.0.115 war metadatamanagement @@ -163,6 +163,11 @@ tika-core 2.1.0 + + org.danilopianini + gson-extras + 0.2.2 + org.elasticsearch.client elasticsearch-rest-high-level-client @@ -175,7 +180,7 @@ org.jsoup jsoup - 1.14.2 + 1.14.3 org.projectlombok @@ -185,7 +190,7 @@ org.springdoc springdoc-openapi-ui - 1.5.10 + 1.5.11 org.springframework.boot @@ -292,7 +297,7 @@ org.springframework.security.oauth.boot spring-security-oauth2-autoconfigure - 2.5.2 + 2.5.5 org.zalando diff --git a/reports/cpd-report.txt b/reports/cpd-report.txt deleted file mode 100644 index 69a5b466b9..0000000000 --- a/reports/cpd-report.txt +++ /dev/null @@ -1,20158 +0,0 @@ -Found a 41 line (273 tokens) duplication in the following files: -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 298 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - public void testSimpleProjectForPostValidationWithWrongInformationForQuestion() throws IOException, Exception { - - //Arrange - //Project - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - project.getConfiguration().setDataPackagesState(new ProjectState(true, true)); - this.rdcProjectRepository.save(project); - - //DataPackage (each project must have one) - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - this.dataPackageRepository.save(dataPackage); - - //Survey - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - this.surveyRepository.save(survey); - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - List listOfSurveyIds = new ArrayList<>(); - listOfSurveyIds.add(survey.getId()); - - //Variables - Variable variable1 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name1", 1, surveyNumbers); - this.variableRepository.save(variable1); - Variable variable2 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name2", 2, surveyNumbers); - this.variableRepository.save(variable2); - Variable variable3 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name3", 3, surveyNumbers); - this.variableRepository.save(variable3); - - //DataSet - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - this.dataSetRepository.save(dataSet); - - //Instrument - Instrument instrument = UnitTestCreateDomainObjectUtils.buildInstrument(project.getId()); - this.instrumentRepository.save(instrument); - - //Question - Question question = UnitTestCreateDomainObjectUtils.buildQuestion(project.getId(), 123, "testProject-WrongQuestionname1" -===================================================================== -Found a 16 line (256 tokens) duplication in the following files: -Starting at line 44 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 37 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java - - public final StringPath id = createString("id"); - - public final ListPath institutions = this.createList("institutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final ListPath projectContributors = this.createList("projectContributors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); - - //inherited - public final BooleanPath shadow = _super.shadow; -===================================================================== -Found a 33 line (229 tokens) duplication in the following files: -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 236 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 298 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - public void testSimpleProjectForPostValidationWithWrongInformationForQuestion() throws IOException, Exception { - - //Arrange - //Project - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - project.getConfiguration().setDataPackagesState(new ProjectState(true, true)); - this.rdcProjectRepository.save(project); - - //DataPackage (each project must have one) - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - this.dataPackageRepository.save(dataPackage); - - //Survey - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - this.surveyRepository.save(survey); - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - List listOfSurveyIds = new ArrayList<>(); - listOfSurveyIds.add(survey.getId()); - - //Variables - Variable variable1 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name1", 1, surveyNumbers); - this.variableRepository.save(variable1); - Variable variable2 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name2", 2, surveyNumbers); - this.variableRepository.save(variable2); - Variable variable3 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name3", 3, surveyNumbers); - this.variableRepository.save(variable3); - - //DataSet - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); -===================================================================== -Found a 11 line (208 tokens) duplication in the following files: -Starting at line 145 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public QInstrumentSearchDocument(Class type, PathMetadata metadata, PathInits inits) { - super(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.configuration = inits.isInitialized("configuration") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration(forProperty("configuration")) : null; - this.dataPackage = inits.isInitialized("dataPackage") ? new QDataPackageSubDocument(forProperty("dataPackage"), inits.get("dataPackage")) : null; - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; - this.nestedDataPackage = inits.isInitialized("nestedDataPackage") ? new QDataPackageNestedDocument(forProperty("nestedDataPackage"), inits.get("nestedDataPackage")) : null; - this.release = inits.isInitialized("release") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QRelease(forProperty("release")) : null; - } - -} -===================================================================== -Found a 34 line (206 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 29 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.instrumentmanagement.domain.QInstrument _super = new eu.dzhw.fdz.metadatamanagement.instrumentmanagement.domain.QInstrument(this); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.annotations); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - //inherited - public final ListPath conceptIds = _super.conceptIds; - - public final ListPath concepts = this.createList("concepts", ConceptSubDocument.class, QConceptSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration configuration; - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - //inherited - public final StringPath dataAcquisitionProjectId = _super.dataAcquisitionProjectId; - - public final QDataPackageSubDocument dataPackage; - - //inherited - public final StringPath dataPackageId = _super.dataPackageId; - - public final ListPath dataSets = this.createList("dataSets", DataSetSubDocument.class, QDataSetSubDocument.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.description); -===================================================================== -Found a 58 line (156 tokens) duplication in the following files: -Starting at line 150 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageOverviewService.java -Starting at line 245 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetReportService.java - - missingTexFiles.add(KEY_MAIN); - } - - return missingTexFiles; - } - - /** - * This method fills the tex templates. - * - * @param templateContent The content of a tex template. - * @param templateConfiguration The configuration for freemarker. - * @param fileName filename of the script which will be filled in this method. - * @return The filled tex templates as byte array. - * @throws IOException Handles IO Exception. - * @throws TemplateException Handles template Exceptions. - */ - private String fillTemplate(String templateContent, Configuration templateConfiguration, - Map dataForTemplate, String fileName) throws IOException, TemplateException { - String templateName = "texTemplate"; - if (fileName != null && fileName.trim().length() > 0) { - templateName = fileName; - } - - // Read Template and escape elements - Template texTemplate = new Template(templateName, - ESCAPE_PREFIX + templateContent + ESCAPE_SUFFIX, templateConfiguration); - - try (Writer stringWriter = new StringWriter()) { - texTemplate.process(dataForTemplate, stringWriter); - - stringWriter.flush(); - return stringWriter.toString(); - } - } - - /** - * This method save a latex file into GridFS/MongoDB based on a byteArrayOutputStream. - * - * @param fileName The name of the file to be saved - * @return return the file name of the saved latex template in the GridFS / MongoDB. - * @throws IOException thrown if a stream cannot be closed - */ - @SuppressFBWarnings("OBL_UNSATISFIED_OBLIGATION") - private String saveCompleteZipFile(File zipFile, String fileName) throws IOException { - // No Update by API, so we have to delete first. - fileService.deleteTempFile(fileName); - // Save tex file - return fileService.saveTempFile(new FileInputStream(zipFile), fileName, CONTENT_TYPE_ZIP); - } - - /** - * This method load all needed objects from the db for filling the tex template. - * - * @param dataPackageId the id of the data package. - * @return A HashMap with all data for the template filling. The Key is the name of the Object, - * which is used in the template. - */ - private Map loadDataForTemplateFilling(String dataPackageId) { -===================================================================== -Found a 36 line (153 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java - - public static final QDataSetNestedDocument dataSetNestedDocument = new QDataSetNestedDocument("dataSetNestedDocument"); - - public final QAbstractNestedSubDocument _super; - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - //inherited - public final StringPath createdBy; - - //inherited - public final DateTimePath createdDate; - - public final StringPath dataPackageId = createString("dataPackageId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description; - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final BooleanPath shadow = createBoolean("shadow"); - - public final StringPath successorId = createString("successorId"); - - public final ListPath surveyIds = this.createList("surveyIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final NumberPath version; - - public QDataSetNestedDocument(String variable) { -===================================================================== -Found a 7 line (147 tokens) duplication in the following files: -Starting at line 145 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public QInstrumentSearchDocument(Class type, PathMetadata metadata, PathInits inits) { - super(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.configuration = inits.isInitialized("configuration") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration(forProperty("configuration")) : null; - this.dataPackage = inits.isInitialized("dataPackage") ? new QDataPackageSubDocument(forProperty("dataPackage"), inits.get("dataPackage")) : null; - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; - this.nestedDataPackage = inits.isInitialized("nestedDataPackage") ? new QDataPackageNestedDocument(forProperty("nestedDataPackage"), inits.get("nestedDataPackage")) : null; -===================================================================== -Found a 23 line (146 tokens) duplication in the following files: -Starting at line 29 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 32 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.annotations); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - public final ListPath concepts = this.createList("concepts", ConceptSubDocument.class, QConceptSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration configuration; - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - //inherited - public final StringPath dataAcquisitionProjectId = _super.dataAcquisitionProjectId; - - public final QDataPackageSubDocument dataPackage; - - //inherited - public final StringPath dataPackageId = _super.dataPackageId; - - public final ListPath dataSets = this.createList("dataSets", DataSetSubDocument.class, QDataSetSubDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 23 line (145 tokens) duplication in the following files: -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - public void testDeleteSingleAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataSetAttachmentMetadata dataSetAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildDataSetAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("dataSetAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataSetAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-sets/attachments").file(attachment) - .file(metadata)).andExpect(status().isCreated()); - - dataSetAttachmentMetadata.generateId(); - - // ensure that there is one attachment - mockMvc - .perform(get("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1)));; - - // delete the file - mockMvc - .perform(delete("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() - + "/attachments/" + attachment.getOriginalFilename())) -===================================================================== -Found a 22 line (143 tokens) duplication in the following files: -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - public void testDeleteSingleAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - ConceptAttachmentMetadata conceptAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildConceptAttachmentMetadata("con-conceptid$"); - MockMultipartFile metadata = new MockMultipartFile("conceptAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(conceptAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/concepts/attachments").file(attachment) - .file(metadata)).andExpect(status().isCreated()); - - conceptAttachmentMetadata.generateId(); - - // ensure that there is one file - mockMvc - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); - - // delete the file - mockMvc - .perform(delete("/api/concepts/" + conceptAttachmentMetadata.getConceptId() - + "/attachments/" + attachment.getOriginalFilename())) -===================================================================== -Found a 23 line (143 tokens) duplication in the following files: -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - public void testDeleteAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataPackageAttachmentMetadata dataPackageAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildDataPackageAttachmentMetadata("projectid"); - MockMultipartFile metadata = new MockMultipartFile("dataPackageAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataPackageAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-packages/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - dataPackageAttachmentMetadata.generateId(); - - // ensure that there is one attachment - mockMvc - .perform(get("/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() - + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); - - // delete the file - mockMvc - .perform(delete("/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() - + "/attachments/" + attachment.getOriginalFilename())) -===================================================================== -Found a 17 line (143 tokens) duplication in the following files: -Starting at line 244 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 270 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.setScaleLevel(ScaleLevels.ORDINAL); - List validResponses = new ArrayList<>(); - variable.getDistribution().setValidResponses(validResponses); - variable.getDistribution().getStatistics().setMaximum("2017-01-31"); - variable.getDistribution().getStatistics().setMinimum("2017-01-30"); - variable.getDistribution().getStatistics().setMedian("2017-01-30"); - variable.getDistribution().getStatistics().setThirdQuartile("2017-01-31"); - variable.getDistribution().getStatistics().setFirstQuartile("2017-01-30"); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - } - - @Test - public void testCreateDateVariableWithNominalScaleLevel() throws Exception { -===================================================================== -Found a 7 line (143 tokens) duplication in the following files: -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java - - public static final QConcept concept = new QConcept("concept"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - public final ListPath authors = this.createList("authors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); - - public final StringPath citationHint = createString("citationHint"); -===================================================================== -Found a 18 line (140 tokens) duplication in the following files: -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // release the project - project.setRelease(UnitTestCreateDomainObjectUtils.buildRelease()); - project.getRelease().setPinToStartPage(true); - mockMvc.perform(put("/api/data-acquisition-projects" + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); - shadowCopyQueueItemService.executeShadowCopyActions(); - - UnitTestUserManagementUtils.logout(); - // ensure that there is one pinned data package - mockMvc.perform(get(API_DATAPACKAGE_URI + "?pinned=true")).andExpect(status().isOk()) -===================================================================== -Found a 21 line (140 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - public void testDeleteSingleAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - InstrumentAttachmentMetadata instrumentAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildInstrumentAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("instrumentAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(instrumentAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/instruments/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - // ensure the uploaded file exists - mockMvc - .perform(get( - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); - - // delete the file - mockMvc - .perform(delete("/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() - + "/attachments/" + attachment.getOriginalFilename())) -===================================================================== -Found a 18 line (140 tokens) duplication in the following files: -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - public void testDeleteSingleAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - SurveyAttachmentMetadata surveyAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildSurveyAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("surveyAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(surveyAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/surveys/attachments").file(attachment) - .file(metadata)).andExpect(status().isCreated()); - - // ensure that there is one attachment - mockMvc.perform(get("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1)));; - - // delete the file - mockMvc.perform(delete("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() - + "/attachments/" + attachment.getOriginalFilename())) -===================================================================== -Found a 22 line (140 tokens) duplication in the following files: -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - public void testDeleteAllResponseRateImages() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("image", FILE_NAME, "image/png", "fakeimage".getBytes()); - SurveyResponseRateImageMetadata surveyResponseRateImageMetadata = - createResponseRateImageMetadata(); - MockMultipartFile metadata = new MockMultipartFile("surveyResponseRateImageMetadata", FILE_NAME, - "application/json", TestUtil.convertObjectToJsonBytes(surveyResponseRateImageMetadata)); - - // create the image - MvcResult result = mockMvc - .perform( - MockMvcRequestBuilders.multipart("/api/surveys/images").file(attachment).file(metadata)) - .andExpect(status().isCreated()).andReturn(); - - // assert that the file exists - String fileUri = result.getResponse().getHeaderValue(HttpHeaders.LOCATION).toString(); - mockMvc.perform(get(fileUri)).andExpect(status().isOk()); - - // delete all images - mockMvc - .perform( - delete("/api/surveys/" + surveyResponseRateImageMetadata.getSurveyId() + "/images")) -===================================================================== -Found a 19 line (140 tokens) duplication in the following files: -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QTags.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QTags.java - - public static final QTags tags = new QTags("tags"); - - public final SetPath de = this.createSet("de", String.class, StringPath.class, PathInits.DIRECT2); - - public final SetPath en = this.createSet("en", String.class, StringPath.class, PathInits.DIRECT2); - - public QTags(String variable) { - super(Tags.class, forVariable(variable)); - } - - public QTags(Path path) { - super(path.getType(), path.getMetadata()); - } - - public QTags(PathMetadata metadata) { - super(Tags.class, metadata); - } - -} -===================================================================== -Found a 23 line (140 tokens) duplication in the following files: -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 33 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath concepts = this.createList("concepts", ConceptSubDocument.class, QConceptSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration configuration; - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - //inherited - public final StringPath dataAcquisitionProjectId = _super.dataAcquisitionProjectId; - - public final QDataPackageSubDocument dataPackage; - - //inherited - public final StringPath dataPackageId = _super.dataPackageId; - - public final ListPath dataSets = this.createList("dataSets", DataSetSubDocument.class, QDataSetSubDocument.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.description); -===================================================================== -Found a 23 line (135 tokens) duplication in the following files: -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath accessWays = this.createList("accessWays", String.class, StringPath.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.annotations); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - public final ListPath concepts = this.createList("concepts", ConceptSubDocument.class, QConceptSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration configuration; - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - //inherited - public final StringPath dataAcquisitionProjectId = _super.dataAcquisitionProjectId; - - //inherited - public final ListPath dataCurators = _super.dataCurators; -===================================================================== -Found a 13 line (134 tokens) duplication in the following files: -Starting at line 244 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 270 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 298 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.setScaleLevel(ScaleLevels.ORDINAL); - List validResponses = new ArrayList<>(); - variable.getDistribution().setValidResponses(validResponses); - variable.getDistribution().getStatistics().setMaximum("2017-01-31"); - variable.getDistribution().getStatistics().setMinimum("2017-01-30"); - variable.getDistribution().getStatistics().setMedian("2017-01-30"); - variable.getDistribution().getStatistics().setThirdQuartile("2017-01-31"); - variable.getDistribution().getStatistics().setFirstQuartile("2017-01-30"); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 13 line (134 tokens) duplication in the following files: -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptNestedDocument.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java - - public QConceptNestedDocument(Class type, PathMetadata metadata, PathInits inits) { - super(type, metadata, inits); - this._super = new QAbstractNestedSubDocument(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.createdBy = _super.createdBy; - this.createdDate = _super.createdDate; - this.lastModifiedBy = _super.lastModifiedBy; - this.lastModifiedDate = _super.lastModifiedDate; - this.title = inits.isInitialized("title") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("title")) : null; - this.version = _super.version; - } - -} -===================================================================== -Found a 10 line (134 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 88 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedQuestions = this.createList("nestedQuestions", QuestionNestedDocument.class, QQuestionNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); - - //inherited - public final SetPath originalLanguages = _super.originalLanguages; -===================================================================== -Found a 19 line (134 tokens) duplication in the following files: -Starting at line 31 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 32 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.annotations); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - public final ListPath concepts = this.createList("concepts", ConceptSubDocument.class, QConceptSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration configuration; - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - //inherited - public final StringPath dataAcquisitionProjectId = _super.dataAcquisitionProjectId; - - //inherited - public final ListPath dataCurators = _super.dataCurators; -===================================================================== -Found a 13 line (134 tokens) duplication in the following files: -Starting at line 74 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java - - public QDataSetNestedDocument(Class type, PathMetadata metadata, PathInits inits) { - super(type, metadata, inits); - this._super = new QAbstractNestedSubDocument(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.createdBy = _super.createdBy; - this.createdDate = _super.createdDate; - this.description = inits.isInitialized("description") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")) : null; - this.lastModifiedBy = _super.lastModifiedBy; - this.lastModifiedDate = _super.lastModifiedDate; - this.version = _super.version; - } - -} -===================================================================== -Found a 16 line (132 tokens) duplication in the following files: -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - elasticsearchUpdateQueueService.processAllQueueItems(); - - // check that there is one instrument document - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(1L)); - - // check that auditing attributes have been set - mockMvc.perform(get(API_INSTRUMENTS_URI + "/" + instrument.getId())) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.createdDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.lastModifiedDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.createdBy", is("test"))) - .andExpect(jsonPath("$.lastModifiedBy", is("test"))); -===================================================================== -Found a 16 line (132 tokens) duplication in the following files: -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - mockMvc.perform(put(API_QUESTIONS_URI + "/" + question.getId()) - .content(TestUtil.convertObjectToJsonBytes(question)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - elasticsearchUpdateQueueService.processAllQueueItems(); - - // check that there is one question documents - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(1L)); - - // check that auditing attributes have been set - mockMvc.perform(get(API_QUESTIONS_URI + "/" + question.getId())) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.createdDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.lastModifiedDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.createdBy", is("user"))) - .andExpect(jsonPath("$.lastModifiedBy", is("user"))); -===================================================================== -Found a 15 line (132 tokens) duplication in the following files: -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - queueService.processAllQueueItems(); - - // check that there is one variable search document - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(1L)); - - // check that auditing attributes have been set - mockMvc.perform(get(API_VARIABLES_URI + "/" + variable.getId())).andExpect(status().isOk()) - .andExpect(jsonPath("$.createdDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.lastModifiedDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.createdBy", is("user"))) - .andExpect(jsonPath("$.lastModifiedBy", is("user"))); -===================================================================== -Found a 18 line (131 tokens) duplication in the following files: -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - public void testDeleteSingleAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataSetAttachmentMetadata dataSetAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildDataSetAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("dataSetAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataSetAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-sets/attachments").file(attachment) - .file(metadata)).andExpect(status().isCreated()); - - dataSetAttachmentMetadata.generateId(); - - // ensure that there is one attachment - mockMvc - .perform(get("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1)));; -===================================================================== -Found a 17 line (129 tokens) duplication in the following files: -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - public void testDeleteSingleAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - ConceptAttachmentMetadata conceptAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildConceptAttachmentMetadata("con-conceptid$"); - MockMultipartFile metadata = new MockMultipartFile("conceptAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(conceptAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/concepts/attachments").file(attachment) - .file(metadata)).andExpect(status().isCreated()); - - conceptAttachmentMetadata.generateId(); - - // ensure that there is one file - mockMvc - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 18 line (129 tokens) duplication in the following files: -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - public void testDeleteAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataPackageAttachmentMetadata dataPackageAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildDataPackageAttachmentMetadata("projectid"); - MockMultipartFile metadata = new MockMultipartFile("dataPackageAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataPackageAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-packages/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - dataPackageAttachmentMetadata.generateId(); - - // ensure that there is one attachment - mockMvc - .perform(get("/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() - + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 19 line (128 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public static final QDataSet dataSet = new QDataSet("dataSet"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); -===================================================================== -Found a 16 line (126 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 133 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - public void testDeleteSingleAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - InstrumentAttachmentMetadata instrumentAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildInstrumentAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("instrumentAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(instrumentAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/instruments/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - // ensure the uploaded file exists - mockMvc - .perform(get( - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 14 line (126 tokens) duplication in the following files: -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - public void testDeleteSingleAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - SurveyAttachmentMetadata surveyAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildSurveyAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("surveyAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(surveyAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/surveys/attachments").file(attachment) - .file(metadata)).andExpect(status().isCreated()); - - // ensure that there is one attachment - mockMvc.perform(get("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1)));; -===================================================================== -Found a 17 line (126 tokens) duplication in the following files: -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - public void testCreateSurveyResponseRateImageMetadata() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("image", FILE_NAME, "image/png", "fakeimage".getBytes()); - SurveyResponseRateImageMetadata surveyResponseRateImageMetadata = - createResponseRateImageMetadata(); - MockMultipartFile metadata = new MockMultipartFile("surveyResponseRateImageMetadata", FILE_NAME, - "application/json", TestUtil.convertObjectToJsonBytes(surveyResponseRateImageMetadata)); - - // create the image - MvcResult result = mockMvc - .perform( - MockMvcRequestBuilders.multipart("/api/surveys/images").file(attachment).file(metadata)) - .andExpect(status().isCreated()).andReturn(); - - // assert that the file exists - String fileUri = result.getResponse().getHeaderValue(HttpHeaders.LOCATION).toString(); - mockMvc.perform(get(fileUri)).andExpect(status().isOk()); -===================================================================== -Found a 18 line (125 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageOverviewService.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetReportService.java - - log.debug("Start generating report for {} and dataPackageId {}", originalName, dataPackageId); - try { - // Configuration, based on Freemarker Version 2.3.23 - Configuration templateConfiguration = new Configuration(Configuration.VERSION_2_3_23); - templateConfiguration.setDefaultEncoding(StandardCharsets.UTF_8.toString()); - templateConfiguration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); - templateConfiguration.setNumberFormat("0.######"); - log.debug("Prepare Zip enviroment config"); - // Prepare Zip enviroment config - Map env = new HashMap<>(); - env.put("create", "true"); - env.put("encoding", StandardCharsets.UTF_8.name()); - // Create tmp file - URI uriOfZipFile = URI.create("jar:" + zipTmpFilePath.toUri()); - try (FileSystem zipFileSystem = FileSystems.newFileSystem(uriOfZipFile, env);) { - // Check missing files. - log.debug("Check missing files."); - List missingTexFiles = this.validateDataPackageOverviewStructure(zipFileSystem); -===================================================================== -Found a 21 line (123 tokens) duplication in the following files: -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataSetAttachmentMetadata dataSetAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildDataSetAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("dataSetAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataSetAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-sets/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); - - dataSetAttachmentMetadata.generateId(); - - // read the created attachment and check the version - mockMvc.perform( - get("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.[0].dataSetId", is(dataSetAttachmentMetadata.getDataSetId()))) -===================================================================== -Found a 21 line (123 tokens) duplication in the following files: -Starting at line 270 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 387 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - surveyIds.add(project.getId() + "-WrongSurveyId"); - dataSet.setSurveyIds(surveyIds); - this.dataSetRepository.save(dataSet); - - //Instrument - Instrument instrument = UnitTestCreateDomainObjectUtils.buildInstrument(project.getId()); - this.instrumentRepository.save(instrument); - - //Atomic Question - Question question = UnitTestCreateDomainObjectUtils.buildQuestion(project.getId(), 123, instrument.getId() - ); - this.questionRepository.save(question); - QuestionImageMetadata questionImageMetadata = - UnitTestCreateDomainObjectUtils.buildQuestionImageMetadata(project.getId(), question.getId()); - UnitTestImageHelper.saveQuestionImage(this.questionImageService, questionImageMetadata); - - - // Act & Assert - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_POST_VALIDATION_URI)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.errors", hasSize(4))) -===================================================================== -Found a 21 line (121 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - ConceptAttachmentMetadata conceptAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildConceptAttachmentMetadata("con-conceptid$"); - MockMultipartFile metadata = new MockMultipartFile("conceptAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(conceptAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/concepts/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); - - conceptAttachmentMetadata.generateId(); - - // read the created attachment and check the version - mockMvc.perform( - get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.[0].conceptId", is(conceptAttachmentMetadata.getConceptId()))) -===================================================================== -Found a 21 line (121 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataPackageAttachmentMetadata dataPackageAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildDataPackageAttachmentMetadata("projectid"); - MockMultipartFile metadata = new MockMultipartFile("dataPackageAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataPackageAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-packages/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - dataPackageAttachmentMetadata.generateId(); - - // read the created attachment and check the version - mockMvc - .perform(get("/api/data-packages/" - + dataPackageAttachmentMetadata.getDataPackageId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect( - jsonPath("$.[0].dataPackageId", is(dataPackageAttachmentMetadata.getDataPackageId()))) -===================================================================== -Found a 15 line (121 tokens) duplication in the following files: -Starting at line 218 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 218 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 222 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 215 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - String filename = DataPackageAttachmentFilenameBuilder.buildFileName(metadata); - gridFsMetadataUpdateService.store(is, filename, "text/plain", metadata); - is.close(); - } - - private void assertExpectedFilesExistence(List expectedFiles) { - Iterator it = gridFsOperations.find(new Query()).iterator(); - List fileNames = new ArrayList<>(); - while (it.hasNext()) { - fileNames.add(it.next().getFilename()); - } - assertThat(fileNames.size(), equalTo(expectedFiles.size())); - assertThat(fileNames, containsInAnyOrder(expectedFiles.toArray())); - } -} -===================================================================== -Found a 4 line (121 tokens) duplication in the following files: -Starting at line 61 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java - - public final ListPath sponsors = this.createList("sponsors", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString studySeries = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("studySeries")); -===================================================================== -Found a 19 line (118 tokens) duplication in the following files: -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 133 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - InstrumentAttachmentMetadata instrumentAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildInstrumentAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("instrumentAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(instrumentAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/instruments/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - // read the created attachment and check the version - mockMvc - .perform(get( - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect( - jsonPath("$.[0].instrumentId", is(instrumentAttachmentMetadata.getInstrumentId()))) -===================================================================== -Found a 18 line (118 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - public void testUploadValidAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - SurveyAttachmentMetadata surveyAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildSurveyAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("surveyAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(surveyAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/surveys/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); - - // read the created attachment and check the version - mockMvc.perform( - get("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.[0].surveyId", is(surveyAttachmentMetadata.getSurveyId()))) -===================================================================== -Found a 19 line (117 tokens) duplication in the following files: -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - public void testUpdateInstrument() throws Exception { - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Instrument instrument = - UnitTestCreateDomainObjectUtils.buildInstrument(project.getId(), project.getId() + "-sy1"); - - // Act and Assert - // create the instrument with the given id - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // delete the survey - mockMvc.perform(delete(API_INSTRUMENTS_URI + "/" + instrument.getId())) - .andExpect(status().is2xxSuccessful()); - - instrument.setTitle(new I18nString("Hurz2", "Hurz2")); -===================================================================== -Found a 20 line (117 tokens) duplication in the following files: -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 330 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 388 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - dataSet.setSurveyIds(surveyIds); - this.dataSetRepository.save(dataSet); - - //Instrument - Instrument instrument = UnitTestCreateDomainObjectUtils.buildInstrument(project.getId()); - this.instrumentRepository.save(instrument); - - //Atomic Question - Question question = UnitTestCreateDomainObjectUtils.buildQuestion(project.getId(), 123, instrument.getId() - ); - this.questionRepository.save(question); - QuestionImageMetadata questionImageMetadata = - UnitTestCreateDomainObjectUtils.buildQuestionImageMetadata(project.getId(), question.getId()); - UnitTestImageHelper.saveQuestionImage(this.questionImageService, questionImageMetadata); - - - // Act & Assert - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_POST_VALIDATION_URI)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.errors", hasSize(4))) -===================================================================== -Found a 17 line (115 tokens) duplication in the following files: -Starting at line 188 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java - - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); - - // update the metadata - ConceptAttachmentMetadata current = - conceptAttachmentService.findAllByConcept(conceptAttachmentMetadata.getConceptId()).get(0); - current.setLanguage("en"); - - mockMvc - .perform(put("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments/" - + attachment.getOriginalFilename()).content(TestUtil.convertObjectToJsonBytes(current)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); - - // read the updated attachment and check the version - mockMvc - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) -===================================================================== -Found a 18 line (115 tokens) duplication in the following files: -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java - - .perform(get("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1)));; - - // update the metadata - DataSetAttachmentMetadata current = - dataSetAttachmentService.findAllByDataSet(dataSetAttachmentMetadata.getDataSetId()).get(0); - current.setLanguage("en"); - - mockMvc - .perform(put("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments/" - + attachment.getOriginalFilename()).content(TestUtil.convertObjectToJsonBytes(current)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); - - // read the updated attachment and check the version - mockMvc - .perform(get( - "/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) -===================================================================== -Found a 17 line (115 tokens) duplication in the following files: -Starting at line 182 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java - - mockMvc.perform(get("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1)));; - - // update the metadata - SurveyAttachmentMetadata current = - surveyAttachmentService.findAllBySurvey(surveyAttachmentMetadata.getSurveyId()).get(0); - current.setLanguage("en"); - - mockMvc - .perform(put("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments/" - + attachment.getOriginalFilename()).content(TestUtil.convertObjectToJsonBytes(current)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); - - // read the updated attachment and check the version - mockMvc - .perform(get("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments")) -===================================================================== -Found a 11 line (114 tokens) duplication in the following files: -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // check that auditing attributes have been set - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.createdDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.lastModifiedDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.createdBy", is("user"))) - .andExpect(jsonPath("$.lastModifiedBy", is("user"))); -===================================================================== -Found a 18 line (114 tokens) duplication in the following files: -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 223 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - .dataAcquisitionProjectId(project.getId()) - .title(I18nString.builder().de("titel") - .en("title") - .build()) - .fieldPeriod(Period.builder().start(LocalDate.now()) - .end(LocalDate.now() - .plusDays(1)) - .build()) - .build(); - - // create the survey with the given id but with an unknown project - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); - } - - @Test - public void testCreateSurveyEmptyProject() throws Exception { -===================================================================== -Found a 19 line (114 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 26 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - public final ListPath conceptIds = this.createList("conceptIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); -===================================================================== -Found a 6 line (114 tokens) duplication in the following files: -Starting at line 145 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public QInstrumentSearchDocument(Class type, PathMetadata metadata, PathInits inits) { - super(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.configuration = inits.isInitialized("configuration") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration(forProperty("configuration")) : null; - this.dataPackage = inits.isInitialized("dataPackage") ? new QDataPackageSubDocument(forProperty("dataPackage"), inits.get("dataPackage")) : null; - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; -===================================================================== -Found a 10 line (113 tokens) duplication in the following files: -Starting at line 88 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedQuestions = this.createList("nestedQuestions", QuestionNestedDocument.class, QQuestionNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); - - //inherited - public final NumberPath number; -===================================================================== -Found a 17 line (111 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java - - public static final QInstrumentSubDocument instrumentSubDocument = new QInstrumentSubDocument("instrumentSubDocument"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - public final ListPath conceptIds = this.createList("conceptIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description; -===================================================================== -Found a 10 line (108 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedQuestions = this.createList("nestedQuestions", QuestionNestedDocument.class, QQuestionNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); - - //inherited - public final SetPath originalLanguages = _super.originalLanguages; -===================================================================== -Found a 14 line (107 tokens) duplication in the following files: -Starting at line 219 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 219 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 223 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 221 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 216 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - gridFsMetadataUpdateService.store(is, filename, "text/plain", metadata); - is.close(); - } - - private void assertExpectedFilesExistence(List expectedFiles) { - Iterator it = gridFsOperations.find(new Query()).iterator(); - List fileNames = new ArrayList<>(); - while (it.hasNext()) { - fileNames.add(it.next().getFilename()); - } - assertThat(fileNames.size(), equalTo(expectedFiles.size())); - assertThat(fileNames, containsInAnyOrder(expectedFiles.toArray())); - } -} -===================================================================== -Found a 14 line (107 tokens) duplication in the following files: -Starting at line 217 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - "/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.[0].version", is(1))) - .andExpect(jsonPath("$.[0].createdBy", is("test"))) - .andExpect(jsonPath("$.[0].lastModifiedBy", is("test"))) - .andExpect(jsonPath("$.[0].language", is("en"))); - } - - @Test - @WithMockUser(authorities=AuthoritiesConstants.PUBLISHER) - public void testUploadAttachmentWithWrongLanguage() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 34 line (107 tokens) duplication in the following files: -Starting at line 55 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - @Autowired - private GridFsOperations gridFsOperations; - - @Autowired - private GridFsMetadataUpdateService gridFsMetadataUpdateService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { - this.surveyRepository.deleteAll(); - this.elasticsearchUpdateQueueItemRepository.deleteAll(); - this.elasticsearchAdminService.recreateAllIndices(); - javersService.deleteAll(); - this.gridFsOperations.delete(new Query()); - } - - @Test - @WithMockUser(authorities=AuthoritiesConstants.PUBLISHER, username="test") -===================================================================== -Found a 16 line (106 tokens) duplication in the following files: -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public static final QDataPackage dataPackage = new QDataPackage("dataPackage"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final ListPath dataCurators = this.createList("dataCurators", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 14 line (105 tokens) duplication in the following files: -Starting at line 290 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 316 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - public void testDeleteSurvey() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - rdcProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - // create the survey with the given id - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // delete the survey - mockMvc.perform(delete(API_SURVEYS_URI + "/" + survey.getId())) - .andExpect(status().is2xxSuccessful()); -===================================================================== -Found a 15 line (105 tokens) duplication in the following files: -Starting at line 69 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - //inherited - public final StringPath masterId = _super.masterId; - - public final ListPath nestedConcepts = this.createList("nestedConcepts", ConceptNestedDocument.class, QConceptNestedDocument.class, PathInits.DIRECT2); - - public final QDataPackageNestedDocument nestedDataPackage; - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedQuestions = this.createList("nestedQuestions", QuestionNestedDocument.class, QQuestionNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 18 line (104 tokens) duplication in the following files: -Starting at line 85 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString introduction = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.introduction); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - //inherited - public final StringPath masterId = _super.masterId; - - public final ListPath nestedConcepts = this.createList("nestedConcepts", ConceptNestedDocument.class, QConceptNestedDocument.class, PathInits.DIRECT2); - - public final QDataPackageNestedDocument nestedDataPackage; - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); - - public final QInstrumentNestedDocument nestedInstrument; -===================================================================== -Found a 14 line (103 tokens) duplication in the following files: -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 797 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariable() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - - // create the variable with the given id - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 7 line (103 tokens) duplication in the following files: -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedQuestions = this.createList("nestedQuestions", QuestionNestedDocument.class, QQuestionNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 7 line (103 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 88 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedQuestions = this.createList("nestedQuestions", QuestionNestedDocument.class, QQuestionNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 15 line (103 tokens) duplication in the following files: -Starting at line 69 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 88 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - //inherited - public final StringPath masterId = _super.masterId; - - public final ListPath nestedConcepts = this.createList("nestedConcepts", ConceptNestedDocument.class, QConceptNestedDocument.class, PathInits.DIRECT2); - - public final QDataPackageNestedDocument nestedDataPackage; - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedQuestions = this.createList("nestedQuestions", QuestionNestedDocument.class, QQuestionNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 13 line (102 tokens) duplication in the following files: -Starting at line 193 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 252 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 314 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 367 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - surveyNumbers.add(1); - List listOfSurveyIds = new ArrayList<>(); - listOfSurveyIds.add(survey.getId()); - - //Variables - Variable variable1 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name1", 1, surveyNumbers); - this.variableRepository.save(variable1); - Variable variable2 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name2", 2, surveyNumbers); - this.variableRepository.save(variable2); - Variable variable3 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name3", 3, surveyNumbers); -===================================================================== -Found a 18 line (101 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 248 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - public void testCreateDataSet() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // check that auditing attributes have been set - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) -===================================================================== -Found a 13 line (100 tokens) duplication in the following files: -Starting at line 132 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageOverviewResource.java -Starting at line 129 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetReportResource.java - - @PathVariable("dataPackageId") String dataPackageId, - @RequestParam("onBehalfOf") String onBehalfOf, @PathVariable("language") String language) - throws IOException { - Optional user = userService.getUserWithAuthoritiesByLogin(onBehalfOf); - if (user.isPresent()) { - // TODO refactor this - User userInstance = user.get(); - // switch to on behalf user for correct modification names - Collection currentAuthorities = - SecurityContextHolder.getContext().getAuthentication().getAuthorities(); - UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken( - userInstance.getLogin(), userInstance.getPassword(), currentAuthorities); - SecurityContextHolder.getContext().setAuthentication(authentication); -===================================================================== -Found a 15 line (100 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - public void testCreateDataSet() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 16 line (99 tokens) duplication in the following files: -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 133 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - InstrumentAttachmentMetadata instrumentAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildInstrumentAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("instrumentAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(instrumentAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/instruments/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - // read the created attachment and check the version - mockMvc - .perform(get( - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) -===================================================================== -Found a 16 line (99 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java - - public void testUploadValidAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - SurveyAttachmentMetadata surveyAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildSurveyAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("surveyAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(surveyAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/surveys/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); - - // read the created attachment and check the version - mockMvc.perform( - get("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments")) -===================================================================== -Found a 13 line (99 tokens) duplication in the following files: -Starting at line 382 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 414 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - "alicejr@example.com", true, u.getLangKey(), u.getAuthorities(), false); - - // Good user - restMvc.perform(post("/api/register").contentType(TestUtil.APPLICATION_JSON_UTF8) - .content(TestUtil.convertObjectToJsonBytes(u))).andExpect(status().isCreated()); - - // Duplicate login - restMvc - .perform(post("/api/register").contentType(TestUtil.APPLICATION_JSON_UTF8) - .content(TestUtil.convertObjectToJsonBytes(dup))) - .andExpect(status().is4xxClientError()); - - Optional userDup = userRepository.findOneByEmail("alicejr@example.com"); -===================================================================== -Found a 14 line (99 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath instruments = this.createList("instruments", InstrumentSubDocument.class, QInstrumentSubDocument.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - //inherited - public final StringPath masterId = _super.masterId; - - public final ListPath nestedConcepts = this.createList("nestedConcepts", ConceptNestedDocument.class, QConceptNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 13 line (97 tokens) duplication in the following files: -Starting at line 248 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - public void testDeleteDataSet() throws JsonSyntaxException, IOException, Exception { - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - - // create the DataSet with the given id - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 11 line (96 tokens) duplication in the following files: -Starting at line 65 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java - - public final ListPath subDataSets = this.createList("subDataSets", SubDataSet.class, QSubDataSet.class, PathInits.DIRECT2); - - //inherited - public final StringPath successorId = _super.successorId; - - public final ListPath surveyIds = this.createList("surveyIds", String.class, StringPath.class, PathInits.DIRECT2); - - public final ListPath> surveyNumbers = this.>createList("surveyNumbers", Integer.class, NumberPath.class, PathInits.DIRECT2); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString type = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("type")); -===================================================================== -Found a 13 line (95 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 235 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - public void testCreateRelatedPublications() throws IOException, Exception { - // ARRANGE - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - dataPackageRepository.save(dataPackage); - RelatedPublication relatedPublication = - UnitTestCreateDomainObjectUtils.buildRelatedPublication(); - // ACT - // create the related publication with the given id - this.mockMvc.perform(put(API_RELATED_PUBLICATION_URI + "/" + relatedPublication.getId()) - .content(TestUtil.convertObjectToJsonBytes(relatedPublication)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 13 line (94 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - public void testCreateDataPackage() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the dataPackage under the new url - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getId())) -===================================================================== -Found a 35 line (94 tokens) duplication in the following files: -Starting at line 26 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 26 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java - -public class DataAcquisitionProjectLastReleaseResourceTest extends AbstractTest { - private static final String API_DATA_ACQUISITION_PROJECTS_URI = "/api/data-acquisition-projects"; - - @Autowired - private WebApplicationContext wac; - - @Autowired - private DataAcquisitionProjectRepository dataAcquisitionProjectRepository; - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); - elasticsearchUpdateQueueItemRepository.deleteAll(); - elasticsearchAdminService.recreateAllIndices(); - javersService.deleteAll(); - } - - @Test - public void testFindReleases() throws IOException, Exception { -===================================================================== -Found a 9 line (94 tokens) duplication in the following files: -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptNestedDocument.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java -Starting at line 66 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationNestedDocument.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java - - public QConceptNestedDocument(Class type, PathMetadata metadata, PathInits inits) { - super(type, metadata, inits); - this._super = new QAbstractNestedSubDocument(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.createdBy = _super.createdBy; - this.createdDate = _super.createdDate; - this.lastModifiedBy = _super.lastModifiedBy; - this.lastModifiedDate = _super.lastModifiedDate; - this.title = inits.isInitialized("title") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("title")) : null; -===================================================================== -Found a 19 line (94 tokens) duplication in the following files: -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath concepts = this.createList("concepts", ConceptSubDocument.class, QConceptSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration configuration; - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - //inherited - public final StringPath dataAcquisitionProjectId = _super.dataAcquisitionProjectId; - - public final QDataPackageSubDocument dataPackage; - - //inherited - public final StringPath dataPackageId = _super.dataPackageId; - - public final ListPath dataSets = this.createList("dataSets", DataSetSubDocument.class, QDataSetSubDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 36 line (92 tokens) duplication in the following files: -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 31 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java - - @Autowired - private WebApplicationContext wac; - - @Autowired - private DataAcquisitionProjectRepository dataAcquisitionProjectRepository; - - @Autowired - private DataPackageRepository dataPackageRepository; - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); - dataPackageRepository.deleteAll(); - elasticsearchUpdateQueueItemRepository.deleteAll(); - elasticsearchAdminService.recreateAllIndices(); - javersService.deleteAll(); - } - - @Test -===================================================================== -Found a 19 line (92 tokens) duplication in the following files: -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QDaraUpdateQueueItem.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/QElasticsearchIndicesVersion.java - - public static final QDaraUpdateQueueItem daraUpdateQueueItem = new QDaraUpdateQueueItem("daraUpdateQueueItem"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath projectId = createString("projectId"); -===================================================================== -Found a 16 line (91 tokens) duplication in the following files: -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 262 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - public void testUpdateInstrument() throws Exception { - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Instrument instrument = - UnitTestCreateDomainObjectUtils.buildInstrument(project.getId(), project.getId() + "-sy1"); - - // Act and Assert - // create the instrument with the given id - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // delete the survey - mockMvc.perform(delete(API_INSTRUMENTS_URI + "/" + instrument.getId())) -===================================================================== -Found a 16 line (91 tokens) duplication in the following files: -Starting at line 26 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - public final ListPath conceptIds = this.createList("conceptIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); -===================================================================== -Found a 12 line (90 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.conceptmanagement.domain.QTags tags = new eu.dzhw.fdz.metadatamanagement.conceptmanagement.domain.QTags(_super.tags); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.title); - - public final ListPath variables = this.createList("variables", VariableSubDocument.class, QVariableSubDocument.class, PathInits.DIRECT2); - - //inherited - public final NumberPath version = _super.version; - - public QConceptSearchDocument(String variable) { -===================================================================== -Found a 13 line (89 tokens) duplication in the following files: -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 166 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - public void testReleasedDataPackageIsPubliclyVisible() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // release the project - project.setRelease(UnitTestCreateDomainObjectUtils.buildRelease()); -===================================================================== -Found a 12 line (88 tokens) duplication in the following files: -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 195 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 254 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 316 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - this.instrumentRepository.save(instrument); - - //Variables - Variable variable1 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name1", 1, surveyNumbers); - this.variableRepository.save(variable1); - Variable variable2 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name2", 2, surveyNumbers); - this.variableRepository.save(variable2); - Variable variable3 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name3", 3, surveyNumbers); - this.variableRepository.save(variable3); -===================================================================== -Found a 10 line (87 tokens) duplication in the following files: -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - project.setRelease(UnitTestCreateDomainObjectUtils.buildRelease()); - mockMvc.perform(put("/api/data-acquisition-projects" + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); - shadowCopyQueueItemService.executeShadowCopyActions(); - - UnitTestUserManagementUtils.logout(); - // ensure that there are still no pinned data packages - mockMvc.perform(get(API_DATAPACKAGE_URI + "?pinned=true")).andExpect(status().isOk()) - .andExpect(jsonPath("$.content.length()", is(0))); -===================================================================== -Found a 14 line (87 tokens) duplication in the following files: -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 262 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - public void testCreateInstrument() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Instrument instrument = - UnitTestCreateDomainObjectUtils.buildInstrument(project.getId(), project.getId() + "-sy1"); - - // Act and Assert - // create the instrument with the given id - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 12 line (86 tokens) duplication in the following files: -Starting at line 240 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 268 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - log.debug("Sending 'assignee group changed mail'"); - } - - users.parallelStream().forEach(user -> { - Locale locale = Locale.forLanguageTag(user.getLangKey()); - Context context = new Context(locale); - context.setVariable("user", user); - context.setVariable("projectId", projectId); - context.setVariable("locale", locale); - context.setVariable("baseUrl", baseUrl); - context.setVariable("messageToGroup", StringUtils.trimWhitespace(message)); - String content = templateEngine.process("assigneeGroupChanged", context); -===================================================================== -Found a 5 line (86 tokens) duplication in the following files: -Starting at line 322 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 329 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getMasterId())) - .andExpect(status().isOk()).andExpect(jsonPath("$.id", equalTo(dataPackage.getId()))) - .andExpect(jsonPath("$.masterId", equalTo(dataPackage.getMasterId()))) - .andExpect(jsonPath("$.release.version", equalTo("1.0.0"))) - .andExpect(jsonPath("$.completeTitle").exists()).andExpect(jsonPath("$.doi").exists()); -===================================================================== -Found a 7 line (86 tokens) duplication in the following files: -Starting at line 120 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public QConceptSearchDocument(Class type, PathMetadata metadata, PathInits inits) { - super(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; - } - -} -===================================================================== -Found a 5 line (86 tokens) duplication in the following files: -Starting at line 164 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public QDataPackageSearchDocument(Class type, PathMetadata metadata, PathInits inits) { - super(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.configuration = inits.isInitialized("configuration") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration(forProperty("configuration")) : null; - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; -===================================================================== -Found a 13 line (85 tokens) duplication in the following files: -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataSetAttachmentMetadata dataSetAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildDataSetAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("dataSetAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataSetAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-sets/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); -===================================================================== -Found a 13 line (85 tokens) duplication in the following files: -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java - - DataSetAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); - - List files = new ArrayList<>(); - gridFsOperations.find(new Query()).forEach(files::add); - - assertThat(files.size(), equalTo(2)); - - Query shadowQuery = new Query(GridFsCriteria.whereFilename() - .is("/data-sets/dat-" + PROJECT_ID + "-ds1$-1.0.0/attachments/filename.txt")); -===================================================================== -Found a 14 line (85 tokens) duplication in the following files: -Starting at line 171 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 236 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - public void testUpdateQuestion() throws Exception { - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Question question = UnitTestCreateDomainObjectUtils - .buildQuestion(project.getId(), 123, "instrument-Id"); - // Act and Assert - // create the variable with the given id - mockMvc.perform(put(API_QUESTIONS_URI + "/" + question.getId()) - .content(TestUtil.convertObjectToJsonBytes(question)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - question.setQuestionText(I18nString.builder().de("Angepasst") -===================================================================== -Found a 8 line (84 tokens) duplication in the following files: -Starting at line 332 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 411 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - String subject = messageSource.getMessage("email.dataset-report-error.title", - new Object[] {errorNotification.getDomainObjectId()}, locale); - List adminAddresses = admins.stream().map(User::getEmail).collect(Collectors.toList()); - sendEmail(sender, new String[] {onBehalfUser.getEmail()}, - adminAddresses.toArray(new String[adminAddresses.size()]), null, subject, content, false, - true); - - } -===================================================================== -Found a 25 line (84 tokens) duplication in the following files: -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - private DataPackageShadowCopyService shadowCopyService; - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - private DataAcquisitionProject project; - - private Release release; - - @Before - public void setUp() { - release = new Release("1.0.0", LocalDateTime.now(), null, false); - DataAcquisitionProject releasedProject = - UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - releasedProject.setRelease(release); - project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - project.setRelease(release); - project.setId(PROJECT_ID); - } - - @After - public void tearDown() { -===================================================================== -Found a 10 line (84 tokens) duplication in the following files: -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 77 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectShadowCopyServiceTest.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 88 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - DataPackage shadowCopy = shadowCopyOpt.get(); - - assertThat(shadowCopy.getId(), equalTo(master.getId() + "-" + release.getVersion())); - assertThat(shadowCopy.isShadow(), equalTo(true)); - assertThat(shadowCopy.getSuccessorId(), equalTo(null)); - assertThat(shadowCopy.getMasterId(), equalTo(master.getId())); - } - - @Test - public void createShadowCopyWithSameReleaseVersion() { -===================================================================== -Found a 12 line (84 tokens) duplication in the following files: -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java - - new MockMultipartFile("image", "image.png", "image/png", "fakeimage".getBytes()); - QuestionImageMetadata questionImageMetadata = - UnitTestCreateDomainObjectUtils.buildQuestionImageMetadata("projectid", "questionid"); - questionImageMetadata.setQuestionId(questionImageMetadata.getQuestionId() + "-1.0.0"); - questionImageMetadata.generateId(); - MockMultipartFile metadata = new MockMultipartFile("questionImageMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(questionImageMetadata)); - - mockMvc - .perform(MockMvcRequestBuilders.multipart("/api/questions/images").file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", -===================================================================== -Found a 9 line (83 tokens) duplication in the following files: -Starting at line 11 of /home/reitmann/data/metadatamanagement/node_modules/JSV/jsdoc-toolkit/java/src/JsDebugRun.java -Starting at line 11 of /home/reitmann/data/metadatamanagement/node_modules/JSV/jsdoc-toolkit/java/src/JsRun.java - -public class JsDebugRun { - public static void main(String[] args) { - String[] jsargs = {"-j="+args[0]}; - - String[] allArgs = new String[jsargs.length + args.length]; - System.arraycopy(args, 0, allArgs, 0, args.length); - System.arraycopy(jsargs, 0, allArgs, args.length ,jsargs.length); - - org.mozilla.javascript.tools.debugger.Main.main(allArgs); -===================================================================== -Found a 10 line (83 tokens) duplication in the following files: -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 217 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.[0].version", is(1))) - .andExpect(jsonPath("$.[0].createdBy", is("test"))) - .andExpect(jsonPath("$.[0].lastModifiedBy", is("test"))) - .andExpect(jsonPath("$.[0].language", is("en"))); - } - - @Test - @WithMockUser(authorities=AuthoritiesConstants.PUBLISHER) - public void testUploadAttachmentWithWrongType() throws Exception { -===================================================================== -Found a 11 line (83 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataPackageAttachmentMetadata dataPackageAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildDataPackageAttachmentMetadata("projectid"); - MockMultipartFile metadata = new MockMultipartFile("dataPackageAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataPackageAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-packages/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); -===================================================================== -Found a 13 line (83 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 217 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - public void testCreateDataPackage() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the dataPackage under the new url - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getId())) -===================================================================== -Found a 13 line (83 tokens) duplication in the following files: -Starting at line 88 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 171 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 236 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 312 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - public void testCreateQuestion() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Question question = UnitTestCreateDomainObjectUtils - .buildQuestion(project.getId(), 123, "instrument-Id"); - // Act and Assert - // create the Question with the given id - mockMvc.perform(put(API_QUESTIONS_URI + "/" + question.getId()) - .content(TestUtil.convertObjectToJsonBytes(question)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 17 line (83 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 125 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - this.mockMvc.perform(put(API_RELATED_PUBLICATION_URI + "/" + relatedPublication.getId()) - .content(TestUtil.convertObjectToJsonBytes(relatedPublication)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // ASSERT - // read the related publication under the new url - this.mockMvc.perform(get(API_RELATED_PUBLICATION_URI + "/" + relatedPublication.getId())) - .andExpect(status().isOk()); - - elasticsearchUpdateQueueService.processAllQueueItems(); - - // check that there is one dataPackage and one publication document - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(2L)); - } - - @Test - public void testCreateRelatedPublicationsWithPost() throws IOException, Exception { -===================================================================== -Found a 11 line (83 tokens) duplication in the following files: -Starting at line 65 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final ListPath subDataSets = this.createList("subDataSets", SubDataSet.class, QSubDataSet.class, PathInits.DIRECT2); - - //inherited - public final StringPath successorId = _super.successorId; - - public final ListPath surveyIds = this.createList("surveyIds", String.class, StringPath.class, PathInits.DIRECT2); - - public final ListPath> surveyNumbers = this.>createList("surveyNumbers", Integer.class, NumberPath.class, PathInits.DIRECT2); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString type = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("type")); -===================================================================== -Found a 17 line (83 tokens) duplication in the following files: -Starting at line 42 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java - - public final StringPath lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final BooleanPath shadow = createBoolean("shadow"); - - public final StringPath successorId = createString("successorId"); - - public final ListPath surveyIds = this.createList("surveyIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final NumberPath version; - - public QDataSetNestedDocument(String variable) { -===================================================================== -Found a 12 line (82 tokens) duplication in the following files: -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java - - DataSet copy = crudHelper.read(derivedId).orElseGet(DataSet::new); - BeanUtils.copyProperties(source, copy, "version"); - copy.setId(derivedId); - copy.setDataAcquisitionProjectId( - source.getDataAcquisitionProjectId() + "-" + release.getVersion()); - copy.setDataPackageId(source.getDataPackageId() + "-" + release.getVersion()); - copy.setSurveyIds(createDerivedSurveyIds(source.getSurveyIds(), release.getVersion())); - return copy; - } - - @Override - public Optional findPredecessorOfShadowCopy(DataSet shadowCopy, String previousVersion) { -===================================================================== -Found a 13 line (82 tokens) duplication in the following files: -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - DataPackageAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); - - List files = new ArrayList<>(); - gridFsOperations.find(new Query()).iterator().forEachRemaining(files::add); - - assertThat(files.size(), equalTo(2)); - - Query shadowQuery = new Query(GridFsCriteria.whereFilename() - .is("/data-packages/stu-" + PROJECT_ID + "$-1.0.0/attachments/filename.txt")); -===================================================================== -Found a 11 line (82 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - UnitTestCreateDomainObjectUtils.buildDataSetAttachmentMetadata(PROJECT_ID, 1); - master.generateId(); - master.setMasterId(master.getId()); - createTestFileForAttachment(master); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), null); - - GridFSFile gridFsFile = gridFsOperations.findOne( - new Query(GridFsCriteria.whereMetaData("dataAcquisitionProjectId").is(PROJECT_ID + "-1.0.0") - .andOperator(GridFsCriteria.whereMetaData("shadow").is(true)))); -===================================================================== -Found a 11 line (82 tokens) duplication in the following files: -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java - - public void testFindReleases() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - project = dataAcquisitionProjectRepository.save(project); - - // assert that there are no releases yet - mockMvc.perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId() + "/releases")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - - // fake a release - project.setRelease(UnitTestCreateDomainObjectUtils.buildRelease()); - dataAcquisitionProjectRepository.save(project); -===================================================================== -Found a 12 line (82 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.conceptmanagement.domain.QTags tags = new eu.dzhw.fdz.metadatamanagement.conceptmanagement.domain.QTags(_super.tags); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.title); - - public final ListPath variables = this.createList("variables", VariableSubDocument.class, QVariableSubDocument.class, PathInits.DIRECT2); - - //inherited - public final NumberPath version = _super.version; - - public QConceptSearchDocument(String variable) { -===================================================================== -Found a 15 line (82 tokens) duplication in the following files: -Starting at line 35 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final ListPath concepts = this.createList("concepts", ConceptSubDocument.class, QConceptSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration configuration; - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - //inherited - public final StringPath dataAcquisitionProjectId = _super.dataAcquisitionProjectId; - - //inherited - public final ListPath dataCurators = _super.dataCurators; -===================================================================== -Found a 12 line (81 tokens) duplication in the following files: -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java - - .filter(shadowCopy -> !dataSetRepository.existsById(shadowCopy.getMasterId())); - } - - private static List createDerivedSurveyIds(List surveyIds, String version) { - return surveyIds.stream().map(surveyId -> surveyId + "-" + version) - .collect(Collectors.toList()); - } - - @Override - public void deleteExistingShadowCopies(String projectId, String version) { - String oldProjectId = projectId + "-" + version; - try (Stream dataSets = dataSetRepository -===================================================================== -Found a 7 line (81 tokens) duplication in the following files: -Starting at line 40 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataSetSearchDocument.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/SurveySearchDocument.java - - private List variables = new ArrayList<>(); - private List nestedVariables = new ArrayList<>(); - private List instruments = new ArrayList<>(); - private List nestedInstruments = new ArrayList<>(); - private List questions = new ArrayList<>(); - private List nestedQuestions = new ArrayList<>(); - private List surveys = new ArrayList<>(); -===================================================================== -Found a 13 line (81 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 290 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 316 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - public void testCreateValidSurvey() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - rdcProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - // create the survey with the given id - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // read the survey under the new url - mockMvc.perform(get(API_SURVEYS_URI + "/" + survey.getId())) -===================================================================== -Found a 14 line (81 tokens) duplication in the following files: -Starting at line 227 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - public void testFinishPasswordReset() throws Exception { - - // Arrange - User user = UnitTestUserManagementUtils.getDefaultUser(); - user.setPassword("sdkgfsdkkgfsdglkfglsdjkagfjklsdgfhklsdglkfglksdgslkfgsdklj12"); - user.setActivationKey("testActivateTrue"); - user.setActivated(true); - user.setResetKey("ActivationKey"); - user.setResetDate(LocalDateTime.now().minusHours(1L)); - this.userRepository.save(user); - - KeyAndPasswordDto dto = new KeyAndPasswordDto(); - dto.setKey(user.getResetKey()); - dto.setNewPassword("newPassword"); -===================================================================== -Found a 17 line (81 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 22 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); -===================================================================== -Found a 16 line (81 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString format; -===================================================================== -Found a 10 line (81 tokens) duplication in the following files: -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java - - public final ListPath dataPackages = this.createList("dataPackages", DataPackageSubDocument.class, QDataPackageSubDocument.class, PathInits.DIRECT2); - - public final ListPath dataSets = this.createList("dataSets", DataSetSubDocument.class, QDataSetSubDocument.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.description); - - //inherited - public final StringPath doi = _super.doi; -===================================================================== -Found a 20 line (80 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java - - + Pattern.quote(DataPackageAttachmentFilenameBuilder.buildFileNamePrefix(dataPackageId)))); - Iterable files = this.operations.find(query); - files.forEach(file -> { - DataPackageAttachmentMetadata metadata = mongoTemplate.getConverter() - .read(DataPackageAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } - javers.commitShallowDelete(currentUser, metadata); - }); - this.operations.delete(query); - } - - /** - * Load all metadata objects from gridfs (ordered by indexInDataPackage). - * - * @param dataPackageId The id of the dataPackage. - * @return A list of metadata. - */ - public List findAllByDataPackage(String dataPackageId) { -===================================================================== -Found a 20 line (80 tokens) duplication in the following files: -Starting at line 96 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 165 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java - - "^" + Pattern.quote(DataSetAttachmentFilenameBuilder.buildFileNamePrefix(dataSetId)))); - Iterable files = this.operations.find(query); - files.forEach(file -> { - DataSetAttachmentMetadata metadata = - mongoTemplate.getConverter().read(DataSetAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } - javers.commitShallowDelete(currentUser, metadata); - }); - this.operations.delete(query); - } - - /** - * Load all metadata objects from gridfs (ordered by indexInDataSet). - * - * @param dataSetId The id of the dataSet. - * @return A list of metadata. - */ - public List findAllByDataSet(String dataSetId) { -===================================================================== -Found a 20 line (80 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java - - + Pattern.quote(InstrumentAttachmentFilenameBuilder.buildFileNamePrefix(instrumentId)))); - Iterable files = this.operations.find(query); - files.forEach(file -> { - InstrumentAttachmentMetadata metadata = - mongoTemplate.getConverter().read(InstrumentAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } - javers.commitShallowDelete(currentUser, metadata); - }); - this.operations.delete(query); - } - - /** - * Load all metadata objects from gridfs (ordered by indexInInstrument). - * - * @param instrumentId The id of the instrument. - * @return A list of metadata. - */ - public List findAllByInstrument(String instrumentId) { -===================================================================== -Found a 11 line (80 tokens) duplication in the following files: -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 369 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - this.instrumentRepository.save(instrument); - - //Variables - Variable variable1 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name1", 1, surveyNumbers); - this.variableRepository.save(variable1); - Variable variable2 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name2", 2, surveyNumbers); - this.variableRepository.save(variable2); - Variable variable3 = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name3", 3, surveyNumbers); -===================================================================== -Found a 13 line (80 tokens) duplication in the following files: -Starting at line 48 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java - - public final StringPath id = createString("id"); - - public final ListPath languages = this.createList("languages", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final NumberPath number = createNumber("number", Integer.class); -===================================================================== -Found a 7 line (80 tokens) duplication in the following files: -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptNestedDocument.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java -Starting at line 66 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationNestedDocument.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java - - public QConceptNestedDocument(Class type, PathMetadata metadata, PathInits inits) { - super(type, metadata, inits); - this._super = new QAbstractNestedSubDocument(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.createdBy = _super.createdBy; - this.createdDate = _super.createdDate; - this.lastModifiedBy = _super.lastModifiedBy; -===================================================================== -Found a 11 line (79 tokens) duplication in the following files: -Starting at line 284 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 378 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - List dataPackageSubDocuments = - dataPackages.stream().map(dataPackage -> { - DataAcquisitionProject project = - projectRepository.findById(dataPackage.getDataAcquisitionProjectId()).orElse(null); - if (project == null) { - // project has been deleted, skip upsert - return null; - } - return new DataPackageSubDocument(dataPackage, - doiBuilder.buildDataPackageDoi(dataPackage, getRelease(project))); - }).filter(document -> document != null).collect(Collectors.toList()); -===================================================================== -Found a 17 line (79 tokens) duplication in the following files: -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { - javersService.deleteAll(); - this.gridFsOperations.delete(new Query()); - } - - @Test - public void testUploadValidAttachmentAndCheckVersion() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 15 line (79 tokens) duplication in the following files: -Starting at line 70 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java - - surveyRepository.deleteAll(); - dataPackageRepository.deleteAll(); - elasticsearchUpdateQueueItemRepository.deleteAll(); - elasticsearchAdminService.recreateAllIndices(); - javersService.deleteAll(); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testGetAccessWaysOfDataPackage() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - dataPackageRepository.save(dataPackage); -===================================================================== -Found a 10 line (79 tokens) duplication in the following files: -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 166 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 217 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - public void testUnreleasedNotPubliclyVisible() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 21 line (79 tokens) duplication in the following files: -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java - - private InstrumentAttachmentShadowCopyService shadowCopyService; - - @Autowired - private GridFsMetadataUpdateService gridFsMetadataUpdateService; - - private DataAcquisitionProject dataAcquisitionProject; - - private Release release; - - @Before - public void setup() { - release = new Release("1.0.0", LocalDateTime.now(), null, false); - - dataAcquisitionProject = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProject.setId(PROJECT_ID); - dataAcquisitionProject.setRelease(release); - } - - @After - public void teardown() { - Query query = new Query(GridFsCriteria.whereFilename().regex("^/instruments")); -===================================================================== -Found a 11 line (79 tokens) duplication in the following files: -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - project.setRelease(UnitTestCreateDomainObjectUtils.buildRelease()); - this.mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); - - // Assert that the last version is 1.0.0 - lastRelease = this.versionsService.findLastRelease(project.getId()); - assertThat(lastRelease.getVersion(), is("1.0.0")); - - // Save third time without release (simulates unrelease) - project.setRelease(null); -===================================================================== -Found a 13 line (79 tokens) duplication in the following files: -Starting at line 397 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 429 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariableWithNonUniqueValueClass() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - ValidResponse validResponse = variable.getDistribution().getValidResponses().get(0); - validResponse.setValue("123.456"); -===================================================================== -Found a 7 line (79 tokens) duplication in the following files: -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 90 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final ListPath nestedSponsors = this.createList("nestedSponsors", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); - - public final NumberPath numberOfWaves = createNumber("numberOfWaves", Integer.class); -===================================================================== -Found a 13 line (78 tokens) duplication in the following files: -Starting at line 70 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - this.conceptRepository.deleteAll(); - this.elasticsearchUpdateQueueItemRepository.deleteAll(); - this.elasticsearchAdminService.recreateAllIndices(); - this.javersService.deleteAll(); - this.gridFsOperations.delete(new Query()); - } - - @Test - @WithMockUser(authorities=AuthoritiesConstants.PUBLISHER, username="test") - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 11 line (78 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - UnitTestCreateDomainObjectUtils.buildDataPackageAttachmentMetadata(PROJECT_ID); - master.generateId(); - master.setMasterId(master.getId()); - createTestFileForAttachment(master); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), null); - - GridFSFile gridFsFile = gridFsOperations.findOne( - new Query(GridFsCriteria.whereMetaData("dataAcquisitionProjectId").is(PROJECT_ID + "-1.0.0") - .andOperator(GridFsCriteria.whereMetaData("shadow").is(true)))); -===================================================================== -Found a 9 line (78 tokens) duplication in the following files: -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - mockMvc.perform(get(API_QUESTIONS_URI + "/" + question.getId())).andExpect(status().isOk()) - .andExpect(jsonPath("$.createdDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.lastModifiedDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.createdBy", is("user"))) - .andExpect(jsonPath("$.lastModifiedBy", is("user"))); - } - - @Test - public void testDeleteQuestion() throws Exception { -===================================================================== -Found a 15 line (78 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java - - public static final QSurveySubDocument surveySubDocument = new QSurveySubDocument("surveySubDocument"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString dataType; -===================================================================== -Found a 16 line (77 tokens) duplication in the following files: -Starting at line 26 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - public final ListPath conceptIds = this.createList("conceptIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); -===================================================================== -Found a 16 line (77 tokens) duplication in the following files: -Starting at line 29 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - public final ListPath conceptIds = this.createList("conceptIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - //inherited - public final BooleanPath hidden = _super.hidden; -===================================================================== -Found a 7 line (77 tokens) duplication in the following files: -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedQuestions = this.createList("nestedQuestions", QuestionNestedDocument.class, QQuestionNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 7 line (77 tokens) duplication in the following files: -Starting at line 81 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedQuestions = this.createList("nestedQuestions", QuestionNestedDocument.class, QQuestionNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 6 line (76 tokens) duplication in the following files: -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - .andExpect(jsonPath("$[0].version", is(equalTo(2)))) - .andExpect(jsonPath("$[0].authors.length()", is(equalTo(concept.getAuthors().size())))) - .andExpect( - jsonPath("$[0].authors[0].firstName", is(concept.getAuthors().get(0).getFirstName()))) - .andExpect(jsonPath("$[1].id", is(concept.getId()))) - .andExpect(jsonPath("$[1].title.de", is("hurzDe2"))) -===================================================================== -Found a 7 line (76 tokens) duplication in the following files: -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - .andExpect(jsonPath("$[0].version", is(equalTo(2)))) - .andExpect(jsonPath("$[0].projectContributors.length()", - is(equalTo(dataPackage.getProjectContributors().size())))) - .andExpect(jsonPath("$[0].projectContributors[0].firstName", - is(dataPackage.getProjectContributors().get(0).getFirstName()))) - .andExpect(jsonPath("$[1].id", is(dataPackage.getId()))) - .andExpect(jsonPath("$[1].title.de", is("hurzDe2"))) -===================================================================== -Found a 10 line (76 tokens) duplication in the following files: -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 149 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - DataPackageAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - release.setVersion("1.0.1"); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); - - GridFSFile gridFsFile = gridFsOperations.findOne( - new Query(GridFsCriteria.whereMetaData("dataAcquisitionProjectId").is(PROJECT_ID + "-1.0.0") - .andOperator(GridFsCriteria.whereMetaData("shadow").is(true)))); -===================================================================== -Found a 13 line (76 tokens) duplication in the following files: -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 353 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - private DataAcquisitionProject buildValidProject() { - //Arrange - //Project - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - project.getConfiguration().setDataPackagesState(new ProjectState(true, true)); - this.rdcProjectRepository.save(project); - - //Survey - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - this.surveyRepository.save(survey); - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - List listOfSurveyIds = new ArrayList<>(); -===================================================================== -Found a 9 line (76 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - public void testCreateDataAcquisitionProject() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - - // read the project under the new url - mockMvc.perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId())) -===================================================================== -Found a 10 line (75 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - public void testCreateConcept() throws IOException, Exception { - Concept concept = UnitTestCreateDomainObjectUtils.buildConcept(); - - // create the concept with the given id - mockMvc.perform(put(API_CONCEPT_URI + "/" + concept.getId()) - .content(TestUtil.convertObjectToJsonBytes(concept)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the concept under the new url - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId())).andExpect(status().isOk()); -===================================================================== -Found a 12 line (75 tokens) duplication in the following files: -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - public void testCreateQuestionWithPost() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Question question = - UnitTestCreateDomainObjectUtils.buildQuestion(project.getId(), 123, "instrument-Id"); - // Act and Assert - // create the Question with the given id - mockMvc.perform(post(API_QUESTIONS_URI).content(TestUtil.convertObjectToJsonBytes(question)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 8 line (75 tokens) duplication in the following files: -Starting at line 74 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java - - public final ListPath nestedQuestions = this.createList("nestedQuestions", QuestionNestedDocument.class, QQuestionNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); - - //inherited - public final SetPath originalLanguages = _super.originalLanguages; -===================================================================== -Found a 8 line (74 tokens) duplication in the following files: -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/repository/DaraUpdateQueueItemRepositoryImpl.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java - - public List findOldestLockedItems(String updateStartedBy, - LocalDateTime updateStartedAt) { - Query query = new Query(new Criteria().andOperator(Criteria.where("updateStartedBy") - .is(updateStartedBy), - Criteria.where("updateStartedAt") - .is(updateStartedAt))).limit(BULK_SIZE) - .with(Sort.by(Direction.ASC, "createdDate")); - return mongoOperations.find(query, DaraUpdateQueueItem.class); -===================================================================== -Found a 10 line (74 tokens) duplication in the following files: -Starting at line 375 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 390 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java - - public static RelatedPublication buildRelatedPublication() { - - List dataPackageIds = new ArrayList<>(); - dataPackageIds.add(UnitTestCreateValidIds.buildDataPackageId("testproject")); - - return RelatedPublication.builder().doi("A DOI") - .id(UnitTestCreateValidIds.buildRelatedPublicationId("HurzId123")) - .publicationAbstract("A publication Abstract").sourceLink("http://www.hurzexample.de/") - .sourceReference("A Source Reference").title("A Title of a Related Publication") - .dataPackageIds(dataPackageIds).authors("Author").year(2017) -===================================================================== -Found a 18 line (74 tokens) duplication in the following files: -Starting at line 55 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 55 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - private DataPackageAttachmentShadowCopyService shadowCopyService; - - private DataAcquisitionProject dataAcquisitionProject; - - private Release release; - - @Before - public void setup() { - release = new Release("1.0.0", LocalDateTime.now(), null, false); - - dataAcquisitionProject = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProject.setId(PROJECT_ID); - dataAcquisitionProject.setRelease(release); - } - - @After - public void teardown() { - Query query = new Query(GridFsCriteria.whereFilename().regex("^/data-packages")); -===================================================================== -Found a 10 line (74 tokens) duplication in the following files: -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 333 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - // create the survey with the given id - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // read the survey under the new url - mockMvc.perform(get(API_SURVEYS_URI + "/" + survey.getId())) - .andExpect(status().isOk()); -===================================================================== -Found a 9 line (74 tokens) duplication in the following files: -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public static final QDataPackage dataPackage = new QDataPackage("dataPackage"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; -===================================================================== -Found a 14 line (73 tokens) duplication in the following files: -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java - - conceptIds.addAll(questionRepository.findSubDocumentsByIdIn(questionIds).stream() - .map(question -> question.getConceptIds() != null ? question.getConceptIds() - : new ArrayList()) - .flatMap(List::stream).collect(Collectors.toSet())); - return conceptRepository.streamIdsByIdIn(conceptIds); - }, ElasticsearchType.concepts); - } - - /** - * Enqueue update of concept search documents when the variable changed. - * - * @param variable the updated, created or deleted variable. - */ - @HandleAfterCreate -===================================================================== -Found a 13 line (73 tokens) duplication in the following files: -Starting at line 257 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 272 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - dataPackage.setId(dataPackage.getId() + "-1.0.0"); - - mockMvc - .perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-save-not-allowed"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testUpdateShadowCopyDataPackage() throws Exception { -===================================================================== -Found a 16 line (73 tokens) duplication in the following files: -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - private DataAcquisitionProject dataAcquisitionProject; - - private Release release; - - @Before - public void setup() { - release = new Release("1.0.0", LocalDateTime.now(), null, false); - - dataAcquisitionProject = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProject.setId(PROJECT_ID); - dataAcquisitionProject.setRelease(release); - } - - @After - public void teardown() { - Query query = new Query(GridFsCriteria.whereFilename().regex("^/data-packages")); -===================================================================== -Found a 6 line (73 tokens) duplication in the following files: -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 144 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 108 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.createdDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.lastModifiedDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.createdBy", is("user"))) - .andExpect(jsonPath("$.lastModifiedBy", is("user"))); -===================================================================== -Found a 11 line (73 tokens) duplication in the following files: -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 363 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - - // create the DataSet with the given id - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // delete the DataSet - mockMvc.perform(delete(API_DATASETS_URI + "/" + dataSet.getId())) -===================================================================== -Found a 12 line (72 tokens) duplication in the following files: -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 162 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - + "/attachments/" + attachment.getOriginalFilename())) - .andExpect(status().is2xxSuccessful()); - - // ensure the uploaded file does not exist anymore - mockMvc - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void testDeleteAllAttachments() throws Exception { -===================================================================== -Found a 9 line (72 tokens) duplication in the following files: -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void testDeleteAllAttachments() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 11 line (72 tokens) duplication in the following files: -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java - - mockMvc.perform(put(API_CONCEPT_URI + "/" + concept.getId()) - .content(TestUtil.convertObjectToJsonBytes(concept)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the concept under the new url - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId())).andExpect(status().isOk()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testCreateConceptWithPost() throws IOException, Exception { -===================================================================== -Found a 12 line (72 tokens) duplication in the following files: -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 174 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - + "/attachments/" + attachment.getOriginalFilename())) - .andExpect(status().is2xxSuccessful()); - - // ensure the uploaded file does not exist anymore - mockMvc.perform(get( - "/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void testDeleteAllAttachments() throws Exception { -===================================================================== -Found a 9 line (72 tokens) duplication in the following files: -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - "/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void testUpdateAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 11 line (72 tokens) duplication in the following files: -Starting at line 336 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 315 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - put("/api/data-packages/" + dataPackageId + "/attachments/" + metadata.getFileName()) - .content(TestUtil.convertObjectToJsonBytes(metadata)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-save-not-allowed"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testDeleteAllAttachmentsOfShadowCopyDataPackage() throws Exception { - String dataPackageId = "stu-issue1991-1.0.0"; -===================================================================== -Found a 12 line (72 tokens) duplication in the following files: -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 174 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - + "/attachments/" + attachment.getOriginalFilename())) - .andExpect(status().is2xxSuccessful()); - - // ensure the uploaded file does not exist anymore - mockMvc - .perform(get("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void testDeleteAllAttachments() throws Exception { -===================================================================== -Found a 9 line (72 tokens) duplication in the following files: -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void testUpdateAttachmentMetadata() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 8 line (72 tokens) duplication in the following files: -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - project.setRelease(UnitTestCreateDomainObjectUtils.buildRelease()); - this.mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); - - // Assert that the last version is 1.0.0 - lastRelease = this.versionsService.findLastRelease(project.getId()); - assertThat(lastRelease.getVersion(), is("1.0.0")); -===================================================================== -Found a 11 line (72 tokens) duplication in the following files: -Starting at line 133 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 160 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - + "/attachments/" + attachment.getOriginalFilename())) - .andExpect(status().is2xxSuccessful()); - - // ensure the uploaded file does not exist anymore - mockMvc.perform(get("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void testDeleteAllAttachments() throws Exception { -===================================================================== -Found a 10 line (72 tokens) duplication in the following files: -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 201 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - rdcProjectRepository.save(project); - - Survey survey = Survey.builder().id("testId") - .dataAcquisitionProjectId(project.getId()) - .title(I18nString.builder().de("titel") - .en("title") - .build()) - .fieldPeriod(Period.builder().start(LocalDate.now()) - .end(LocalDate.now() - .minusDays(1)) -===================================================================== -Found a 11 line (72 tokens) duplication in the following files: -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateDateVariableWithOrdinalScaleLevel() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.setDataType(DataTypes.DATE); - variable.setScaleLevel(ScaleLevels.ORDINAL); -===================================================================== -Found a 14 line (72 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final ListPath dataCurators = this.createList("dataCurators", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 15 line (72 tokens) duplication in the following files: -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java - - public final ListPath accessWays = this.createList("accessWays", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description; - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString format; -===================================================================== -Found a 13 line (72 tokens) duplication in the following files: -Starting at line 107 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final StringPath successorId = _super.successorId; - - //inherited - public final ListPath surveyIds = _super.surveyIds; - - //inherited - public final ListPath> surveyNumbers = _super.surveyNumbers; - - public final ListPath surveys = this.createList("surveys", SurveySubDocument.class, QSurveySubDocument.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.title); -===================================================================== -Found a 8 line (71 tokens) duplication in the following files: -Starting at line 199 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/rest/errors/ExceptionTranslator.java -Starting at line 215 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/rest/errors/ExceptionTranslator.java - - String domainObject = - invalidFormatException.getPath().get(0).getFrom().getClass().getSimpleName(); - String property = processor.getCurrentName(); - if (property == null) { - property = invalidFormatException.getPath().get(0).getFieldName(); - } - String invalidValue = (String) invalidFormatException.getValue(); - String messageKey = "global.error.import.excel-parsing-error"; -===================================================================== -Found a 17 line (71 tokens) duplication in the following files: -Starting at line 144 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java - - conceptIds.addAll(questionRepository.findSubDocumentsByInstrumentId(instrument.getId()) - .stream().map(question -> question.getConceptIds() != null ? question.getConceptIds() - : new ArrayList()) - .flatMap(List::stream).collect(Collectors.toSet())); - return conceptRepository.streamIdsByIdIn(conceptIds); - }, ElasticsearchType.concepts); - } - - /** - * Enqueue update of concept search documents when the survey changed. - * - * @param survey the updated, created or deleted survey. - */ - @HandleAfterCreate - @HandleAfterSave - @HandleAfterDelete - public void onSurveyChanged(Survey survey) { -===================================================================== -Found a 6 line (71 tokens) duplication in the following files: -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableChangesProvider.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableChangesProvider.java - - public List getAffectedInstrumentIds(String variableId) { - List oldIds = new ArrayList<>(); - List newIds = new ArrayList<>(); - if (oldDomainObjects.get(variableId) != null - && oldDomainObjects.get(variableId).getRelatedQuestions() != null) { - for (RelatedQuestion question : oldDomainObjects.get(variableId).getRelatedQuestions()) { -===================================================================== -Found a 8 line (71 tokens) duplication in the following files: -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectShadowCopyServiceTest.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - Optional predecessor = - result.stream().filter(s -> s.getId().equals(shadow.getId())).findFirst(); - assertThat(predecessor.isPresent(), equalTo(true)); - assertThat(predecessor.get().getSuccessorId(), equalTo(successorId)); - } - - @Test - public void createShadowCopyWithDeletedMaster() { -===================================================================== -Found a 12 line (71 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 363 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // check that auditing attributes have been set - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) -===================================================================== -Found a 10 line (71 tokens) duplication in the following files: -Starting at line 460 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 495 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.setScaleLevel(I18nString.builder().de("InvalidValue").en("InvalidValue").build()); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isBadRequest()); - } - - @Test - public void testCreateVariableWithoutDataType() throws Exception { -===================================================================== -Found a 8 line (71 tokens) duplication in the following files: -Starting at line 43 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final ListPath dataSets = this.createList("dataSets", DataSetSubDocument.class, QDataSetSubDocument.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.description); - - //inherited - public final StringPath doi = _super.doi; -===================================================================== -Found a 15 line (70 tokens) duplication in the following files: -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - private Release release; - - @Before - public void setUp() { - release = new Release("1.0.0", LocalDateTime.now(), null, false); - DataAcquisitionProject releasedProject = - UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - releasedProject.setRelease(release); - project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - project.setRelease(release); - project.setId(PROJECT_ID); - } - - @After - public void tearDown() { -===================================================================== -Found a 9 line (70 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - public void testCreateDataAcquisitionProject() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - - // read the project under the new url - mockMvc.perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId())) -===================================================================== -Found a 14 line (70 tokens) duplication in the following files: -Starting at line 384 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 416 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.getDistribution().getMissings().add(value2); - - // create the variable with duplicate value codes - mockMvc - .perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString("unique"))); - - } - - @Test - public void testCreateVariableWithNonUniqueValueClass() throws Exception { -===================================================================== -Found a 14 line (70 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java - - public final ListPath conceptIds = this.createList("conceptIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); -===================================================================== -Found a 5 line (70 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 88 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedQuestions = this.createList("nestedQuestions", QuestionNestedDocument.class, QQuestionNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedRelatedPublications = this.createList("nestedRelatedPublications", RelatedPublicationNestedDocument.class, QRelatedPublicationNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 13 line (70 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java - - public static final QDataPackageSubDocument dataPackageSubDocument = new QDataPackageSubDocument("dataPackageSubDocument"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath doi = createString("doi"); -===================================================================== -Found a 23 line (69 tokens) duplication in the following files: -Starting at line 206 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/config/JHipsterProperties.java -Starting at line 244 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/config/JHipsterProperties.java - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } -===================================================================== -Found a 7 line (69 tokens) duplication in the following files: -Starting at line 319 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 354 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(2L)); - - // the public user should now get the latest shadow from elastic - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getMasterId())) - .andExpect(status().isOk()).andExpect(jsonPath("$.id", equalTo(dataPackage.getId()))) - .andExpect(jsonPath("$.masterId", equalTo(dataPackage.getMasterId()))) - .andExpect(jsonPath("$.release.version", equalTo("1.0.0"))) -===================================================================== -Found a 11 line (69 tokens) duplication in the following files: -Starting at line 386 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 422 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - rdcProjectRepository.save(project); - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = PUBLISHER_USERNAME) - public void testUpdateRequiredObjectTypes_badRequest() throws Exception { -===================================================================== -Found a 8 line (69 tokens) duplication in the following files: -Starting at line 33 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 33 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 31 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - public final ListPath concepts = this.createList("concepts", ConceptSubDocument.class, QConceptSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration configuration; - - //inherited - public final StringPath createdBy = _super.createdBy; -===================================================================== -Found a 17 line (69 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - public final StringPath dataSetId = createString("dataSetId"); - - public final NumberPath dataSetNumber = createNumber("dataSetNumber", Integer.class); - - public final StringPath id = createString("id"); -===================================================================== -Found a 6 line (68 tokens) duplication in the following files: -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - mockMvc.perform(get(API_DATAPACKAGE_URI)).andExpect(status().isOk()) - .andExpect(jsonPath("$.content.length()", is(0))); - - // get the empty list of pinned data packages - mockMvc.perform(get(API_DATAPACKAGE_URI + "?pinned=true")).andExpect(status().isOk()) - .andExpect(jsonPath("$.content.length()", is(0))); -===================================================================== -Found a 12 line (68 tokens) duplication in the following files: -Starting at line 129 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java - - assertThat(files.size(), equalTo(2)); - - Query shadowQuery = new Query(GridFsCriteria.whereFilename() - .is("/data-packages/stu-" + PROJECT_ID + "$-1.0.0/attachments/filename.txt")); - GridFSFile shadowFile = gridFsOperations.findOne(shadowQuery); - - assertThat(shadowFile, notNullValue()); - - DataPackageAttachmentMetadata metadata = - mongoTemplate.getConverter().read(DataPackageAttachmentMetadata.class, shadowFile.getMetadata()); - - assertThat(metadata.getSuccessorId(), nullValue()); -===================================================================== -Found a 14 line (68 tokens) duplication in the following files: -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - this.surveyRepository.save(survey); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(null, survey.getId(), 1); - - - // Act and Assert - // create the DataSet with a survey but without a project - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); - } - - @Test - public void testCreateDataSetWithWrongFormat() throws Exception { -===================================================================== -Found a 12 line (68 tokens) duplication in the following files: -Starting at line 129 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java - - assertThat(files.size(), equalTo(2)); - - Query shadowQuery = new Query(GridFsCriteria.whereFilename() - .is("/data-sets/dat-" + PROJECT_ID + "-ds1$-1.0.0/attachments/filename.txt")); - GridFSFile shadowFile = gridFsOperations.findOne(shadowQuery); - - assertThat(shadowFile, notNullValue()); - - DataSetAttachmentMetadata metadata = mongoTemplate.getConverter() - .read(DataSetAttachmentMetadata.class, shadowFile.getMetadata()); - - assertThat(metadata.getSuccessorId(), nullValue()); -===================================================================== -Found a 12 line (68 tokens) duplication in the following files: -Starting at line 129 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 194 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java - - assertThat(files.size(), equalTo(2)); - - Query shadowQuery = new Query(GridFsCriteria.whereFilename() - .is("/instruments/ins-" + PROJECT_ID + "-ins1$-1.0.0/attachments/filename.txt")); - GridFSFile shadowFile = gridFsOperations.findOne(shadowQuery); - - assertThat(shadowFile, notNullValue()); - - InstrumentAttachmentMetadata metadata = mongoTemplate.getConverter() - .read(InstrumentAttachmentMetadata.class, shadowFile.getMetadata()); - - assertThat(metadata.getSuccessorId(), nullValue()); -===================================================================== -Found a 12 line (68 tokens) duplication in the following files: -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 192 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java - - assertThat(files.size(), equalTo(2)); - - Query shadowQuery = new Query(GridFsCriteria.whereFilename() - .is("/questions/que-" + PROJECT_ID + "-ins1-1.1$-1.0.0/images/TestFileName.PNG")); - GridFSFile shadowFile = gridFsOperations.findOne(shadowQuery); - - assertThat(shadowFile, notNullValue()); - - QuestionImageMetadata metadata = - mongoTemplate.getConverter().read(QuestionImageMetadata.class, shadowFile.getMetadata()); - - assertThat(metadata.getSuccessorId(), nullValue()); -===================================================================== -Found a 11 line (68 tokens) duplication in the following files: -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 842 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateDateVariableWithOrdinalScaleLevel() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.setDataType(DataTypes.DATE); - variable.setScaleLevel(ScaleLevels.ORDINAL); -===================================================================== -Found a 18 line (68 tokens) duplication in the following files: -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); - - //inherited - public final BooleanPath hidden = _super.hidden; - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final NumberPath number = createNumber("number", Integer.class); - - public final ListPath originalLanguages = this.createList("originalLanguages", String.class, StringPath.class, PathInits.DIRECT2); -===================================================================== -Found a 6 line (68 tokens) duplication in the following files: -Starting at line 76 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 97 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 104 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); - - //inherited - public final SetPath originalLanguages = _super.originalLanguages; -===================================================================== -Found a 7 line (68 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.QDataPackage _super = new eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.QDataPackage(this); - - public final ListPath accessWays = this.createList("accessWays", String.class, StringPath.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.annotations); -===================================================================== -Found a 3 line (68 tokens) duplication in the following files: -Starting at line 166 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 149 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 166 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 178 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.configuration = inits.isInitialized("configuration") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration(forProperty("configuration")) : null; - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; -===================================================================== -Found a 19 line (67 tokens) duplication in the following files: -Starting at line 29 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/ValidResponseValueMustBeANumberOnNumericDataTypeValidator.java -Starting at line 29 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/ValidResponseValueMustBeAnIsoDateOnDateDataTypeValidator.java - - ValidResponseValueMustBeANumberOnNumericDataType constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Variable variable, ConstraintValidatorContext context) { - - if (variable == null || variable.getDataType() == null - || variable.getDistribution() == null - || variable.getDistribution().getValidResponses() == null) { - return true; - } - - if (variable.getDataType() - .equals(DataTypes.NUMERIC)) { -===================================================================== -Found a 9 line (67 tokens) duplication in the following files: -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // release the project - project.setRelease(UnitTestCreateDomainObjectUtils.buildRelease()); -===================================================================== -Found a 7 line (67 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/AvailableDataSetNumbersResourceControllerTest.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/AvailableInstrumentNumbersResourceControllerTest.java -Starting at line 77 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/AvailableSurveyNumbersResourceControllerTest.java - - + "/available-data-set-numbers")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(3))) - .andExpect(jsonPath("$.[0]", is(1))).andExpect(jsonPath("$.[1]", is(2))) - .andExpect(jsonPath("$.[2]", is(4))); - } - -} -===================================================================== -Found a 9 line (67 tokens) duplication in the following files: -Starting at line 282 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 363 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - - // Act and Assert - // create the DataSet with the given id - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 11 line (67 tokens) duplication in the following files: -Starting at line 219 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 280 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 339 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 397 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - question.getSuccessors().add("testProject-WrongQuestion"); - this.questionRepository.save(question); - QuestionImageMetadata questionImageMetadata = - UnitTestCreateDomainObjectUtils.buildQuestionImageMetadata(project.getId(), question.getId()); - UnitTestImageHelper.saveQuestionImage(this.questionImageService, questionImageMetadata); - - - // Act & Assert - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_POST_VALIDATION_URI)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.errors", hasSize(2))) -===================================================================== -Found a 11 line (67 tokens) duplication in the following files: -Starting at line 334 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 365 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - Configuration invalidConf = new Configuration(); - project.setConfiguration(invalidConf); - mockMvc - .perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))) - .andExpect(status().isBadRequest()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.DATA_PROVIDER) -===================================================================== -Found a 9 line (67 tokens) duplication in the following files: -Starting at line 338 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 356 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - "funky@example.com", // e-mail - true, // activated - "en", // langKey - new HashSet<>(Arrays.asList(AuthoritiesConstants.USER)), false); - - restUserMockMvc.perform(post("/api/register").contentType(TestUtil.APPLICATION_JSON_UTF8) - .content(TestUtil.convertObjectToJsonBytes(u))).andExpect(status().isBadRequest()); - - Optional user = userRepository.findOneByEmail("funky@example.com"); -===================================================================== -Found a 10 line (67 tokens) duplication in the following files: -Starting at line 451 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 608 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariableWithInvalidScaleLevel() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.setScaleLevel(I18nString.builder().de("InvalidValue").en("InvalidValue").build()); -===================================================================== -Found a 12 line (67 tokens) duplication in the following files: -Starting at line 55 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final StringPath id = _super.id; - - public final ListPath instruments = this.createList("instruments", InstrumentSubDocument.class, QInstrumentSubDocument.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - //inherited - public final StringPath license = _super.license; -===================================================================== -Found a 14 line (67 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final ListPath instruments = this.createList("instruments", InstrumentSubDocument.class, QInstrumentSubDocument.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - //inherited - public final StringPath masterId = _super.masterId; - - public final ListPath nestedConcepts = this.createList("nestedConcepts", ConceptNestedDocument.class, QConceptNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 4 line (67 tokens) duplication in the following files: -Starting at line 149 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 181 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - this.dataPackage = inits.isInitialized("dataPackage") ? new QDataPackageSubDocument(forProperty("dataPackage"), inits.get("dataPackage")) : null; - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; - this.nestedDataPackage = inits.isInitialized("nestedDataPackage") ? new QDataPackageNestedDocument(forProperty("nestedDataPackage"), inits.get("nestedDataPackage")) : null; - this.release = inits.isInitialized("release") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QRelease(forProperty("release")) : null; -===================================================================== -Found a 14 line (66 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsFirstQuartileMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsFirstQuartileMustBeAnIsoDateOnDateDataTypeValidator.java - - StatisticsFirstQuartileMustBeANumberOnNumericDataType constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Variable variable, ConstraintValidatorContext context) { - - if (variable == null || variable.getDataType() == null || variable.getDistribution() == null - || variable.getDistribution().getStatistics() == null - || variable.getDistribution().getStatistics().getFirstQuartile() == null -===================================================================== -Found a 15 line (66 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMaximumMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMaximumMustBeAnIsoDateOnDateDataTypeValidator.java - - StatisticsMaximumMustBeANumberOnNumericDataType constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Variable variable, ConstraintValidatorContext context) { - - if (variable == null || variable.getDataType() == null - || variable.getDistribution() == null - || variable.getDistribution().getStatistics() == null - || variable.getDistribution().getStatistics().getMaximum() == null -===================================================================== -Found a 15 line (66 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMedianMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMedianMustBeAnIsoDateOnDateDataTypeValidator.java - - StatisticsMedianMustBeANumberOnNumericDataType constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Variable variable, ConstraintValidatorContext context) { - - if (variable == null || variable.getDataType() == null - || variable.getDistribution() == null - || variable.getDistribution().getStatistics() == null - || variable.getDistribution().getStatistics().getMedian() == null -===================================================================== -Found a 16 line (66 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMinimumMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMinimumMustBeAnIsoDateOnDateDataTypeValidator.java - - StatisticsMinimumMustBeANumberOnNumericDataType constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Variable variable, ConstraintValidatorContext context) { - - if (variable == null - || variable.getDataType() == null - || variable.getDistribution() == null - || variable.getDistribution().getStatistics() == null - || variable.getDistribution().getStatistics().getMinimum() == null -===================================================================== -Found a 15 line (66 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsThirdQuartileMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsThirdQuartileMustBeAnIsoDateOnDateDataTypeValidator.java - - StatisticsThirdQuartileMustBeANumberOnNumericDataType constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Variable variable, ConstraintValidatorContext context) { - - if (variable == null || variable.getDataType() == null - || variable.getDistribution() == null - || variable.getDistribution().getStatistics() == null - || variable.getDistribution().getStatistics().getThirdQuartile() == null -===================================================================== -Found a 13 line (66 tokens) duplication in the following files: -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java - - current.setType(InstrumentAttachmentTypes.OTHER); - - mockMvc - .perform(put("/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() - + "/attachments/" + attachment.getOriginalFilename()) - .content(TestUtil.convertObjectToJsonBytes(current)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); - - // read the updated attachment and check the version - mockMvc - .perform(get( - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) -===================================================================== -Found a 13 line (66 tokens) duplication in the following files: -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 188 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildRelatedPublication("TestAuthors", 1959); - - // ACT - this.mockMvc - .perform(put(API_RELATED_PUBLICATION_URI + "/" + relatedPublication.getId()) - .content(TestUtil.convertObjectToJsonBytes(relatedPublication)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("related-publication-management.error.related-publication.year.valid"))); - } - - @Test - public void testCreateRelatedPublicationsWithInvalidYearInFuture() throws IOException, Exception { -===================================================================== -Found a 12 line (66 tokens) duplication in the following files: -Starting at line 241 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 218 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageShadowCopyServiceTest.java - - } - - private void createTestFileForSurveyRateImage(SurveyResponseRateImageMetadata metadata) - throws Exception { - - try (InputStream is = new ByteArrayInputStream("fakeimage".getBytes(StandardCharsets.UTF_8))) { - String filename = - String.format("/surveys/%s/%s", metadata.getSurveyId(), metadata.getFileName()); - gridFsMetadataUpdateService.store(is, filename, "image/png", metadata); - } - } -} -===================================================================== -Found a 10 line (66 tokens) duplication in the following files: -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 823 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 842 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateDateVariableWithOrdinalScaleLevel() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.setDataType(DataTypes.DATE); -===================================================================== -Found a 11 line (66 tokens) duplication in the following files: -Starting at line 676 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 696 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 716 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testFilterExpressionLanguageIsEmpty() throws Exception { - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.getFilterDetails().setExpressionLanguage(null); -===================================================================== -Found a 11 line (66 tokens) duplication in the following files: -Starting at line 736 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 756 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 776 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testRuleExpressionLanguageIsEmpty() throws Exception { - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.getGenerationDetails().setRuleExpressionLanguage(null); -===================================================================== -Found a 15 line (66 tokens) duplication in the following files: -Starting at line 35 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 37 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final BooleanPath shadow = createBoolean("shadow"); - - public final StringPath successorId = createString("successorId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title; -===================================================================== -Found a 11 line (66 tokens) duplication in the following files: -Starting at line 75 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - //inherited - public final StringPath masterId = _super.masterId; - - public final ListPath nestedConcepts = this.createList("nestedConcepts", ConceptNestedDocument.class, QConceptNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 2 line (66 tokens) duplication in the following files: -Starting at line 82 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java - - this.surveyMethod = inits.isInitialized("surveyMethod") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("surveyMethod")) : null; - this.title = inits.isInitialized("title") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("title")) : null; -===================================================================== -Found a 16 line (65 tokens) duplication in the following files: -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptAttachmentService.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptAttachmentService.java - - ConceptAttachmentFilenameBuilder.buildFileNamePrefix(conceptId)))); - Iterable files = this.operations.find(query); - files.forEach(file -> { - ConceptAttachmentMetadata metadata = mongoTemplate.getConverter().read( - ConceptAttachmentMetadata.class, file.getMetadata()); - javers.commitShallowDelete(currentUser, metadata); - }); - this.operations.delete(query); - } - - /** - * Load all metadata objects from gridfs (ordered by indexInConcept). - * @param conceptId The id of the {@link Concept}. - * @return A list of metadata. - */ - public List findAllByConcept(String conceptId) { -===================================================================== -Found a 10 line (65 tokens) duplication in the following files: -Starting at line 336 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 337 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 315 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - put("/api/data-packages/" + dataPackageId + "/attachments/" + metadata.getFileName()) - .content(TestUtil.convertObjectToJsonBytes(metadata)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-save-not-allowed"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testDeleteAllAttachmentsOfShadowCopyDataPackage() throws Exception { -===================================================================== -Found a 12 line (65 tokens) duplication in the following files: -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 197 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - + "/attachments/" + attachment.getOriginalFilename())) - .andExpect(status().is2xxSuccessful()); - - // ensure the uploaded file does not exist anymore - mockMvc - .perform(get( - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") -===================================================================== -Found a 14 line (64 tokens) duplication in the following files: -Starting at line 144 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java - - conceptIds.addAll(questionRepository.findSubDocumentsByInstrumentId(instrument.getId()) - .stream().map(question -> question.getConceptIds() != null ? question.getConceptIds() - : new ArrayList()) - .flatMap(List::stream).collect(Collectors.toSet())); - return conceptRepository.streamIdsByIdIn(conceptIds); - }, ElasticsearchType.concepts); - } - - /** - * Enqueue update of concept search documents when the survey changed. - * - * @param survey the updated, created or deleted survey. - */ - @HandleAfterCreate -===================================================================== -Found a 20 line (64 tokens) duplication in the following files: -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageOverviewService.java -Starting at line 208 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetReportService.java - - } - - // Save into MongoDB / GridFS - File zipTmpFile = zipTmpFilePath.toFile(); - String fileName = this.saveCompleteZipFile(zipTmpFile, originalName); - log.debug("file saved, start #handletaskDone"); - taskService.handleTaskDone(task, fileName); - } catch (IOException e) { - log.error("failed generating report", e); - taskService.handleErrorTask(task, e); - } - } - - /** - * Checks for all files which are included for the tex template. - * - * @param zipFileSystem The zip file as file system - * @return True if all files are included. False min one file is missing. - */ - private List validateDataPackageOverviewStructure(FileSystem zipFileSystem) { -===================================================================== -Found a 11 line (64 tokens) duplication in the following files: -Starting at line 444 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 551 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - new DataSetSearchDocument(dataSet, dataPackage, variableProjections, - surveys, instruments, questions, concepts, release, doi, configuration); - - request.add(new IndexRequest(lockedItem.getDocumentType().name()).id(searchDocument.getId()) - .source(gson.toJson(searchDocument), XContentType.JSON)); - return true; - } - return false; - } - - private boolean addUpsertActionForSurvey(ElasticsearchUpdateQueueItem lockedItem, -===================================================================== -Found a 10 line (64 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - public void testCreateConcept() throws IOException, Exception { - Concept concept = UnitTestCreateDomainObjectUtils.buildConcept(); - - // create the concept with the given id - mockMvc.perform(put(API_CONCEPT_URI + "/" + concept.getId()) - .content(TestUtil.convertObjectToJsonBytes(concept)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the concept under the new url - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId())).andExpect(status().isOk()); -===================================================================== -Found a 9 line (64 tokens) duplication in the following files: -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 205 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - project.setRelease(UnitTestCreateDomainObjectUtils.buildRelease()); - mockMvc.perform(put("/api/data-acquisition-projects" + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); - shadowCopyQueueItemService.executeShadowCopyActions(); - - UnitTestUserManagementUtils.logout(); - // ensure that there are still no pinned data packages - mockMvc.perform(get(API_DATAPACKAGE_URI + "?pinned=true")).andExpect(status().isOk()) -===================================================================== -Found a 9 line (64 tokens) duplication in the following files: -Starting at line 159 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - - // load the project with the projection - mockMvc - .perform( - get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andExpect(jsonPath("$.id", is(project.getId()))) - .andExpect(jsonPath("$.version", is(0))); -===================================================================== -Found a 12 line (64 tokens) duplication in the following files: -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java -Starting at line 188 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - assertThat(files.size(), equalTo(2)); - - Query shadowQuery = new Query(GridFsCriteria.whereFilename() - .is("/surveys/sur-the-dataacquisition-project-id-sy1$-1.0.0/attachments/filename.txt")); - GridFSFile shadowFile = gridFsOperations.findOne(shadowQuery); - - assertThat(shadowFile, notNullValue()); - - SurveyAttachmentMetadata metadata = - mongoTemplate.getConverter().read(SurveyAttachmentMetadata.class, shadowFile.getMetadata()); - - assertThat(metadata.getSuccessorId(), nullValue()); -===================================================================== -Found a 10 line (64 tokens) duplication in the following files: -Starting at line 346 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 736 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 756 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 776 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testGenerationDetailsWithExpressionLanguageButWithoutRule() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.getGenerationDetails().setRule(null); -===================================================================== -Found a 10 line (63 tokens) duplication in the following files: -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - List emailAddresses = admins.stream().map(User::getEmail).collect(Collectors.toList()); - return sendEmail(null, emailAddresses.toArray(new String[emailAddresses.size()]), null, null, - subject, content, false, true); - } - - /** - * Send an mail, if an automatic update to dara was not successful. - */ - @Async - public Future sendMailOnDaraAutomaticUpdateError(List admins, String projectId) { -===================================================================== -Found a 13 line (63 tokens) duplication in the following files: -Starting at line 627 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 811 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - mockMvc.perform(delete(API_VARIABLES_URI + "/" + variable.getId())) - .andExpect(status().is2xxSuccessful()); - - // check that the variable has been deleted - mockMvc.perform(get(API_VARIABLES_URI + "/" + variable.getId())) - .andExpect(status().isNotFound()); - - // check that there are no variable search documents anymore - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(0L)); - } - - @Test - public void testUpdateVariable() throws Exception { -===================================================================== -Found a 12 line (63 tokens) duplication in the following files: -Starting at line 50 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java - - public final SetPath originalLanguages = this.createSet("originalLanguages", String.class, StringPath.class, PathInits.DIRECT2); - - // custom - public final QTags tags = new QTags(forProperty("tags")); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("title")); - - //inherited - public final NumberPath version = _super.version; - - public QConcept(String variable) { -===================================================================== -Found a 10 line (62 tokens) duplication in the following files: -Starting at line 64 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptAttachmentVersionsService.java -Starting at line 65 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentVersionsService.java -Starting at line 66 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentVersionsService.java -Starting at line 67 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentVersionsService.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentVersionsService.java - - ConceptAttachmentMetadata metadata = shadow.get(); - if (metadata.getId() == null) { - // deleted shadow - metadata.setLastModifiedBy(shadow.getCommitMetadata().getAuthor()); - metadata.setLastModifiedDate(shadow.getCommitMetadata().getCommitDate()); - } - return metadata; - }).collect(Collectors.toList()); - } -} -===================================================================== -Found a 11 line (62 tokens) duplication in the following files: -Starting at line 357 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 599 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - new InstrumentSearchDocument(instrument, dataPackage, surveys, questions, variables, - dataSets, concepts, release, doi, configuration); - - request.add(new IndexRequest(lockedItem.getDocumentType().name()).id(searchDocument.getId()) - .source(gson.toJson(searchDocument), XContentType.JSON)); - return true; - } - return false; - } - - private boolean addUpsertActionForRelatedPublication(ElasticsearchUpdateQueueItem lockedItem, -===================================================================== -Found a 6 line (62 tokens) duplication in the following files: -Starting at line 420 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 534 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - List questions = - questionRepository.findSubDocumentsByIdIn(questionIds); - Set conceptIds = questions.stream() - .map(question -> question.getConceptIds() != null ? question.getConceptIds() - : new ArrayList()) - .flatMap(List::stream).collect(Collectors.toSet()); -===================================================================== -Found a 10 line (62 tokens) duplication in the following files: -Starting at line 219 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 239 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - conceptAttachmentMetadata.setType(new I18nString("hurz","hurz")); - MockMultipartFile metadata = new MockMultipartFile("conceptAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(conceptAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/concepts/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", - is("concept-management.error.concept-attachment-metadata.type.valid-type"))); -===================================================================== -Found a 9 line (62 tokens) duplication in the following files: -Starting at line 237 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 256 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - dataPackageAttachmentMetadata.setType(new I18nString("hurz", "hurz")); - MockMultipartFile metadata = new MockMultipartFile("dataPackageAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataPackageAttachmentMetadata)); - - mockMvc - .perform(MockMvcRequestBuilders.multipart("/api/data-packages/attachments").file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - is("data-package-management.error.data-package-attachment-metadata.type.valid-type"))); -===================================================================== -Found a 9 line (62 tokens) duplication in the following files: -Starting at line 215 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - instrumentAttachmentMetadata.setType(new I18nString("hurz", "hurz")); - MockMultipartFile metadata = new MockMultipartFile("instrumentAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(instrumentAttachmentMetadata)); - - mockMvc - .perform(MockMvcRequestBuilders.multipart("/api/instruments/attachments").file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - is("instrument-management.error.instrument-attachment-metadata.type.valid-type"))); -===================================================================== -Found a 9 line (62 tokens) duplication in the following files: -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 187 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 246 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 308 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - this.rdcProjectRepository.save(project); - - //Survey - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - this.surveyRepository.save(survey); - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - List listOfSurveyIds = new ArrayList<>(); - listOfSurveyIds.add(survey.getId()); -===================================================================== -Found a 8 line (62 tokens) duplication in the following files: -Starting at line 201 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 212 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java - - project.getRelease().setVersion(version);; - this.mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); - shadowCopyQueueItemService.executeShadowCopyActions(); - // shadow copy thread authenticates itself therefore we need to login again - UnitTestUserManagementUtils.login("admin", "admin"); - } -===================================================================== -Found a 12 line (62 tokens) duplication in the following files: -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 797 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariable() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - - // create the variable with the given id - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) -===================================================================== -Found a 10 line (62 tokens) duplication in the following files: -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 451 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariableWithoutScaleLevel() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.setScaleLevel(null); -===================================================================== -Found a 10 line (62 tokens) duplication in the following files: -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 469 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 486 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 823 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 842 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateDateVariableWithOrdinalScaleLevel() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.setDataType(DataTypes.DATE); -===================================================================== -Found a 21 line (62 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java - - public static final QConceptNestedDocument conceptNestedDocument = new QConceptNestedDocument("conceptNestedDocument"); - - public final QAbstractNestedSubDocument _super; - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - //inherited - public final StringPath createdBy; - - //inherited - public final DateTimePath createdDate; - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate; - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title; -===================================================================== -Found a 8 line (61 tokens) duplication in the following files: -Starting at line 324 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 403 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - log.debug("Sending 'dataset report error' mail"); - Locale locale = Locale.forLanguageTag(onBehalfUser.getLangKey()); - Context context = new Context(locale); - context.setVariable("onBehalfUser", onBehalfUser); - context.setVariable("taskErrorNotification", errorNotification); - context.setVariable("locale", locale); - context.setVariable("baseUrl", baseUrl); - String content = templateEngine.process("datasetReportErrorEmail", context); -===================================================================== -Found a 14 line (61 tokens) duplication in the following files: -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/repository/DaraUpdateQueueItemRepositoryImpl.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java - - private final MongoOperations mongoOperations; - - /* - * (non-Javadoc) - * @see eu.dzhw.fdz.metadatamanagement.projectmanagement.repository - * .DaraUpdateQueueItemRepositoryCustom - * #lockAllUnlockedOrExpiredItems(java.time.LocalDateTime, java.lang.String) - */ - @Override - public void lockAllUnlockedOrExpiredItems(LocalDateTime updateStartedAt, String updateStartedBy) { - Query query = new Query(getUnlockedOrExpiredCriteria()).limit(BULK_SIZE); - Update update = new Update() - .set("updateStartedAt", updateStartedAt).set("updateStartedBy", updateStartedBy); - mongoOperations.updateMulti(query, update, DaraUpdateQueueItem.class); -===================================================================== -Found a 10 line (61 tokens) duplication in the following files: -Starting at line 445 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 481 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 551 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - surveys, instruments, questions, concepts, release, doi, configuration); - - request.add(new IndexRequest(lockedItem.getDocumentType().name()).id(searchDocument.getId()) - .source(gson.toJson(searchDocument), XContentType.JSON)); - return true; - } - return false; - } - - private boolean addUpsertActionForSurvey(ElasticsearchUpdateQueueItem lockedItem, -===================================================================== -Found a 14 line (61 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsFirstQuartileMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsFirstQuartileMustBeAnIsoDateOnDateDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMaximumMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMaximumMustBeAnIsoDateOnDateDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMedianMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMedianMustBeAnIsoDateOnDateDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMinimumMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMinimumMustBeAnIsoDateOnDateDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsThirdQuartileMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsThirdQuartileMustBeAnIsoDateOnDateDataTypeValidator.java - - StatisticsFirstQuartileMustBeANumberOnNumericDataType constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Variable variable, ConstraintValidatorContext context) { - - if (variable == null || variable.getDataType() == null || variable.getDistribution() == null - || variable.getDistribution().getStatistics() == null - || variable.getDistribution().getStatistics().getFirstQuartile() == null -===================================================================== -Found a 26 line (61 tokens) duplication in the following files: -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 55 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - @Autowired - private GridFsOperations gridFsOperations; - - @Autowired - private GridFsMetadataUpdateService gridFsMetadataUpdateService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { - this.dataSetRepository.deleteAll(); -===================================================================== -Found a 10 line (61 tokens) duplication in the following files: -Starting at line 233 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - dataSetAttachmentMetadata.setLanguage("test"); - MockMultipartFile metadata = new MockMultipartFile("dataSetAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataSetAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-sets/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", - is("data-set-management.error.data-set-attachment-metadata.language.not-supported"))); -===================================================================== -Found a 8 line (61 tokens) duplication in the following files: -Starting at line 172 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - public void testUpdateProject() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - project.setVersion(0L); -===================================================================== -Found a 10 line (61 tokens) duplication in the following files: -Starting at line 213 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 233 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - surveyAttachmentMetadata.setLanguage("test"); - MockMultipartFile metadata = new MockMultipartFile("surveyAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(surveyAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/surveys/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", - is("survey-management.error.survey-attachment-metadata.language.not-supported"))); -===================================================================== -Found a 11 line (61 tokens) duplication in the following files: -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QDaraUpdateQueueItem.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/QElasticsearchIndicesVersion.java - - public static final QDaraUpdateQueueItem daraUpdateQueueItem = new QDaraUpdateQueueItem("daraUpdateQueueItem"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath id = createString("id"); -===================================================================== -Found a 16 line (60 tokens) duplication in the following files: -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetManagementService.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableManagementService.java - - ElasticsearchType.data_sets); - - } - - /** - * Enqueue update of dataSet search documents when the concept is changed. - * - * @param concept the updated, created or deleted concept. - */ - @HandleAfterCreate - @HandleAfterSave - @HandleAfterDelete - public void onConceptChanged(Concept concept) { - elasticsearchUpdateQueueService.enqueueUpsertsAsync(() -> { - Set questionIds = questionRepository.streamIdsByConceptIdsContaining(concept.getId()) - .map(question -> question.getId()).collect(Collectors.toSet()); -===================================================================== -Found a 9 line (60 tokens) duplication in the following files: -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataPackageSearchDocument.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/VariableSearchDocument.java - - private List nestedQuestions = new ArrayList<>(); - - private List instruments = new ArrayList<>(); - private List nestedInstruments = new ArrayList<>(); - - private List concepts = new ArrayList<>(); - private List nestedConcepts = new ArrayList<>(); - - private List nestedInstitutions = new ArrayList<>(); -===================================================================== -Found a 7 line (60 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - public void testCreateConcept() throws IOException, Exception { - Concept concept = UnitTestCreateDomainObjectUtils.buildConcept(); - - // create the concept with the given id - mockMvc.perform(put(API_CONCEPT_URI + "/" + concept.getId()) - .content(TestUtil.convertObjectToJsonBytes(concept)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 6 line (60 tokens) duplication in the following files: -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectShadowCopyServiceTest.java -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - Optional successor = - result.stream().filter(s -> s.getId().equals(successorId)).findFirst(); - assertThat(successor.isPresent(), equalTo(true)); - assertThat(successor.get().getSuccessorId(), equalTo(null)); - - Optional predecessor = -===================================================================== -Found a 6 line (60 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 172 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - public void testCreateDataAcquisitionProject() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 9 line (60 tokens) duplication in the following files: -Starting at line 159 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 214 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - - // load the project with the projection - mockMvc - .perform( - get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andExpect(jsonPath("$.id", is(project.getId()))) - .andExpect(jsonPath("$.version", is(0))); -===================================================================== -Found a 7 line (60 tokens) duplication in the following files: -Starting at line 149 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 172 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java - - post(API_DATA_ACQUISITION_PROJECTS_URI + "/" + projectId + "/shadows/1.0.0/hidden")) - .andExpect(status().isAccepted()); - - // check if hiding is in progress - this.mockMvc - .perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + projectId + "/shadows/1.0.0/action")) - .andExpect(status().isOk()).andExpect(jsonPath("$.action", is(Action.HIDE.name()))); -===================================================================== -Found a 11 line (60 tokens) duplication in the following files: -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/service/UserServiceTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/service/UserServiceTest.java - - .minusHours(25); - String resetKey = RandomUtil.generateResetKey(); - user.setActivated(true); - user.setResetDate(daysAgo); - user.setResetKey(resetKey); - - userRepository.save(user); - - Optional maybeUser = userService.completePasswordReset("johndoe2", user.getResetKey()); - - assertThat(maybeUser.isPresent()).isFalse(); -===================================================================== -Found a 10 line (60 tokens) duplication in the following files: -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 216 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 318 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 346 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 451 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 469 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 486 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 504 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 543 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 676 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 696 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 716 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 736 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 756 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 776 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 823 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 842 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariableWithoutScaleLevel() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.setScaleLevel(null); -===================================================================== -Found a 22 line (59 tokens) duplication in the following files: -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - @Autowired - private SurveyRepository surveyRepository; - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); -===================================================================== -Found a 20 line (59 tokens) duplication in the following files: -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); - dataSetRepository.deleteAll(); -===================================================================== -Found a 8 line (59 tokens) duplication in the following files: -Starting at line 237 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 256 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 308 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - dataPackageAttachmentMetadata.setType(new I18nString("hurz", "hurz")); - MockMultipartFile metadata = new MockMultipartFile("dataPackageAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataPackageAttachmentMetadata)); - - mockMvc - .perform(MockMvcRequestBuilders.multipart("/api/data-packages/attachments").file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", -===================================================================== -Found a 9 line (59 tokens) duplication in the following files: -Starting at line 233 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - dataSetAttachmentMetadata.setLanguage("test"); - MockMultipartFile metadata = new MockMultipartFile("dataSetAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataSetAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-sets/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", -===================================================================== -Found a 13 line (59 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - public void testCreateDataSet() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) -===================================================================== -Found a 7 line (59 tokens) duplication in the following files: -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - public void testCreateDataSetAndReadVersions() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), - survey.getNumber()); -===================================================================== -Found a 7 line (59 tokens) duplication in the following files: -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java - - order.getProducts().add(createProduct(order.getId())); - - mockMvc - .perform(put(UPDATE_ORDER_URL + order.getId()).contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(order))) - .andExpect(status().isOk()).andExpect(header().exists("Location")) - .andExpect(jsonPath("$.id", equalTo(order.getId()))) -===================================================================== -Found a 9 line (59 tokens) duplication in the following files: -Starting at line 213 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 233 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 289 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - surveyAttachmentMetadata.setLanguage("test"); - MockMultipartFile metadata = new MockMultipartFile("surveyAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(surveyAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/surveys/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", -===================================================================== -Found a 7 line (59 tokens) duplication in the following files: -Starting at line 337 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 359 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - .andExpect(status().isCreated()); - - // get the survey and check the updated title and version - mockMvc.perform(get(API_SURVEYS_URI + "/" + survey.getId())) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.id", is(survey.getId()))) - .andExpect(jsonPath("$.version", is(0))) -===================================================================== -Found a 10 line (59 tokens) duplication in the following files: -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 608 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariableWithoutScaleLevel() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.setScaleLevel(null); -===================================================================== -Found a 13 line (59 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final NumberPath number = createNumber("number", Integer.class); - - public final ListPath originalLanguages = this.createList("originalLanguages", String.class, StringPath.class, PathInits.DIRECT2); -===================================================================== -Found a 10 line (59 tokens) duplication in the following files: -Starting at line 57 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java - - public final ListPath instruments = this.createList("instruments", InstrumentSubDocument.class, QInstrumentSubDocument.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - //inherited - public final StringPath license = _super.license; -===================================================================== -Found a 10 line (59 tokens) duplication in the following files: -Starting at line 47 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java -Starting at line 55 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java - - public final StringPath masterId = createString("masterId"); - - public final BooleanPath shadow = createBoolean("shadow"); - - public final StringPath successorId = createString("successorId"); - - public final ListPath surveyIds = this.createList("surveyIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final NumberPath version; -===================================================================== -Found a 10 line (59 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.instrumentmanagement.domain.QInstrument _super = new eu.dzhw.fdz.metadatamanagement.instrumentmanagement.domain.QInstrument(this); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.annotations); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - //inherited - public final ListPath conceptIds = _super.conceptIds; -===================================================================== -Found a 10 line (58 tokens) duplication in the following files: -Starting at line 358 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 445 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 552 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 600 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - dataSets, concepts, release, doi, configuration); - - request.add(new IndexRequest(lockedItem.getDocumentType().name()).id(searchDocument.getId()) - .source(gson.toJson(searchDocument), XContentType.JSON)); - return true; - } - return false; - } - - private boolean addUpsertActionForRelatedPublication(ElasticsearchUpdateQueueItem lockedItem, -===================================================================== -Found a 10 line (58 tokens) duplication in the following files: -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - this.javersService.deleteAll(); - this.gridFsOperations.delete(new Query()); - } - - @Test - @WithMockUser(authorities=AuthoritiesConstants.PUBLISHER, username="test") - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 7 line (58 tokens) duplication in the following files: -Starting at line 96 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the dataPackage under the new url - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getId())) - .andExpect(status().isOk()); -===================================================================== -Found a 7 line (58 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - - // read the project under the new url - mockMvc.perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId())) - .andExpect(status().isOk()); -===================================================================== -Found a 6 line (58 tokens) duplication in the following files: -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - public void testCreateProjectAndReadVersions() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - // create the dataPackage with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 7 line (58 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 335 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // read the survey under the new url - mockMvc.perform(get(API_SURVEYS_URI + "/" + survey.getId())) - .andExpect(status().isOk()); -===================================================================== -Found a 8 line (58 tokens) duplication in the following files: -Starting at line 172 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 229 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - .minusDays(1)) - .build()) - .build(); - - // create the survey with the given id but with wrong period - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) -===================================================================== -Found a 7 line (58 tokens) duplication in the following files: -Starting at line 261 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 278 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - + "\"fieldPeriod\":{\"start\":\"2012-12-01\",\"end\":\"2013-04-01\"}}"; - - // create the survey with the given id but without a project - mockMvc.perform(put(API_SURVEYS_URI + "/6").content(survey).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].invalidValue", is("6te"))) - .andExpect(jsonPath("$.errors[0].property", is("sampleSize"))) -===================================================================== -Found a 4 line (58 tokens) duplication in the following files: -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResourceTest.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResourceTest.java - - restUserMockMvc - .perform(get("/api//users/findUserWithRole/").param("login", login).param("role", role) - .contentType(TestUtil.APPLICATION_JSON_UTF8).accept(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andExpect(jsonPath("$.[0].login").value("user")); -===================================================================== -Found a 9 line (58 tokens) duplication in the following files: -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 216 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 318 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 346 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 368 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 397 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 429 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 451 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 469 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 486 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 504 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 543 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 676 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 696 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 716 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 736 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 756 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 776 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 797 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 823 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 842 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariable() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); -===================================================================== -Found a 8 line (58 tokens) duplication in the following files: -Starting at line 562 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 581 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariableWithInvalidId() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var", 1, surveyNumbers); -===================================================================== -Found a 14 line (58 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); -===================================================================== -Found a 14 line (58 tokens) duplication in the following files: -Starting at line 58 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString introduction = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("introduction")); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final StringPath number = createString("number"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString questionText = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("questionText")); -===================================================================== -Found a 12 line (58 tokens) duplication in the following files: -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java - - public final StringPath masterId = createString("masterId"); - - public final BooleanPath shadow = createBoolean("shadow"); - - public final StringPath successorId = createString("successorId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString surveyMethod; - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title; - - //inherited - public final NumberPath version; -===================================================================== -Found a 13 line (58 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString dataType; -===================================================================== -Found a 6 line (57 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 144 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java - - conceptIds.addAll(questionRepository.findSubDocumentsByInstrumentIdIn(instrumentIds).stream() - .map(question -> question.getConceptIds() != null ? question.getConceptIds() - : new ArrayList()) - .flatMap(List::stream).collect(Collectors.toSet())); - return conceptRepository.streamIdsByIdIn(conceptIds); - } -===================================================================== -Found a 7 line (57 tokens) duplication in the following files: -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionShadowCopyDataSource.java - - DataSet copy = crudHelper.read(derivedId).orElseGet(DataSet::new); - BeanUtils.copyProperties(source, copy, "version"); - copy.setId(derivedId); - copy.setDataAcquisitionProjectId( - source.getDataAcquisitionProjectId() + "-" + release.getVersion()); - copy.setDataPackageId(source.getDataPackageId() + "-" + release.getVersion()); - copy.setSurveyIds(createDerivedSurveyIds(source.getSurveyIds(), release.getVersion())); -===================================================================== -Found a 10 line (57 tokens) duplication in the following files: -Starting at line 358 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 482 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 600 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - dataSets, concepts, release, doi, configuration); - - request.add(new IndexRequest(lockedItem.getDocumentType().name()).id(searchDocument.getId()) - .source(gson.toJson(searchDocument), XContentType.JSON)); - return true; - } - return false; - } - - private boolean addUpsertActionForRelatedPublication(ElasticsearchUpdateQueueItem lockedItem, -===================================================================== -Found a 6 line (57 tokens) duplication in the following files: -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 190 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 221 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 10 line (57 tokens) duplication in the following files: -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 160 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - // read the created attachment and check the version - mockMvc - .perform(get( - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect( - jsonPath("$.[0].instrumentId", is(instrumentAttachmentMetadata.getInstrumentId()))) - .andExpect(jsonPath("$.[0].version", is(0))) -===================================================================== -Found a 7 line (57 tokens) duplication in the following files: -Starting at line 67 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java - - order = orderRepository.findAll().get(0); - order.getProducts().add(createProduct(order.getId())); - - mockMvc - .perform(put(UPDATE_ORDER_URL + order.getId()).contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(order))) - .andExpect(status().isOk()).andExpect(header().exists("Location")) -===================================================================== -Found a 9 line (57 tokens) duplication in the following files: -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 188 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildRelatedPublication(null, 2017); - - // ACT - this.mockMvc - .perform(put(API_RELATED_PUBLICATION_URI + "/" + relatedPublication.getId()) - .content(TestUtil.convertObjectToJsonBytes(relatedPublication)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString( -===================================================================== -Found a 10 line (57 tokens) duplication in the following files: -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 216 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 318 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 346 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 469 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 486 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 504 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 543 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 608 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 676 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 696 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 716 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 736 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 756 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 776 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 823 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 842 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariableWithWrongRepeatedMeasurementIdentifier() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.setRepeatedMeasurementIdentifier("WrongIdentifier"); -===================================================================== -Found a 11 line (57 tokens) duplication in the following files: -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java - - public final ListPath dataCurators = this.createList("dataCurators", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); - - //inherited - public final BooleanPath hidden = _super.hidden; - - public final StringPath id = createString("id"); - - public final ListPath institutions = this.createList("institutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); -===================================================================== -Found a 14 line (57 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); -===================================================================== -Found a 9 line (57 tokens) duplication in the following files: -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 29 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath accessWays = this.createList("accessWays", String.class, StringPath.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.annotations); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - public final ListPath concepts = this.createList("concepts", ConceptSubDocument.class, QConceptSubDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 5 line (57 tokens) duplication in the following files: -Starting at line 63 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java - - public final StringPath successorId = createString("successorId"); - - public final ListPath surveyIds = this.createList("surveyIds", String.class, StringPath.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString type; -===================================================================== -Found a 17 line (57 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java - - public static final QQuestionNestedDocument questionNestedDocument = new QQuestionNestedDocument("questionNestedDocument"); - - public final QAbstractNestedSubDocument _super; - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - //inherited - public final StringPath createdBy; - - //inherited - public final DateTimePath createdDate; - - public final StringPath dataPackageId = createString("dataPackageId"); - - public final StringPath id = createString("id"); - - public final StringPath instrumentId = createString("instrumentId"); -===================================================================== -Found a 12 line (56 tokens) duplication in the following files: -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/helper/DataPackageShadowCopyDataSource.java -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/helper/DataAcquisitionProjectShadowCopyDataSource.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionShadowCopyDataSource.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyShadowCopyDataSource.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/helper/VariableShadowCopyDataSource.java - - public Optional findPredecessorOfShadowCopy(DataPackage shadowCopy, - String previousVersion) { - String shadowCopyId = shadowCopy.getMasterId() + "-" + previousVersion; - if (shadowCopy.getId().equals(shadowCopyId)) { - return Optional.empty(); - } else { - return crudHelper.read(shadowCopyId); - } - } - - @Override - public void updatePredecessor(DataPackage predecessor) { -===================================================================== -Found a 13 line (56 tokens) duplication in the following files: -Starting at line 252 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 280 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - String subject = messageSource.getMessage("email.assignee-group-changed.title", - new Object[] {projectId}, locale); - sendEmail(sender, new String[] {user.getEmail()}, null, - currentUser != null ? currentUser.getEmail() : null, subject, content, false, true); - }); - } - - /** - * Send a mail to data providers informing them that they've been removed as the assignee group by - * a publisher. - */ - @Async - public void sendDataProviderAccessRevokedMail(List users, String projectId, String message, -===================================================================== -Found a 8 line (56 tokens) duplication in the following files: -Starting at line 358 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 445 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 482 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 552 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 600 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 645 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - dataSets, concepts, release, doi, configuration); - - request.add(new IndexRequest(lockedItem.getDocumentType().name()).id(searchDocument.getId()) - .source(gson.toJson(searchDocument), XContentType.JSON)); - return true; - } - return false; - } -===================================================================== -Found a 12 line (56 tokens) duplication in the following files: -Starting at line 266 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java - - .buildConceptAttachmentMetadata(concept.getId()); - - MockMultipartFile metadata = new MockMultipartFile("conceptAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(conceptAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/concepts/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); - - // delete the concept by id - mockMvc.perform(delete("/api/concepts/" + concept.getId())) -===================================================================== -Found a 22 line (56 tokens) duplication in the following files: -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - @Autowired - private GridFsOperations gridFsOperations; - - @Autowired - private GridFsMetadataUpdateService gridFsMetadataUpdateService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { - this.dataPackageRepository.deleteAll(); -===================================================================== -Found a 10 line (56 tokens) duplication in the following files: -Starting at line 281 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java - - .buildDataPackageAttachmentMetadata(dataPackage.getDataAcquisitionProjectId()); - - MockMultipartFile metadata = new MockMultipartFile("dataPackageAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataPackageAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-packages/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - // delete the dataPackage by project id - mockMvc.perform(delete("/api/data-packages/" + dataPackage.getId())) -===================================================================== -Found a 22 line (56 tokens) duplication in the following files: -Starting at line 37 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/AvailableDataSetNumbersResourceControllerTest.java -Starting at line 32 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/AvailableSurveyNumbersResourceControllerTest.java - - @Autowired - private SurveyRepository surveyRepo; - - @Autowired - private DataAcquisitionProjectRepository rdcProjectRepository; - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { -===================================================================== -Found a 12 line (56 tokens) duplication in the following files: -Starting at line 281 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java - - .buildDataSetAttachmentMetadata(dataSet.getDataAcquisitionProjectId(), dataSet.getNumber()); - - MockMultipartFile metadata = new MockMultipartFile("dataSetAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataSetAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-sets/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); - - // delete the dataSet with the given id - mockMvc.perform(delete("/api/data-sets/" + dataSet.getId())) -===================================================================== -Found a 5 line (56 tokens) duplication in the following files: -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 144 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 108 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.createdDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.lastModifiedDate", not(isEmptyOrNullString()))) - .andExpect(jsonPath("$.createdBy", is("user"))) -===================================================================== -Found a 14 line (56 tokens) duplication in the following files: -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 248 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - public void testCreateDataSetWithPost() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = - UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(post(API_DATASETS_URI).content(TestUtil.convertObjectToJsonBytes(dataSet)) -===================================================================== -Found a 10 line (56 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 181 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 261 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java - - UnitTestCreateDomainObjectUtils.buildInstrumentAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("instrumentAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(instrumentAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/instruments/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - // read the created attachment and check the version - mockMvc - .perform(get( -===================================================================== -Found a 10 line (56 tokens) duplication in the following files: -Starting at line 386 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 422 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 439 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - rdcProjectRepository.save(project); - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = PUBLISHER_USERNAME) -===================================================================== -Found a 10 line (56 tokens) duplication in the following files: -Starting at line 407 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 456 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - project.getConfiguration().getRequirements().setDataSetsRequired(true); - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.DATA_PROVIDER, username = DATA_PROVIDER_USERNAME) -===================================================================== -Found a 11 line (56 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 174 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java - - .buildSurveyAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("surveyAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(surveyAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/surveys/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); - - // read the created attachment and check the version - mockMvc.perform( -===================================================================== -Found a 5 line (56 tokens) duplication in the following files: -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResourceTest.java -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResourceTest.java - - role = AuthoritiesConstants.ADMIN; - restUserMockMvc - .perform(get("/api//users/findUserWithRole/").param("login", login).param("role", role) - .contentType(TestUtil.APPLICATION_JSON_UTF8).accept(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andExpect(jsonPath("$.[0].login").value("admin")); -===================================================================== -Found a 14 line (56 tokens) duplication in the following files: -Starting at line 31 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java - - public final ListPath conceptIds = this.createList("conceptIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - //inherited - public final BooleanPath hidden = _super.hidden; -===================================================================== -Found a 6 line (56 tokens) duplication in the following files: -Starting at line 29 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 33 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 32 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.annotations); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - //inherited - public final ListPath conceptIds = _super.conceptIds; -===================================================================== -Found a 7 line (55 tokens) duplication in the following files: -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageOverviewService.java -Starting at line 227 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetReportService.java - - private List validateDataPackageOverviewStructure(FileSystem zipFileSystem) { - List missingTexFiles = new ArrayList<>(); - - Path mainFile = zipFileSystem.getPath(zipFileSystem.getPath("/").toString(), KEY_MAIN); - if (!Files.exists(mainFile)) { - missingTexFiles.add(KEY_MAIN); - } -===================================================================== -Found a 6 line (55 tokens) duplication in the following files: -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionShadowCopyDataSource.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyShadowCopyDataSource.java - - DataSet copy = crudHelper.read(derivedId).orElseGet(DataSet::new); - BeanUtils.copyProperties(source, copy, "version"); - copy.setId(derivedId); - copy.setDataAcquisitionProjectId( - source.getDataAcquisitionProjectId() + "-" + release.getVersion()); - copy.setDataPackageId(source.getDataPackageId() + "-" + release.getVersion()); -===================================================================== -Found a 7 line (55 tokens) duplication in the following files: -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataPackageSearchDocument.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/SurveySearchDocument.java - - private List dataSets = new ArrayList<>(); - private List nestedDataSets = new ArrayList<>(); - - private List variables = new ArrayList<>(); - private List nestedVariables = new ArrayList<>(); - - private List relatedPublications = new ArrayList<>(); -===================================================================== -Found a 5 line (55 tokens) duplication in the following files: -Starting at line 329 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 421 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 534 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - questionRepository.findSubDocumentsByInstrumentId(instrument.getId()); - Set conceptIds = questions.stream() - .map(question -> question.getConceptIds() != null ? question.getConceptIds() - : new ArrayList()) - .flatMap(List::stream).collect(Collectors.toSet()); -===================================================================== -Found a 7 line (55 tokens) duplication in the following files: -Starting at line 340 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 578 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - variableRepository.findSubDocumentsByRelatedQuestionsInstrumentId(instrument.getId()); - Set dataSetIds = - variables.stream().map(variable -> variable.getDataSetId()).collect(Collectors.toSet()); - List dataSets = - dataSetRepository.findSubDocumentsByIdIn(dataSetIds); - DataAcquisitionProject project = - projectRepository.findById(instrument.getDataAcquisitionProjectId()).orElse(null); -===================================================================== -Found a 10 line (55 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 212 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - dataPackageAttachmentMetadata.generateId(); - - // read the created attachment and check the version - mockMvc - .perform(get("/api/data-packages/" - + dataPackageAttachmentMetadata.getDataPackageId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect( - jsonPath("$.[0].dataPackageId", is(dataPackageAttachmentMetadata.getDataPackageId()))) - .andExpect(jsonPath("$.[0].version", is(0))) -===================================================================== -Found a 9 line (55 tokens) duplication in the following files: -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 257 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 272 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - dataPackage.setHidden(true); - - // create the hidden dataPackage with the given id - mockMvc - .perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString("invalid-hidden-shadow"))); -===================================================================== -Found a 8 line (55 tokens) duplication in the following files: -Starting at line 205 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 228 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 250 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - instrument.setType("HURZ"); - - // update the instrument with the given id - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect( - jsonPath("$.errors[0].message", is("instrument-management.error.instrument.type.valid"))); -===================================================================== -Found a 6 line (55 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - public void testCreateDataAcquisitionProject() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 7 line (55 tokens) duplication in the following files: -Starting at line 172 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - public void testUpdateProject() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 11 line (55 tokens) duplication in the following files: -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 174 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - survey.setDataType(I18nString.builder().de("Mixed Methods").en("Mixed Methods").build()); - - // create the survey with the given id but with wrong period - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andReturn(); - } - - @Test - public void testCreateSurveyWithNoDataType() throws Exception { -===================================================================== -Found a 9 line (55 tokens) duplication in the following files: -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 368 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 397 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 429 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 608 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 797 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariable() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); -===================================================================== -Found a 9 line (55 tokens) duplication in the following files: -Starting at line 305 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 334 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 355 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 384 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 416 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 886 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.getDistribution().getStatistics().setFirstQuartile("2017-01-30"); - - // create the variable with a survey but without a project - mockMvc - .perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString( -===================================================================== -Found a 14 line (55 tokens) duplication in the following files: -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java - - public final DateTimePath lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final StringPath number = createString("number"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString questionText; - - public final BooleanPath shadow = createBoolean("shadow"); - - public final StringPath successorId = createString("successorId"); - - //inherited - public final NumberPath version; -===================================================================== -Found a 11 line (54 tokens) duplication in the following files: -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 55 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java - - DataPackageAttachmentMetadata metadata) throws IOException { - - if (metadata.isShadow()) { - throw new ShadowCopyCreateNotAllowedException(); - } - - String currentUser = SecurityUtils.getCurrentUserLogin(); - attachmentMetadataHelper.initAttachmentMetadata(metadata, currentUser); - metadata.generateId(); - metadata.setMasterId(metadata.getId()); - String filename = DataPackageAttachmentFilenameBuilder.buildFileName(metadata); -===================================================================== -Found a 8 line (54 tokens) duplication in the following files: -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageListService.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageListService.java - - public Page loadDataPackages(int page, int size) throws IOException { - SearchSourceBuilder sourceBuilder = new SearchSourceBuilder(); - - sourceBuilder.fetchSource(null, - ExcludeFieldsHelper.getFieldsToExcludeOnDeserialization(DataPackageSearchDocument.class)); - sourceBuilder - .query(QueryBuilders.boolQuery().filter(QueryBuilders.termQuery("shadow", true)) - .mustNot(QueryBuilders.existsQuery("successorId"))) -===================================================================== -Found a 19 line (54 tokens) duplication in the following files: -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { - conceptRepository.deleteAll(); -===================================================================== -Found a 4 line (54 tokens) duplication in the following files: -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - .andExpect(jsonPath("$[0].title.de", is(concept.getTitle().getDe()))) - .andExpect(jsonPath("$[0].authors.length()", is(equalTo(concept.getAuthors().size())))) - .andExpect( - jsonPath("$[0].authors[0].firstName", is(concept.getAuthors().get(0).getFirstName()))); -===================================================================== -Found a 19 line (54 tokens) duplication in the following files: -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); -===================================================================== -Found a 4 line (54 tokens) duplication in the following files: -Starting at line 329 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 357 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getId())).andExpect(status().isOk()) - .andExpect(jsonPath("$.id", equalTo(dataPackage.getId()))) - .andExpect(jsonPath("$.masterId", equalTo(dataPackage.getMasterId()))) - .andExpect(jsonPath("$.release.version", equalTo("1.0.0"))) -===================================================================== -Found a 5 line (54 tokens) duplication in the following files: -Starting at line 91 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - .andExpect(jsonPath("$[0].title.de", is(dataPackage.getTitle().getDe()))) - .andExpect(jsonPath("$[0].projectContributors.length()", - is(equalTo(dataPackage.getProjectContributors().size())))) - .andExpect(jsonPath("$[0].projectContributors[0].firstName", - is(dataPackage.getProjectContributors().get(0).getFirstName()))); -===================================================================== -Found a 7 line (54 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 239 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 255 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 284 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 365 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 21 line (54 tokens) duplication in the following files: -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - @Autowired - private InstrumentRepository instrumentRepository; - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { -===================================================================== -Found a 9 line (54 tokens) duplication in the following files: -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 890 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString("global.error.shadow-save-not-allowed"))); - - } - - @Test - @WithMockUser(authorities=AuthoritiesConstants.PUBLISHER) - public void testDeleteInstrumentShadowCopy() throws Exception { -===================================================================== -Found a 5 line (54 tokens) duplication in the following files: -Starting at line 211 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 165 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - DataAcquisitionProject project = dataAcquisitionProjectRepository.findById(projectId).get(); - project.setRelease(null); - this.mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); -===================================================================== -Found a 11 line (54 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 235 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - public void testCreateRelatedPublications() throws IOException, Exception { - // ARRANGE - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - dataPackageRepository.save(dataPackage); - RelatedPublication relatedPublication = - UnitTestCreateDomainObjectUtils.buildRelatedPublication(); - // ACT - // create the related publication with the given id - this.mockMvc.perform(put(API_RELATED_PUBLICATION_URI + "/" + relatedPublication.getId()) -===================================================================== -Found a 14 line (54 tokens) duplication in the following files: -Starting at line 50 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java - - public final ListPath languages = this.createList("languages", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final NumberPath number = createNumber("number", Integer.class); - - //inherited - public final BooleanPath shadow = _super.shadow; -===================================================================== -Found a 4 line (53 tokens) duplication in the following files: -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - .andExpect(jsonPath("$[1].version", is(equalTo(1)))) - .andExpect(jsonPath("$[1].authors.length()", is(equalTo(concept.getAuthors().size())))) - .andExpect( - jsonPath("$[1].authors[0].firstName", is(concept.getAuthors().get(0).getFirstName()))) -===================================================================== -Found a 6 line (53 tokens) duplication in the following files: -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - jsonPath("$.[0].dataPackageId", is(dataPackageAttachmentMetadata.getDataPackageId()))) - .andExpect(jsonPath("$.[0].version", is(0))) - .andExpect(jsonPath("$.[0].createdBy", is("test"))) - .andExpect(jsonPath("$.[0].lastModifiedBy", is("test"))) - .andExpect(jsonPath("$.[0].masterId", - is("/public/files/data-packages/" + "stu-projectid$/attachments/filename.txt"))); -===================================================================== -Found a 15 line (53 tokens) duplication in the following files: -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java - - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).addFilter(legacyUrlsFilter).build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); - dataPackageRepository.deleteAll(); - elasticsearchUpdateQueueItemRepository.deleteAll(); - elasticsearchAdminService.recreateAllIndices(); - javersService.deleteAll(); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testCreateDataPackage() throws IOException, Exception { -===================================================================== -Found a 12 line (53 tokens) duplication in the following files: -Starting at line 159 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 175 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 244 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - .build()); - - // create the project with the given id - mockMvc - .perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage))) - .andExpect(status().is4xxClientError()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testCreateDataPackageWithWrongId() throws IOException, Exception { -===================================================================== -Found a 5 line (53 tokens) duplication in the following files: -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - .andExpect(jsonPath("$[1].version", is(equalTo(1)))) - .andExpect(jsonPath("$[1].projectContributors.length()", - is(equalTo(dataPackage.getProjectContributors().size())))) - .andExpect(jsonPath("$[1].projectContributors[0].firstName", - is(dataPackage.getProjectContributors().get(0).getFirstName()))) -===================================================================== -Found a 8 line (53 tokens) duplication in the following files: -Starting at line 370 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 323 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 808 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - mockMvc.perform(delete("/api/data-acquisition-projects/" + project.getId())) - .andExpect(status().is2xxSuccessful()); - - // check that the DataSet has been deleted - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) -===================================================================== -Found a 8 line (53 tokens) duplication in the following files: -Starting at line 205 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 228 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 250 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 307 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - instrument.setType("HURZ"); - - // update the instrument with the given id - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect( - jsonPath("$.errors[0].message", is("instrument-management.error.instrument.type.valid"))); -===================================================================== -Found a 7 line (53 tokens) duplication in the following files: -Starting at line 334 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 357 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 365 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - Configuration invalidConf = new Configuration(); - project.setConfiguration(invalidConf); - mockMvc - .perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))) - .andExpect(status().isBadRequest()); -===================================================================== -Found a 11 line (53 tokens) duplication in the following files: -Starting at line 267 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 284 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - question.setType(null); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(put(API_QUESTIONS_URI + "/" + question.getId()) - .content(TestUtil.convertObjectToJsonBytes(question)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); - } - - @Test - public void testCreateQuestionWithoutNumber() throws Exception { -===================================================================== -Found a 9 line (53 tokens) duplication in the following files: -Starting at line 112 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 192 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - createResponseRateImageMetadata(); - MockMultipartFile metadata = new MockMultipartFile("surveyResponseRateImageMetadata", FILE_NAME, - "application/json", TestUtil.convertObjectToJsonBytes(surveyResponseRateImageMetadata)); - - // create the image - mockMvc - .perform( - MockMvcRequestBuilders.multipart("/api/surveys/images").file(attachment).file(metadata)) - .andExpect(status().isBadRequest()); -===================================================================== -Found a 10 line (53 tokens) duplication in the following files: -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 477 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 513 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 686 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 746 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.setScaleLevel(null); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isBadRequest()); - } - - @Test - public void testCreateVariableWithWrongRepeatedMeasurementIdentifier() throws Exception { -===================================================================== -Found a 10 line (53 tokens) duplication in the following files: -Starting at line 460 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 495 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 553 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.setScaleLevel(I18nString.builder().de("InvalidValue").en("InvalidValue").build()); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isBadRequest()); - } - - @Test - public void testCreateVariableWithoutDataType() throws Exception { -===================================================================== -Found a 11 line (53 tokens) duplication in the following files: -Starting at line 706 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 766 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.getFilterDetails().setExpressionLanguage("WrongLanguage"); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isBadRequest()); - } - - @Test - public void testFilterExpressionLanguageWithSpelLanguage() throws Exception { -===================================================================== -Found a 13 line (53 tokens) duplication in the following files: -Starting at line 40 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/QRelatedPublication.java -Starting at line 32 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSubDocument.java - - public final StringPath doi = createString("doi"); - - public final StringPath id = createString("id"); - - public final StringPath language = createString("language"); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath publicationAbstract = createString("publicationAbstract"); -===================================================================== -Found a 4 line (53 tokens) duplication in the following files: -Starting at line 120 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public QConceptSearchDocument(Class type, PathMetadata metadata, PathInits inits) { - super(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; -===================================================================== -Found a 15 line (53 tokens) duplication in the following files: -Starting at line 35 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 37 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final BooleanPath shadow = createBoolean("shadow"); - - public final StringPath successorId = createString("successorId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title; -===================================================================== -Found a 6 line (53 tokens) duplication in the following files: -Starting at line 35 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final ListPath concepts = this.createList("concepts", ConceptSubDocument.class, QConceptSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration configuration; - - //inherited - public final StringPath createdBy; -===================================================================== -Found a 6 line (53 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final ListPath questions = this.createList("questions", QuestionSubDocument.class, QQuestionSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QRelease release; - - //inherited - public final BooleanPath shadow; -===================================================================== -Found a 4 line (53 tokens) duplication in the following files: -Starting at line 88 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 84 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java - - public QDataSetSubDocument(Class type, PathMetadata metadata, PathInits inits) { - super(type, metadata, inits); - this.description = inits.isInitialized("description") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")) : null; - this.format = inits.isInitialized("format") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("format")) : null; -===================================================================== -Found a 9 line (53 tokens) duplication in the following files: -Starting at line 85 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); - - //inherited - public final NumberPath number = _super.number; - - //inherited - public final ListPath originalLanguages = _super.originalLanguages; -===================================================================== -Found a 16 line (52 tokens) duplication in the following files: -Starting at line 33 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/domain/validation/I18nStringEntireNotEmpty.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/domain/validation/ValidIsoLanguage.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/validation/ConceptExists.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/validation/DataPackageExists.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/validation/VariableExists.java - - Class[]groups() default {}; - - /** - * This method contains the payload. - */ - Class[]payload() default {}; - - /** - * Defines several {@link I18nStringEntireNotEmpty} annotations on the same element. - * - * @see I18nStringEntireNotEmpty - */ - @Target({ElementType.TYPE, ElementType.TYPE_USE}) - @Retention(RetentionPolicy.RUNTIME) - @Documented - @interface List { -===================================================================== -Found a 6 line (52 tokens) duplication in the following files: -Starting at line 218 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 243 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - users.parallelStream().forEach(user -> { - Locale locale = Locale.forLanguageTag(user.getLangKey()); - Context context = new Context(locale); - context.setVariable("user", user); - context.setVariable("projectId", projectId); - context.setVariable("baseUrl", baseUrl); -===================================================================== -Found a 8 line (52 tokens) duplication in the following files: -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 266 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java - - .buildConceptAttachmentMetadata("con-conceptid$"); - MockMultipartFile metadata = new MockMultipartFile("conceptAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(conceptAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/concepts/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); -===================================================================== -Found a 6 line (52 tokens) duplication in the following files: -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 123 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 281 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectAttachmentsResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildDataPackageAttachmentMetadata("projectid"); - MockMultipartFile metadata = new MockMultipartFile("dataPackageAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataPackageAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-packages/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); -===================================================================== -Found a 25 line (52 tokens) duplication in the following files: -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - -public class DataPackagePublicListResourceControllerTest extends AbstractTest { - private static final String API_DATAPACKAGE_URI = "/api/data-packages"; - - private static final String API_LEGACY_URI = "/api/studies"; - - @Autowired - private WebApplicationContext wac; - - @Autowired - private DataAcquisitionProjectRepository dataAcquisitionProjectRepository; - - @Autowired - private DataPackageRepository dataPackageRepository; - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - @Autowired - private LegacyUrlsFilter legacyUrlsFilter; -===================================================================== -Found a 8 line (52 tokens) duplication in the following files: -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java - - DataPackageAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); - - List files = new ArrayList<>(); - gridFsOperations.find(new Query()).iterator().forEachRemaining(files::add); -===================================================================== -Found a 8 line (52 tokens) duplication in the following files: -Starting at line 95 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 281 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - .buildDataSetAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("dataSetAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataSetAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-sets/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); -===================================================================== -Found a 6 line (52 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 181 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 261 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectAttachmentsResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildInstrumentAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("instrumentAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(instrumentAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/instruments/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); -===================================================================== -Found a 9 line (52 tokens) duplication in the following files: -Starting at line 205 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 220 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - public void testDeleteAllResponseRateImagesOfSurvey() throws Exception { - SurveyResponseRateImageMetadata metadata = createResponseRateImageMetadata(); - createTestFileForSurveyRateImage(metadata); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(PROJECT_ID); - survey.setId(survey.getId() + "-1.0.0"); - surveyRepository.save(survey); - - mockMvc.perform(delete("/api/surveys/" + SURVEY_ID + "-1.0.0/images")) -===================================================================== -Found a 13 line (52 tokens) duplication in the following files: -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/service/UserServiceTest.java -Starting at line 102 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/service/UserServiceTest.java - - user.setResetKey(resetKey); - - userRepository.save(user); - - Optional maybeUser = userService.completePasswordReset("johndoe2", user.getResetKey()); - - assertThat(maybeUser.isPresent()).isFalse(); - - userRepository.deleteById(user.getId()); - } - - @Test - public void assertThatResetKeyMustBeValid() { -===================================================================== -Found a 9 line (52 tokens) duplication in the following files: -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 216 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 318 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 346 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 368 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 397 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 429 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 451 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 469 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 486 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 504 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 543 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 562 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 581 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 639 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 676 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 696 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 716 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 736 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 756 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 776 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 797 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 823 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 842 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariable() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); -===================================================================== -Found a 9 line (52 tokens) duplication in the following files: -Starting at line 619 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 805 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .en(ScaleLevels.ORDINAL.getEn()).build()); - - // create the variable with the given id - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // delete the variable - mockMvc.perform(delete(API_VARIABLES_URI + "/" + variable.getId())) -===================================================================== -Found a 4 line (52 tokens) duplication in the following files: -Starting at line 61 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 125 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java - - public final ListPath sponsors = this.createList("sponsors", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString studySeries = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("studySeries")); -===================================================================== -Found a 18 line (51 tokens) duplication in the following files: -Starting at line 181 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 192 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java - - mongoTemplate.getConverter().read(DataPackageAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } - String currentUser = SecurityUtils.getCurrentUserLogin(); - this.operations.delete(fileQuery); - javers.commitShallowDelete(currentUser, metadata); - } - - /** - * Attach the given file as data package overview to the data package. - * - * @param language The language of the report. - * @param dataPackageId The id of a {@link DataPackage}. - * @param overviewFile The pdf file. - * @throws IOException Thrown if the multipart file cannot be read. - */ - public void attachDataPackageOverview(String dataPackageId, String language, -===================================================================== -Found a 12 line (51 tokens) duplication in the following files: -Starting at line 97 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/helper/DataPackageShadowCopyDataSource.java -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionShadowCopyDataSource.java -Starting at line 97 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyShadowCopyDataSource.java -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/helper/VariableShadowCopyDataSource.java - - }, ElasticsearchType.data_packages); - } - } - - @Override - public void hideExistingShadowCopies(String projectId, String version) { - setHiddenState(projectId, version, true); - } - - private void setHiddenState(String projectId, String version, boolean hidden) { - String shadowId = projectId + "-" + version; - try (Stream dataPackages = -===================================================================== -Found a 6 line (51 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - log.debug("Sending activation e-mail to '{}'", user.getEmail()); - Locale locale = Locale.forLanguageTag(user.getLangKey()); - Context context = new Context(locale); - context.setVariable("user", user); - context.setVariable("baseUrl", baseUrl); - String content = templateEngine.process("activationEmail", context); -===================================================================== -Found a 17 line (51 tokens) duplication in the following files: -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DeleteAllDataPackagesResourceControllerTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DeleteAllDateSetsResourceControllerTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/DeleteAllInstrumentsResourceControllerTest.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/DeleteAllQuestionsResourceControllerTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/DeleteAllSurveysResourceControllerTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/DeleteAllVariablesResourceControllerTest.java - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); -===================================================================== -Found a 19 line (51 tokens) duplication in the following files: -Starting at line 40 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/AvailableDataSetNumbersResourceControllerTest.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/AvailableInstrumentNumbersResourceControllerTest.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/AvailableSurveyNumbersResourceControllerTest.java - - @Autowired - private DataAcquisitionProjectRepository rdcProjectRepository; - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { -===================================================================== -Found a 20 line (51 tokens) duplication in the following files: -Starting at line 65 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - @Autowired - private ElasticsearchUpdateQueueService elasticsearchUpdateQueueService; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { - this.dataAcquisitionProjectRepository.deleteAll(); -===================================================================== -Found a 12 line (51 tokens) duplication in the following files: -Starting at line 165 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(null, survey.getId(), 1); - - - // Act and Assert - // create the DataSet with a survey but without a project - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); - } - - @Test - public void testCreateDataSetWithWrongFormat() throws Exception { -===================================================================== -Found a 8 line (51 tokens) duplication in the following files: -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 194 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - public void testCreateDataSetWithWrongFormat() throws Exception { - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(null, survey.getId(), 1); -===================================================================== -Found a 4 line (51 tokens) duplication in the following files: -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - project.setVersion(0L); -===================================================================== -Found a 5 line (51 tokens) duplication in the following files: -Starting at line 67 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectVersionsServiceTest.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectVersionsServiceTest.java - - project.setRelease(Release.builder().version("0.1.0").lastDate(LocalDateTime.now()).build()); - project = projectManagementService.save(project); - - previousRelease = versionsService.findPreviousRelease(project.getId(), project.getRelease()); - assertThat(previousRelease.getVersion(), equalTo("0.0.1")); -===================================================================== -Found a 10 line (51 tokens) duplication in the following files: -Starting at line 267 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 284 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 301 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - question.setType(null); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(put(API_QUESTIONS_URI + "/" + question.getId()) - .content(TestUtil.convertObjectToJsonBytes(question)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); - } - - @Test -===================================================================== -Found a 6 line (51 tokens) duplication in the following files: -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 190 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - survey.setDataType(I18nString.builder().de("Mixed Methods").en("Mixed Methods").build()); - - // create the survey with the given id but with wrong period - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) -===================================================================== -Found a 10 line (51 tokens) duplication in the following files: -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 212 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 231 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - .build()); - - // create the survey with the given id but with an unlimited period - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); - } - - @Test - public void testCreateSurveyWithInvalidProject() throws Exception { -===================================================================== -Found a 4 line (51 tokens) duplication in the following files: -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResourceTest.java -Starting at line 171 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResourceTest.java - - restUserMockMvc - .perform(get("/api//users/findUserWithRole/").param("login", login).param("role", role) - .contentType(TestUtil.APPLICATION_JSON_UTF8).accept(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()).andExpect(jsonPath("$.[0].login").value("user")); -===================================================================== -Found a 10 line (51 tokens) duplication in the following files: -Starting at line 171 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 207 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 225 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 460 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 477 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 495 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 513 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 534 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 553 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 571 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 686 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 706 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 746 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 766 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildVariable(null, 1, "var1", 1, surveyNumbers); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isBadRequest()); - } - - @Test - public void testCreateVariableWithoutScaleLevel() throws Exception { -===================================================================== -Found a 10 line (51 tokens) duplication in the following files: -Starting at line 251 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 726 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.getDistribution().getStatistics().setFirstQuartile("2017-01-30"); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - } - - @Test - public void testCreateDateVariableWithNominalScaleLevel() throws Exception { -===================================================================== -Found a 9 line (51 tokens) duplication in the following files: -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final QTags tags = new QTags(forProperty("tags")); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("title")); - - //inherited - public final NumberPath version = _super.version; - - public QConcept(String variable) { -===================================================================== -Found a 14 line (51 tokens) duplication in the following files: -Starting at line 50 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final ListPath languages = this.createList("languages", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final NumberPath number = createNumber("number", Integer.class); - - //inherited - public final BooleanPath shadow = _super.shadow; -===================================================================== -Found a 3 line (51 tokens) duplication in the following files: -Starting at line 63 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QAbstractNestedSubDocument.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public QAbstractNestedSubDocument(Class type, PathMetadata metadata, PathInits inits) { - super(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; -===================================================================== -Found a 6 line (51 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 102 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath questions = this.createList("questions", QuestionSubDocument.class, QQuestionSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QRelease release; - - //inherited - public final BooleanPath shadow; -===================================================================== -Found a 10 line (50 tokens) duplication in the following files: -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 55 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageService.java - - DataPackageAttachmentMetadata metadata) throws IOException { - - if (metadata.isShadow()) { - throw new ShadowCopyCreateNotAllowedException(); - } - - String currentUser = SecurityUtils.getCurrentUserLogin(); - attachmentMetadataHelper.initAttachmentMetadata(metadata, currentUser); - metadata.generateId(); - metadata.setMasterId(metadata.getId()); -===================================================================== -Found a 8 line (50 tokens) duplication in the following files: -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageOverviewService.java -Starting at line 175 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetReportService.java - - String mainFilledStr = - this.fillTemplate(texMainFileStr, templateConfiguration, dataForTemplate, KEY_MAIN); - ZipUtil.writeFileToZip(pathToMainTexFile, mainFilledStr); - } catch (TemplateException e) { - log.debug("fill template fails", e); - task = taskService.handleErrorTask(task, e); - return; - } -===================================================================== -Found a 6 line (50 tokens) duplication in the following files: -Starting at line 214 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 228 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java - - case "de": - metadata = DataSetAttachmentMetadata.builder().dataSetId(dataSetId) - .dataAcquisitionProjectId(dataSet.getDataAcquisitionProjectId()) - .dataSetNumber(dataSet.getNumber()) - .fileName("dsreport-" + dataSet.getDataAcquisitionProjectId() + "-ds" - + dataSet.getNumber() + ".pdf") -===================================================================== -Found a 9 line (50 tokens) duplication in the following files: -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java - - mongoTemplate.getConverter().read(InstrumentAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } - String currentUser = SecurityUtils.getCurrentUserLogin(); - this.operations.delete(fileQuery); - javers.commitShallowDelete(currentUser, metadata); - } -} -===================================================================== -Found a 10 line (50 tokens) duplication in the following files: -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 358 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 392 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 445 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 552 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 600 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - questions, instruments, surveys, dataSets, variables); - - request.add(new IndexRequest(lockedItem.getDocumentType().name()).id(searchDocument.getId()) - .source(gson.toJson(searchDocument), XContentType.JSON)); - return true; - } - return false; - } - - private boolean addUpsertActionForInstrument(ElasticsearchUpdateQueueItem lockedItem, -===================================================================== -Found a 11 line (50 tokens) duplication in the following files: -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyAttachmentShadowCopyDataSource.java -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyResponseRateImageShadowCopyDataSource.java - - BeanUtils.copyProperties(source, copy, "version"); - } - - copy.setDataAcquisitionProjectId( - source.getDataAcquisitionProjectId() + "-" + release.getVersion()); - copy.setSurveyId(source.getSurveyId() + "-" + release.getVersion()); - copy.generateId(); - return copy; - } - - private String deriveId(SurveyAttachmentMetadata source, String version) { -===================================================================== -Found a 9 line (50 tokens) duplication in the following files: -Starting at line 239 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 266 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - conceptAttachmentMetadata.setDescription(new I18nString()); - - MockMultipartFile metadata = new MockMultipartFile("conceptAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(conceptAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/concepts/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()) -===================================================================== -Found a 9 line (50 tokens) duplication in the following files: -Starting at line 256 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 281 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - dataPackageAttachmentMetadata.setDescription(new I18nString()); - - MockMultipartFile metadata = new MockMultipartFile("dataPackageAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataPackageAttachmentMetadata)); - - mockMvc - .perform(MockMvcRequestBuilders.multipart("/api/data-packages/attachments").file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", is( -===================================================================== -Found a 9 line (50 tokens) duplication in the following files: -Starting at line 313 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 315 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 293 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - .perform(MockMvcRequestBuilders.multipart("/api/data-packages/attachments").file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-create-not-allowed"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testUpdateAttachmentOfShadowCopyDataPackage() throws Exception { -===================================================================== -Found a 8 line (50 tokens) duplication in the following files: -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - mongoTemplate.getConverter().read(DataPackageAttachmentMetadata.class, shadowFile.getMetadata()); - - assertThat(metadata.getSuccessorId(), nullValue()); - assertThat(shadowFile.getMetadata().get("_contentType"), equalTo("text/plain")); - } - - @Test - public void createShadowCopyLinkPredecessorToSuccessor() throws Exception { -===================================================================== -Found a 9 line (50 tokens) duplication in the following files: -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 187 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 183 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - DataPackageAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - release.setVersion("1.0.1"); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); - - Query shadowQuery = new Query(GridFsCriteria.whereFilename() - .is("/data-packages/stu-" + PROJECT_ID + "$-1.0.0/attachments/filename.txt")); -===================================================================== -Found a 9 line (50 tokens) duplication in the following files: -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 281 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - dataSetAttachmentMetadata.setDescription(new I18nString()); - - MockMultipartFile metadata = new MockMultipartFile("dataSetAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataSetAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-sets/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()) -===================================================================== -Found a 7 line (50 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 165 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 239 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 255 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 284 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 365 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 9 line (50 tokens) duplication in the following files: -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 261 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - instrumentAttachmentMetadata.setDescription(new I18nString()); - - MockMultipartFile metadata = new MockMultipartFile("instrumentAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(instrumentAttachmentMetadata)); - - mockMvc - .perform(MockMvcRequestBuilders.multipart("/api/instruments/attachments").file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", is( -===================================================================== -Found a 8 line (50 tokens) duplication in the following files: -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - - // read the project under the new url - mockMvc.perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId())) -===================================================================== -Found a 8 line (50 tokens) duplication in the following files: -Starting at line 420 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 481 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - project.setLastAssigneeGroupMessage("test"); - - project = rdcProjectRepository.save(project); - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); -===================================================================== -Found a 9 line (50 tokens) duplication in the following files: -Starting at line 233 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - surveyAttachmentMetadata.setDescription(new I18nString()); - - MockMultipartFile metadata = new MockMultipartFile("surveyAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(surveyAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/surveys/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()) -===================================================================== -Found a 7 line (50 tokens) duplication in the following files: -Starting at line 166 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 223 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - .dataAcquisitionProjectId(project.getId()) - .title(I18nString.builder().de("titel") - .en("title") - .build()) - .fieldPeriod(Period.builder().start(LocalDate.now()) - .end(LocalDate.now() - .minusDays(1)) -===================================================================== -Found a 9 line (50 tokens) duplication in the following files: -Starting at line 294 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 320 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 333 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - // create the survey with the given id - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // delete the survey - mockMvc.perform(delete(API_SURVEYS_URI + "/" + survey.getId())) -===================================================================== -Found a 6 line (50 tokens) duplication in the following files: -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 171 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 805 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - - // create the variable with the given id - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 6 line (50 tokens) duplication in the following files: -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 589 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 646 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 805 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - - // create the variable with the given id - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 6 line (50 tokens) duplication in the following files: -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public static final QDataPackage dataPackage = new QDataPackage("dataPackage"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); -===================================================================== -Found a 9 line (50 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java - - public final ListPath> surveyNumbers = this.>createList("surveyNumbers", Integer.class, NumberPath.class, PathInits.DIRECT2); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString type = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("type")); - - //inherited - public final NumberPath version = _super.version; - - public QDataSet(String variable) { -===================================================================== -Found a 15 line (49 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptAttachmentService.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java - - result.add(mongoTemplate.getConverter().read(ConceptAttachmentMetadata.class, - gridfsFile.getMetadata())); - }); - return result; - } - - - - /** - * Delete all attachments of all {@link Concept}s. - */ - public void deleteAll() { - String currentUser = SecurityUtils.getCurrentUserLogin(); - Query query = new Query(GridFsCriteria.whereFilename() - .regex("^" + Pattern.quote("/concepts/") + ".*" + Pattern.quote("/attachments/"))); -===================================================================== -Found a 8 line (49 tokens) duplication in the following files: -Starting at line 181 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 192 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java - - mongoTemplate.getConverter().read(DataPackageAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } - String currentUser = SecurityUtils.getCurrentUserLogin(); - this.operations.delete(fileQuery); - javers.commitShallowDelete(currentUser, metadata); - } -===================================================================== -Found a 10 line (49 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/helper/DataPackageShadowCopyDataSource.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 108 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/helper/DataAcquisitionProjectShadowCopyDataSource.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionShadowCopyDataSource.java -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyShadowCopyDataSource.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/helper/VariableShadowCopyDataSource.java - - } - - @Override - public void hideExistingShadowCopies(String projectId, String version) { - setHiddenState(projectId, version, true); - } - - private void setHiddenState(String projectId, String version, boolean hidden) { - String shadowId = projectId + "-" + version; - try (Stream dataPackages = -===================================================================== -Found a 6 line (49 tokens) duplication in the following files: -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetManagementService.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentManagementService.java -Starting at line 218 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyManagementService.java - - .max((dataSet1, dataSet2) -> Integer.compare(dataSet1.getNumber(), dataSet2.getNumber())); - if (!max.isPresent()) { - result.add(1); - } else { - for (int i = 1; i < max.get().getNumber(); i++) { - if (!dataSetNumberExists(existingNumbers, i)) { -===================================================================== -Found a 10 line (49 tokens) duplication in the following files: -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 392 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 482 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - questions, instruments, surveys, dataSets, variables); - - request.add(new IndexRequest(lockedItem.getDocumentType().name()).id(searchDocument.getId()) - .source(gson.toJson(searchDocument), XContentType.JSON)); - return true; - } - return false; - } - - private boolean addUpsertActionForInstrument(ElasticsearchUpdateQueueItem lockedItem, -===================================================================== -Found a 5 line (49 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .andExpect(jsonPath("$.[0].conceptId", is(conceptAttachmentMetadata.getConceptId()))) - .andExpect(jsonPath("$.[0].version", is(0))) - .andExpect(jsonPath("$.[0].createdBy", is("test"))) - .andExpect(jsonPath("$.[0].lastModifiedBy", is("test"))) - .andExpect(jsonPath("$.[0].id", is("/public/files/concepts/" -===================================================================== -Found a 8 line (49 tokens) duplication in the following files: -Starting at line 219 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 266 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - conceptAttachmentMetadata.setType(new I18nString("hurz","hurz")); - MockMultipartFile metadata = new MockMultipartFile("conceptAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(conceptAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/concepts/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()) -===================================================================== -Found a 7 line (49 tokens) duplication in the following files: -Starting at line 91 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java - - + conceptAttachmentMetadata.getFileName() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(2))); - } - - @Test - public void testVersionsNotFound() throws Exception { - mockMvc.perform(get("/api/concepts/spaß/attachments/file/versions")) -===================================================================== -Found a 18 line (49 tokens) duplication in the following files: -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { -===================================================================== -Found a 5 line (49 tokens) duplication in the following files: -Starting at line 220 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - jsonPath("$.[0].dataPackageId", is(dataPackageAttachmentMetadata.getDataPackageId()))) - .andExpect(jsonPath("$.[0].version", is(1))) - .andExpect(jsonPath("$.[0].createdBy", is("test"))) - .andExpect(jsonPath("$.[0].lastModifiedBy", is("test"))) - .andExpect(jsonPath("$.[0].masterId", -===================================================================== -Found a 8 line (49 tokens) duplication in the following files: -Starting at line 237 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 281 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - dataPackageAttachmentMetadata.setType(new I18nString("hurz", "hurz")); - MockMultipartFile metadata = new MockMultipartFile("dataPackageAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataPackageAttachmentMetadata)); - - mockMvc - .perform(MockMvcRequestBuilders.multipart("/api/data-packages/attachments").file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", -===================================================================== -Found a 9 line (49 tokens) duplication in the following files: -Starting at line 358 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 337 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - mockMvc.perform(delete("/api/data-packages/" + dataPackageId + "/attachments")) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-delete-not-allowed"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testDeleteAttachmentOfShadowCopyDataPackage() throws Exception { - String dataPackageId = "ins-issue1991-1.0.0"; -===================================================================== -Found a 19 line (49 tokens) duplication in the following files: -Starting at line 65 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - @Autowired - private ElasticsearchUpdateQueueService elasticsearchUpdateQueueService; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { -===================================================================== -Found a 9 line (49 tokens) duplication in the following files: -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 357 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - public void testCreateDataSetWithSurveyButWithoutProject() throws Exception { - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - this.surveyRepository.save(survey); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(null, survey.getId(), 1); -===================================================================== -Found a 7 line (49 tokens) duplication in the following files: -Starting at line 166 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java - - DataSet shadow = new DataSet(master); - shadow.setId(master.getId() + "-" + version); - shadow.setDataPackageId(master.getDataPackageId() + "-" + version); - shadow.setDataAcquisitionProjectId(master.getDataAcquisitionProjectId() + "-" + version); - return shadow; - } -} -===================================================================== -Found a 8 line (49 tokens) duplication in the following files: -Starting at line 215 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 261 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - instrumentAttachmentMetadata.setType(new I18nString("hurz", "hurz")); - MockMultipartFile metadata = new MockMultipartFile("instrumentAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(instrumentAttachmentMetadata)); - - mockMvc - .perform(MockMvcRequestBuilders.multipart("/api/instruments/attachments").file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", -===================================================================== -Found a 15 line (49 tokens) duplication in the following files: -Starting at line 54 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); - surveyRepository.deleteAll(); -===================================================================== -Found a 9 line (49 tokens) duplication in the following files: -Starting at line 251 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 726 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 786 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.getDistribution().getStatistics().setFirstQuartile("2017-01-30"); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - } - - @Test -===================================================================== -Found a 8 line (49 tokens) duplication in the following files: -Starting at line 562 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 581 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 608 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 639 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariableWithInvalidId() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var", 1, surveyNumbers); -===================================================================== -Found a 5 line (49 tokens) duplication in the following files: -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final ListPath accessWays = this.createList("accessWays", String.class, StringPath.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.annotations); -===================================================================== -Found a 7 line (49 tokens) duplication in the following files: -Starting at line 116 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final ListPath> surveyNumbers; - - public final ListPath surveys = this.createList("surveys", SurveySubDocument.class, QSurveySubDocument.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString type; -===================================================================== -Found a 9 line (48 tokens) duplication in the following files: -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/MarkdownHelper.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/AccessWays.java - - public TemplateMethodModelEx createRemoveMarkdownMethod() { - return new TemplateMethodModelEx() { - @SuppressWarnings("rawtypes") - @Override - public TemplateModel exec(List arguments) throws TemplateModelException { - if (arguments.size() != 1) { - throw new TemplateModelException("Wrong arguments"); - } - return new SimpleScalar(getPlainText(((SimpleScalar) arguments.get(0)).getAsString())); -===================================================================== -Found a 4 line (48 tokens) duplication in the following files: -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 494 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - conceptIds.addAll(instruments.stream() - .map(instrument -> instrument.getConceptIds() != null ? instrument.getConceptIds() - : new ArrayList()) - .flatMap(List::stream).collect(Collectors.toSet())); -===================================================================== -Found a 4 line (48 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 498 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - conceptIds.addAll(questionRepository.findSubDocumentsByInstrumentIdIn(instrumentIds).stream() - .map(question -> question.getConceptIds() != null ? question.getConceptIds() - : new ArrayList()) - .flatMap(List::stream).collect(Collectors.toSet())); -===================================================================== -Found a 11 line (48 tokens) duplication in the following files: -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/repository/DataPackageRepository.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/repository/DataSetRepository.java - - Stream streamByDataAcquisitionProjectIdAndShadowIsTrue(String oldProjectId); - - @RestResource(exported = false) - Stream streamIdsByMasterIdInAndShadowIsTrueAndSuccessorIdIsNull( - Collection dataSetIds); - - @RestResource(exported = false) - Stream streamIdsByMasterIdIn(Collection dataSetIds); - - @RestResource(exported = false) - Stream findByDataAcquisitionProjectIdAndShadowIsTrue( -===================================================================== -Found a 7 line (48 tokens) duplication in the following files: -Starting at line 35 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/helper/DataPackageAttachmentShadowCopyDataSource.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetAttachmentShadowCopyDataSource.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentAttachmentShadowCopyDataSource.java -Starting at line 37 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionImageShadowCopyDataSource.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyAttachmentShadowCopyDataSource.java -Starting at line 37 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyResponseRateImageShadowCopyDataSource.java - - public DataPackageAttachmentMetadata createShadowCopy(DataPackageAttachmentMetadata source, - Release release) { - - String derivedId = deriveId(source, release.getVersion()); - - Query query = new Query(GridFsCriteria.whereMetaData("_id").is(derivedId)); - GridFSFile gridFsFile = this.gridFsOperations.findOne(query); -===================================================================== -Found a 3 line (48 tokens) duplication in the following files: -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/helper/VariableShadowCopyDataSource.java - - source.getDataAcquisitionProjectId() + "-" + release.getVersion()); - copy.setDataPackageId(source.getDataPackageId() + "-" + release.getVersion()); - copy.setSurveyIds(createDerivedSurveyIds(source.getSurveyIds(), release.getVersion())); -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 38 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java - - Query query = new Query(getUnlockedOrExpiredCriteria()).limit(BULK_SIZE); - Update update = new Update() - .set("updateStartedAt", updateStartedAt).set("updateStartedBy", updateStartedBy); - mongoOperations.updateMulti(query, update, ElasticsearchUpdateQueueItem.class); - } - - @Override - public List findOldestLockedItems(String updateStartedBy, -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 392 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 645 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - questions, instruments, surveys, dataSets, variables); - - request.add(new IndexRequest(lockedItem.getDocumentType().name()).id(searchDocument.getId()) - .source(gson.toJson(searchDocument), XContentType.JSON)); - return true; - } - return false; - } -===================================================================== -Found a 4 line (48 tokens) duplication in the following files: -Starting at line 330 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 422 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 498 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 535 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - Set conceptIds = questions.stream() - .map(question -> question.getConceptIds() != null ? question.getConceptIds() - : new ArrayList()) - .flatMap(List::stream).collect(Collectors.toSet()); -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 219 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 239 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java - - .buildConceptAttachmentMetadata("con-conceptid$"); - MockMultipartFile metadata = new MockMultipartFile("conceptAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(conceptAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/concepts/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); -===================================================================== -Found a 7 line (48 tokens) duplication in the following files: -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void testDeleteAllAttachments() throws Exception { -===================================================================== -Found a 7 line (48 tokens) duplication in the following files: -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void updateAttachmentMetadata() throws Exception { -===================================================================== -Found a 7 line (48 tokens) duplication in the following files: -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java - - .file(metadata)).andExpect(status().isCreated()); - - // assert that there is one initial version - mockMvc - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments/" - + conceptAttachmentMetadata.getFileName() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 6 line (48 tokens) duplication in the following files: -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 123 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 237 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 256 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 281 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 308 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectAttachmentsResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildDataPackageAttachmentMetadata("projectid"); - MockMultipartFile metadata = new MockMultipartFile("dataPackageAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataPackageAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-packages/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 205 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java - - current.setType(DataPackageAttachmentTypes.OTHER); - - // update the metadata - mockMvc.perform(put("/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() - + "/attachments/" + attachment.getOriginalFilename()) - .content(TestUtil.convertObjectToJsonBytes(current)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().is2xxSuccessful()); -===================================================================== -Found a 9 line (48 tokens) duplication in the following files: -Starting at line 337 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 261 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 276 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 338 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 336 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 359 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 316 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 398 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 890 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(metadata)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-save-not-allowed"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testDeleteAllAttachmentsOfShadowCopyDataPackage() throws Exception { -===================================================================== -Found a 7 line (48 tokens) duplication in the following files: -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java - - .file(metadata)).andExpect(status().isCreated()); - - // assert that there is one initial version - mockMvc - .perform(get("/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() - + "/attachments/" + dataPackageAttachmentMetadata.getFileName() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 95 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 233 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 281 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java - - .buildDataSetAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("dataSetAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(dataSetAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/data-sets/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); -===================================================================== -Found a 7 line (48 tokens) duplication in the following files: -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java - - .file(metadata)).andExpect(status().isCreated()); - - // assert that there is one initial version - mockMvc - .perform(get("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments/" - + dataSetAttachmentMetadata.getFileName() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 9 line (48 tokens) duplication in the following files: -Starting at line 321 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 296 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 345 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 384 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 874 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(dataSet)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString("global.error.shadow-create-not-allowed"))); - } - - @Test - @WithMockUser(authorities=AuthoritiesConstants.PUBLISHER) - public void testUpdateShadowCopyDataSet() throws Exception { -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java - - public void createShadowCopyWithSameReleaseVersion() throws Exception { - DataSetAttachmentMetadata master = - UnitTestCreateDomainObjectUtils.buildDataSetAttachmentMetadata(PROJECT_ID, 1); - master.generateId(); - master.setMasterId(master.getId()); - createTestFileForAttachment(master); - DataSetAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); -===================================================================== -Found a 6 line (48 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 181 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 215 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectAttachmentsResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildInstrumentAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("instrumentAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(instrumentAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/instruments/attachments") - .file(attachment).file(metadata)).andExpect(status().isCreated()); -===================================================================== -Found a 7 line (48 tokens) duplication in the following files: -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java - - .file(metadata)).andExpect(status().isCreated()); - - // assert that there is one initial version - mockMvc - .perform(get("/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() - + "/attachments/" + instrumentAttachmentMetadata.getFileName() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java - - public void createShadowCopyWithSameReleaseVersion() throws Exception { - InstrumentAttachmentMetadata master = - UnitTestCreateDomainObjectUtils.buildInstrumentAttachmentMetadata(PROJECT_ID, 1); - master.generateId(); - master.setMasterId(master.getId()); - createTestFileForAttachment(master); - InstrumentAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); -===================================================================== -Found a 7 line (48 tokens) duplication in the following files: -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 201 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - project.setVersion(0L); -===================================================================== -Found a 7 line (48 tokens) duplication in the following files: -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - project.setHasBeenReleasedBefore(true); - - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (48 tokens) duplication in the following files: -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - - this.mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 4 line (48 tokens) duplication in the following files: -Starting at line 201 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 212 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - project.getRelease().setVersion(version);; - this.mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 123 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java - - UnitTestCreateDomainObjectUtils.buildQuestionImageMetadata("projectid", "questionid"); - MockMultipartFile metadata = new MockMultipartFile("questionImageMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(questionImageMetadata)); - - mockMvc - .perform(MockMvcRequestBuilders.multipart("/api/questions/images").file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java - - public void createShadowCopyWithSameReleaseVersion() throws Exception { - QuestionImageMetadata master = - UnitTestCreateDomainObjectUtils.buildQuestionImageMetadata(PROJECT_ID, QUESTION_ID); - master.generateId(); - master.setMasterId(master.getId()); - createTestFileForAttachment(master); - QuestionImageMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 235 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 264 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - public void testCreateRelatedPublications() throws IOException, Exception { - // ARRANGE - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - dataPackageRepository.save(dataPackage); - RelatedPublication relatedPublication = - UnitTestCreateDomainObjectUtils.buildRelatedPublication(); -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 188 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 282 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildRelatedPublication(null, 2017); - - // ACT - this.mockMvc - .perform(put(API_RELATED_PUBLICATION_URI + "/" + relatedPublication.getId()) - .content(TestUtil.convertObjectToJsonBytes(relatedPublication)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 174 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 213 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 233 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 289 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java - - .buildSurveyAttachmentMetadata("projectid", 1); - MockMultipartFile metadata = new MockMultipartFile("surveyAttachmentMetadata", "Blob", - "application/json", TestUtil.convertObjectToJsonBytes(surveyAttachmentMetadata)); - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/surveys/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isCreated()); -===================================================================== -Found a 7 line (48 tokens) duplication in the following files: -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java - - .file(metadata)).andExpect(status().isCreated()); - - // assert that there is one initial version - mockMvc - .perform(get("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments/" - + surveyAttachmentMetadata.getFileName() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 6 line (48 tokens) duplication in the following files: -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 327 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 355 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 477 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 513 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 686 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 746 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.setScaleLevel(null); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isBadRequest()); -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 334 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 460 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 495 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 553 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.setLabel(new I18nString()); - - // create the variable with an empty label - mockMvc - .perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", -===================================================================== -Found a 16 line (48 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationNestedDocument.java - - public static final QConceptNestedDocument conceptNestedDocument = new QConceptNestedDocument("conceptNestedDocument"); - - public final QAbstractNestedSubDocument _super; - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - //inherited - public final StringPath createdBy; - - //inherited - public final DateTimePath createdDate; - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy; -===================================================================== -Found a 5 line (48 tokens) duplication in the following files: -Starting at line 43 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath dataSets = this.createList("dataSets", DataSetSubDocument.class, QDataSetSubDocument.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.description); -===================================================================== -Found a 15 line (48 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java - - public static final QQuestionNestedDocument questionNestedDocument = new QQuestionNestedDocument("questionNestedDocument"); - - public final QAbstractNestedSubDocument _super; - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - //inherited - public final StringPath createdBy; - - //inherited - public final DateTimePath createdDate; - - public final StringPath dataPackageId = createString("dataPackageId"); - - public final StringPath id = createString("id"); -===================================================================== -Found a 8 line (48 tokens) duplication in the following files: -Starting at line 120 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final BooleanPath shadow = _super.shadow; - - //inherited - public final StringPath successorId = _super.successorId; - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString surveyMethod = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.surveyMethod); -===================================================================== -Found a 4 line (47 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 330 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 422 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 535 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - conceptIds.addAll(questionRepository.findSubDocumentsByInstrumentIdIn(instrumentIds).stream() - .map(question -> question.getConceptIds() != null ? question.getConceptIds() - : new ArrayList()) - .flatMap(List::stream).collect(Collectors.toSet())); -===================================================================== -Found a 15 line (47 tokens) duplication in the following files: -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetManagementService.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetManagementService.java - - variableRepository.streamIdsByRelatedQuestionsQuestionId(question.getId()) - .map(variable -> variable.getDataSetId()).collect(Collectors.toSet()); - return dataSetRepository.streamIdsByIdIn(dataSetIds); - }, ElasticsearchType.data_sets); - } - - /** - * Enqueue update of data set search documents when the instrument is updated. - * - * @param instrument the updated, created or deleted instrument. - */ - @HandleAfterCreate - @HandleAfterSave - @HandleAfterDelete - public void onInstrumentChanged(Instrument instrument) { -===================================================================== -Found a 6 line (47 tokens) duplication in the following files: -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - Concept concept = UnitTestCreateDomainObjectUtils.buildConcept(); - - // create the concept with the given id - mockMvc.perform(put(API_CONCEPT_URI + "/" + concept.getId()) - .content(TestUtil.convertObjectToJsonBytes(concept)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 4 line (47 tokens) duplication in the following files: -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - concept.setTitle(new I18nString("hurzDe2", "hurzEn2")); - mockMvc.perform(put(API_CONCEPT_URI + "/" + concept.getId()) - .content(TestUtil.convertObjectToJsonBytes(concept)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isNoContent()); -===================================================================== -Found a 4 line (47 tokens) duplication in the following files: -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - dataPackage.setTitle(new I18nString("hurzDe2", "hurzEn2")); - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); -===================================================================== -Found a 7 line (47 tokens) duplication in the following files: -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectShadowCopyServiceTest.java -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 108 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - Optional persistedShadow = dataPackageRepository.findById(shadow.getId()); - assertThat(persistedShadow.isPresent(), equalTo(true)); - assertThat(persistedShadow.get().getSuccessorId(), nullValue()); - } - - @Test - public void createShadowCopyLinkPredecessorToSuccessor() { -===================================================================== -Found a 9 line (47 tokens) duplication in the following files: -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 96 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - .andExpect(jsonPath("$.[0].masterId", is(dataSetAttachmentMetadata.getId()))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void testDeleteSingleAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 6 line (47 tokens) duplication in the following files: -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/CopyPropertiesTest.java - - public void testCreateDataSetAndReadVersions() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), -===================================================================== -Found a 6 line (47 tokens) duplication in the following files: -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - dataSet.setDescription(new I18nString("hurzDe2", "hurzEn2")); - mockMvc - .perform(put(API_DATASET_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); -===================================================================== -Found a 6 line (47 tokens) duplication in the following files: -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - instrument.setTitle(new I18nString("hurzDe2", "hurzEn2")); - mockMvc - .perform(put(API_INSTRUMENT_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); -===================================================================== -Found a 6 line (47 tokens) duplication in the following files: -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java -Starting at line 183 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 242 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 304 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - dataAcquisitionProjectRepository.save(project); - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - this.dataPackageRepository.save(dataPackage); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - this.surveyRepository.save(survey); -===================================================================== -Found a 6 line (47 tokens) duplication in the following files: -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - - // update the project - project.setHasBeenReleasedBefore(false); -===================================================================== -Found a 6 line (47 tokens) duplication in the following files: -Starting at line 386 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 482 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - rdcProjectRepository.save(project); - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); -===================================================================== -Found a 8 line (47 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 161 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 235 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 264 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - public void testCreateRelatedPublications() throws IOException, Exception { - // ARRANGE - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - dataPackageRepository.save(dataPackage); - RelatedPublication relatedPublication = - UnitTestCreateDomainObjectUtils.buildRelatedPublication(); -===================================================================== -Found a 7 line (47 tokens) duplication in the following files: -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 174 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 395 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - survey.setDataType(I18nString.builder().de("Mixed Methods").en("Mixed Methods").build()); - - // create the survey with the given id but with wrong period - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andReturn(); -===================================================================== -Found a 10 line (47 tokens) duplication in the following files: -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - delete("/api/surveys/" + surveyResponseRateImageMetadata.getSurveyId() + "/images")) - .andExpect(status().isNoContent()); - - // assert that the file does not exist anymore - mockMvc.perform(get(fileUri)).andExpect(status().isNotFound()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testDeleteSingleResponseRateImage() throws Exception { -===================================================================== -Found a 4 line (47 tokens) duplication in the following files: -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - survey.setTitle(new I18nString("hurzDe2", "hurzEn2")); - mockMvc.perform(put(API_SURVEY_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); -===================================================================== -Found a 6 line (47 tokens) duplication in the following files: -Starting at line 460 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 495 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 619 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.setScaleLevel(I18nString.builder().de("InvalidValue").en("InvalidValue").build()); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isBadRequest()); -===================================================================== -Found a 15 line (47 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java - - public static final QDataSetNestedDocument dataSetNestedDocument = new QDataSetNestedDocument("dataSetNestedDocument"); - - public final QAbstractNestedSubDocument _super; - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - //inherited - public final StringPath createdBy; - - //inherited - public final DateTimePath createdDate; - - public final StringPath dataPackageId = createString("dataPackageId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description; -===================================================================== -Found a 6 line (47 tokens) duplication in the following files: -Starting at line 92 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); - - //inherited - public final NumberPath number; -===================================================================== -Found a 9 line (46 tokens) duplication in the following files: -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageOverviewResource.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetReportResource.java - - mailService.sendDataPackageOverviewGeneratedMail(user.get(), dataPackageId, language, sender); - SecurityContextHolder.getContext().setAuthentication(null); - return ResponseEntity.ok().build(); - } else { - return ResponseEntity.badRequest() - .body("User with name '" + onBehalfOf + "' does not exist!"); - } - } -} -===================================================================== -Found a 16 line (46 tokens) duplication in the following files: -Starting at line 97 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java - - .read(DataPackageAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } - javers.commitShallowDelete(currentUser, metadata); - }); - this.operations.delete(query); - } - - /** - * Load all metadata objects from gridfs (ordered by indexInDataPackage). - * - * @param dataPackageId The id of the dataPackage. - * @return A list of metadata. - */ - public List findAllByDataPackage(String dataPackageId) { -===================================================================== -Found a 4 line (46 tokens) duplication in the following files: -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java - - + Pattern.quote(DataPackageAttachmentFilenameBuilder.buildFileNamePrefix(dataPackageId)))); - query.with(Sort.by(Sort.Direction.ASC, "metadata.indexInDataPackage")); - Iterable files = this.operations.find(query); - List result = new ArrayList<>(); -===================================================================== -Found a 8 line (46 tokens) duplication in the following files: -Starting at line 472 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 542 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 635 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - projectRepository.findById(survey.getDataAcquisitionProjectId()).orElse(null); - if (project == null) { - // project has been deleted, skip upsert - return false; - } - Release release = getRelease(project); - Configuration configuration = project.getConfiguration(); - String doi = doiBuilder.buildDataPackageDoi(dataPackage, release); -===================================================================== -Found a 24 line (46 tokens) duplication in the following files: -Starting at line 16 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/validation/ValidDataTypeValidator.java -Starting at line 16 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/ValidDataTypeValidator.java - -public class ValidDataTypeValidator implements ConstraintValidator { - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#initialize(java.lang.annotation.Annotation) - */ - @Override - public void initialize(ValidDataType constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(I18nString dataType, ConstraintValidatorContext context) { - - // check for data types - return DataTypes.ALL.contains(dataType); - } - -} -===================================================================== -Found a 8 line (46 tokens) duplication in the following files: -Starting at line 197 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java -Starting at line 209 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java - - .perform(put("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments/" - + attachment.getOriginalFilename()).content(TestUtil.convertObjectToJsonBytes(current)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); - - // read the updated attachment and check the version - mockMvc - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) -===================================================================== -Found a 4 line (46 tokens) duplication in the following files: -Starting at line 205 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 220 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 218 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 199 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .andExpect(status().isOk()).andExpect(jsonPath("$.[0].version", is(1))) - .andExpect(jsonPath("$.[0].createdBy", is("test"))) - .andExpect(jsonPath("$.[0].lastModifiedBy", is("test"))) - .andExpect(jsonPath("$.[0].language", is("en"))); -===================================================================== -Found a 7 line (46 tokens) duplication in the following files: -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 174 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 211 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - + "/attachments/" + attachment.getOriginalFilename())) - .andExpect(status().is2xxSuccessful()); - - // ensure the uploaded file does not exist anymore - mockMvc.perform(get( - "/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java - - "/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); - - DataPackageAttachmentMetadata current = dataPackageAttachmentService - .findAllByDataPackage(dataPackageAttachmentMetadata.getDataPackageId()).get(0); - current.setType(DataPackageAttachmentTypes.OTHER); -===================================================================== -Found a 9 line (46 tokens) duplication in the following files: -Starting at line 327 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 371 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - metadata.setVersion(0L); - - String filename = DataPackageAttachmentFilenameBuilder.buildFileName(metadata); - try (InputStream is = new ByteArrayInputStream("Test".getBytes(StandardCharsets.UTF_8))) { - gridFsMetadataUpdateService.store(is, filename, "text/plain", metadata); - } - - mockMvc - .perform( -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 190 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 221 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 16 line (46 tokens) duplication in the following files: -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DeleteAllDataPackagesResourceControllerTest.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/AvailableDataSetNumbersResourceControllerTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DeleteAllDateSetsResourceControllerTest.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/AvailableInstrumentNumbersResourceControllerTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/DeleteAllInstrumentsResourceControllerTest.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/DeleteAllQuestionsResourceControllerTest.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/AvailableSurveyNumbersResourceControllerTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/DeleteAllSurveysResourceControllerTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/DeleteAllVariablesResourceControllerTest.java - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { -===================================================================== -Found a 8 line (46 tokens) duplication in the following files: -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java - - public void createShadowCopyWithSameReleaseVersion() throws Exception { - DataPackageAttachmentMetadata master = - UnitTestCreateDomainObjectUtils.buildDataPackageAttachmentMetadata(PROJECT_ID); - master.generateId(); - master.setMasterId(master.getId()); - createTestFileForAttachment(master); - DataPackageAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java -Starting at line 172 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageShadowCopyServiceTest.java - - dataAcquisitionProject.getRelease(), "1.0.0"); - - List files = new ArrayList<>(); - gridFsOperations.find(new Query()).iterator().forEachRemaining(files::add); - - assertThat(files.size(), equalTo(2)); -===================================================================== -Found a 8 line (46 tokens) duplication in the following files: -Starting at line 330 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 372 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - metadata.setVersion(0L); - - String filename = DataSetAttachmentFilenameBuilder.buildFileName(metadata); - try (InputStream is = new ByteArrayInputStream("Test".getBytes(StandardCharsets.UTF_8))) { - gridFsMetadataUpdateService.store(is, filename, "text/plain", metadata); - } - - mockMvc.perform(put("/api/data-sets/" + dataSetId + "/attachments/" + metadata.getFileName()) -===================================================================== -Found a 17 line (46 tokens) duplication in the following files: -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 65 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { - this.dataAcquisitionProjectRepository.deleteAll(); -===================================================================== -Found a 8 line (46 tokens) duplication in the following files: -Starting at line 165 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 333 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(null, survey.getId(), 1); - - - // Act and Assert - // create the DataSet with a survey but without a project - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); -===================================================================== -Found a 7 line (46 tokens) duplication in the following files: -Starting at line 215 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 239 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 294 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), "notExist", null); - - // Act and Assert - // create the DataSet with the given id but with an unknown survey - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().is2xxSuccessful()); -===================================================================== -Found a 8 line (46 tokens) duplication in the following files: -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - survey.getNumber()); - - // create the data set with the given id - mockMvc - .perform(put(API_DATASET_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/DeleteAllInstrumentsResourceControllerTest.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/DeleteAllVariablesResourceControllerTest.java - - public void testDeleteAllInstrumentsOfProject() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - String projectId = project.getId(); - List surveyNumbers = new ArrayList(); - surveyNumbers.add(1); -===================================================================== -Found a 7 line (46 tokens) duplication in the following files: -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java - - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); - - // update the metadata - InstrumentAttachmentMetadata current = instrumentAttachmentService - .findAllByInstrument(instrumentAttachmentMetadata.getInstrumentId()).get(0); - current.setType(InstrumentAttachmentTypes.OTHER); -===================================================================== -Found a 12 line (46 tokens) duplication in the following files: -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 262 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - public void testCreateInstrument() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Instrument instrument = - UnitTestCreateDomainObjectUtils.buildInstrument(project.getId(), project.getId() + "-sy1"); - - // Act and Assert - // create the instrument with the given id - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) -===================================================================== -Found a 8 line (46 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 102 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - Instrument instrument = UnitTestCreateDomainObjectUtils.buildInstrument(project.getId()); - - // create the instrument with the given id - mockMvc - .perform(put(API_INSTRUMENT_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 5 line (46 tokens) duplication in the following files: -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 201 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (46 tokens) duplication in the following files: -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_URI).contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - - // read the project under the new url - mockMvc.perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId())) -===================================================================== -Found a 7 line (46 tokens) duplication in the following files: -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 209 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - project.setMasterId("thisidistoolongandshouldproduceanerror"); - // create the project with the given id - mockMvc - .perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))) - .andExpect(status().is4xxClientError()).andExpect(jsonPath("$.errors[0].message", -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isNotFound()); - - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 335 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 347 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 358 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 366 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - project.setConfiguration(invalidConf); - mockMvc - .perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))) - .andExpect(status().isBadRequest()); -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 407 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 456 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 482 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - project.getConfiguration().getRequirements().setDataSetsRequired(true); - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); -===================================================================== -Found a 4 line (46 tokens) duplication in the following files: -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - project.setHasBeenReleasedBefore(true); - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); -===================================================================== -Found a 7 line (46 tokens) duplication in the following files: -Starting at line 267 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 284 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 301 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 356 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - question.setType(null); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(put(API_QUESTIONS_URI + "/" + question.getId()) - .content(TestUtil.convertObjectToJsonBytes(question)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); -===================================================================== -Found a 8 line (46 tokens) duplication in the following files: -Starting at line 308 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 350 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - metadata.setVersion(0L); - - String filename = SurveyAttachmentFilenameBuilder.buildFileName(metadata); - try (InputStream is = new ByteArrayInputStream("Test".getBytes(StandardCharsets.UTF_8))) { - gridFsMetadataUpdateService.store(is, filename, "text/plain", metadata); - } - - mockMvc.perform(put("/api/surveys/" + surveyId + "/attachments/" + metadata.getFileName()) -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 212 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 231 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - survey.setDataType(I18nString.builder().de("Mixed Methods").en("Mixed Methods").build()); - - // create the survey with the given id but with wrong period - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 174 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 395 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - survey.setDataType(null); - - // create the survey with the given id but with wrong period - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_SURVEY_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 11 line (46 tokens) duplication in the following files: -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageShadowCopyServiceTest.java - - dataAcquisitionProject.setRelease(release); - } - - @After - public void teardown() { - Query query = new Query(GridFsCriteria.whereFilename().regex("^/surveys*")); - this.gridFsOperations.delete(query); - } - - @Test - public void createShadowCopy() throws Exception { -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 321 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 441 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - new HashSet<>(Arrays.asList(AuthoritiesConstants.USER)), false); - - restMvc.perform(post("/api/register").contentType(TestUtil.APPLICATION_JSON_UTF8) - .content(TestUtil.convertObjectToJsonBytes(u))).andExpect(status().isCreated()); - - Optional user = userRepository.findOneByLogin("joe"); -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 251 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 589 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 619 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 646 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 726 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 786 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 805 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - - // create the variable with the given id - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 171 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 589 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 646 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildVariable(null, 1, "var1", 1, surveyNumbers); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isBadRequest()); -===================================================================== -Found a 6 line (46 tokens) duplication in the following files: -Starting at line 171 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 207 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 225 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 305 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 327 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 334 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 355 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 384 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 416 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 460 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 477 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 495 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 513 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 534 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 553 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 571 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 686 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 706 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 746 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 766 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 886 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildVariable(null, 1, "var1", 1, surveyNumbers); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isBadRequest()); -===================================================================== -Found a 7 line (46 tokens) duplication in the following files: -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QSubDataSet.java - - public final ListPath dataCurators = this.createList("dataCurators", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); - - //inherited - public final BooleanPath hidden = _super.hidden; -===================================================================== -Found a 8 line (46 tokens) duplication in the following files: -Starting at line 97 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.title); - - public final ListPath variables = this.createList("variables", VariableSubDocument.class, QVariableSubDocument.class, PathInits.DIRECT2); - - //inherited - public final NumberPath version = _super.version; - - public QConceptSearchDocument(String variable) { -===================================================================== -Found a 5 line (46 tokens) duplication in the following files: -Starting at line 97 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); - - public final NumberPath numberOfWaves = createNumber("numberOfWaves", Integer.class); -===================================================================== -Found a 6 line (45 tokens) duplication in the following files: -Starting at line 133 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/AbstractAttachmentShadowCopyDataSource.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionImageShadowCopyDataSource.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyResponseRateImageShadowCopyDataSource.java - - int index = masterId.lastIndexOf("/attachments/"); - StringBuilder builder = new StringBuilder(); - builder.append(masterId, 0, index).append("-").append(previousVersion) - .append(masterId.substring(index)); - return builder.toString(); - } -===================================================================== -Found a 16 line (45 tokens) duplication in the following files: -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 169 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 162 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java - - .read(DataPackageAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } - javers.commitShallowDelete(currentUser, metadata); - }); - this.operations.delete(query); - } - - /** - * Delete the attachment and its metadata from gridfs. - * - * @param dataPackageId The id of the dataPackage. - * @param filename The filename of the attachment. - */ - public void deleteByDataPackageIdAndFilename(String dataPackageId, String filename) { -===================================================================== -Found a 12 line (45 tokens) duplication in the following files: -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/helper/DataPackageShadowCopyDataSource.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java -Starting at line 96 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/helper/DataAcquisitionProjectShadowCopyDataSource.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionShadowCopyDataSource.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyShadowCopyDataSource.java -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/helper/VariableShadowCopyDataSource.java - - dataPackages.forEach(shadow -> { - shadow.setHidden(hidden); - crudHelper.saveShadow(shadow); - }); - } - } - - @Override - public void unhideExistingShadowCopies(String projectId, String version) { - setHiddenState(projectId, version, false); - } -} -===================================================================== -Found a 8 line (45 tokens) duplication in the following files: -Starting at line 31 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/usermanagement/repository/OAuth2AccessTokenRepositoryImpl.java -Starting at line 29 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/usermanagement/repository/OAuth2RefreshTokenRepositoryImpl.java - - return mongoTemplate.findOne(query, OAuth2AuthenticationAccessToken.class); - } - - @Override - public boolean deleteByTokenId(final String tokenId) { - final Query query = Query.query(Criteria.where(ID).is(tokenId)); - final DeleteResult deleteResult = - mongoTemplate.remove(query, OAuth2AuthenticationAccessToken.class); -===================================================================== -Found a 13 line (45 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsFirstQuartileMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsFirstQuartileMustBeAnIsoDateOnDateDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMaximumMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMaximumMustBeAnIsoDateOnDateDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMedianMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMedianMustBeAnIsoDateOnDateDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMinimumMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsMinimumMustBeAnIsoDateOnDateDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsThirdQuartileMustBeANumberOnNumericDataTypeValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/StatisticsThirdQuartileMustBeAnIsoDateOnDateDataTypeValidator.java -Starting at line 29 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/ValidResponseValueMustBeANumberOnNumericDataTypeValidator.java -Starting at line 29 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/ValidResponseValueMustBeAnIsoDateOnDateDataTypeValidator.java - - StatisticsFirstQuartileMustBeANumberOnNumericDataType constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Variable variable, ConstraintValidatorContext context) { - - if (variable == null || variable.getDataType() == null || variable.getDistribution() == null - || variable.getDistribution().getStatistics() == null -===================================================================== -Found a 4 line (45 tokens) duplication in the following files: -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableChangesProvider.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableChangesProvider.java - - if (oldDomainObjects.get(variableId) != null - && oldDomainObjects.get(variableId).getRelatedQuestions() != null) { - for (RelatedQuestion question : oldDomainObjects.get(variableId).getRelatedQuestions()) { - if (!oldIds.contains(question.getInstrumentId())) { -===================================================================== -Found a 8 line (45 tokens) duplication in the following files: -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 96 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - + "con-conceptid$/attachments/filename.txt"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void testDeleteSingleAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 8 line (45 tokens) duplication in the following files: -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 172 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void testDeleteAllAttachments() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 5 line (45 tokens) duplication in the following files: -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - mockMvc.perform(post(API_CONCEPT_URI).content(TestUtil.convertObjectToJsonBytes(concept)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the concept under the new url - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId())).andExpect(status().isOk()); -===================================================================== -Found a 8 line (45 tokens) duplication in the following files: -Starting at line 337 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 261 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 276 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 338 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 336 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 485 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 359 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 316 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 398 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 890 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(metadata)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-save-not-allowed"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) -===================================================================== -Found a 6 line (45 tokens) duplication in the following files: -Starting at line 149 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 206 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 202 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 213 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java - - mockMvc.perform(put("/api/data-acquisition-projects" + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); - shadowCopyQueueItemService.executeShadowCopyActions(); - - UnitTestUserManagementUtils.logout(); -===================================================================== -Found a 6 line (45 tokens) duplication in the following files: -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - .perform(post(API_DATAPACKAGE_URI).content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // read the dataPackage under the new url - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getId())) -===================================================================== -Found a 6 line (45 tokens) duplication in the following files: -Starting at line 263 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 373 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - mockMvc.perform(delete(API_DATASETS_URI + "/" + dataSet.getId())) - .andExpect(status().is2xxSuccessful()); - - // check that the DataSet has been deleted - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) - .andExpect(status().isNotFound()); -===================================================================== -Found a 8 line (45 tokens) duplication in the following files: -Starting at line 321 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 296 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 471 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 345 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 384 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 874 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(dataSet)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString("global.error.shadow-create-not-allowed"))); - } - - @Test - @WithMockUser(authorities=AuthoritiesConstants.PUBLISHER) -===================================================================== -Found a 8 line (45 tokens) duplication in the following files: -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - DataSetAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); - - List files = new ArrayList<>(); - gridFsOperations.find(new Query()).forEach(files::add); -===================================================================== -Found a 4 line (45 tokens) duplication in the following files: -Starting at line 166 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java - - DataSet shadow = new DataSet(master); - shadow.setId(master.getId() + "-" + version); - shadow.setDataPackageId(master.getDataPackageId() + "-" + version); - shadow.setDataAcquisitionProjectId(master.getDataAcquisitionProjectId() + "-" + version); -===================================================================== -Found a 10 line (45 tokens) duplication in the following files: -Starting at line 95 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - elasticsearchUpdateQueueService.processAllQueueItems(); - - // check that there is one instrument document - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(1L)); - - // check that auditing attributes have been set - mockMvc.perform(get(API_INSTRUMENTS_URI + "/" + instrument.getId())) -===================================================================== -Found a 4 line (45 tokens) duplication in the following files: -Starting at line 133 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 125 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - .andExpect(jsonPath("$[0].id", is(instrument.getId()))) - .andExpect(jsonPath("$[0].title.de", is("hurzDe3"))) - .andExpect(jsonPath("$[0].version", is(equalTo(2)))) - .andExpect(jsonPath("$[1].id", is(instrument.getId()))) -===================================================================== -Found a 4 line (45 tokens) duplication in the following files: -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - .andExpect(jsonPath("$[1].id", is(instrument.getId()))) - .andExpect(jsonPath("$[1].title.de", is("hurzDe2"))) - .andExpect(jsonPath("$[1].version", is(equalTo(1)))) - .andExpect(jsonPath("$[2].id", is(instrument.getId()))) -===================================================================== -Found a 10 line (45 tokens) duplication in the following files: -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/logmanagement/rest/LogsResourceTest.java -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResourceTest.java - - .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andReturn(); - - String content = mvcResult.getResponse() - .getContentAsString(); - JSONArray jsonArray = new JSONArray(content); - - // Assert - assertThat(content, not(nullValue())); - assertThat(jsonArray.length(), greaterThan(0)); -===================================================================== -Found a 9 line (45 tokens) duplication in the following files: -Starting at line 209 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 388 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - this.dataSetRepository.save(dataSet); - - //Instrument - Instrument instrument = UnitTestCreateDomainObjectUtils.buildInstrument(project.getId()); - this.instrumentRepository.save(instrument); - - //Question - Question question = UnitTestCreateDomainObjectUtils.buildQuestion(project.getId(), 123, "testProject-WrongQuestionname1" -===================================================================== -Found a 3 line (45 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (45 tokens) duplication in the following files: -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_URI).contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - - // read the project under the new url - mockMvc.perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId())) -===================================================================== -Found a 3 line (45 tokens) duplication in the following files: -Starting at line 202 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 213 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 159 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 169 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - this.mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); -===================================================================== -Found a 6 line (45 tokens) duplication in the following files: -Starting at line 302 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 368 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - mockMvc.perform(delete(API_SURVEYS_URI + "/" + survey.getId())) - .andExpect(status().is2xxSuccessful()); - - // check that the survey is really deleted - mockMvc.perform(get(API_SURVEYS_URI + "/" + survey.getId())) - .andExpect(status().isNotFound()); -===================================================================== -Found a 11 line (45 tokens) duplication in the following files: -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageShadowCopyServiceTest.java -Starting at line 132 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageShadowCopyServiceTest.java - - createTestFileForSurveyRateImage(master); - SurveyResponseRateImageMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForSurveyRateImage(shadow); - - DataAcquisitionProject dataAcquisitionProject = createDataAcquisitionProject(); - release.setVersion("1.0.1"); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); - - Query predecessorQuery = new Query(GridFsCriteria.whereFilename().is(createFileName("1.0.0"))); -===================================================================== -Found a 8 line (45 tokens) duplication in the following files: -Starting at line 40 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QDaraUpdateQueueItem.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/QElasticsearchUpdateQueueItem.java - - public final DateTimePath updateStartedAt = createDateTime("updateStartedAt", java.time.LocalDateTime.class); - - public final StringPath updateStartedBy = createString("updateStartedBy"); - - //inherited - public final NumberPath version = _super.version; - - public QDaraUpdateQueueItem(String variable) { -===================================================================== -Found a 5 line (45 tokens) duplication in the following files: -Starting at line 81 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final SetPath originalLanguages = _super.originalLanguages; - - public final ListPath questions = this.createList("questions", QuestionSubDocument.class, QQuestionSubDocument.class, PathInits.DIRECT2); - - public final StringPath release = createString("release"); -===================================================================== -Found a 6 line (45 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 133 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath variables = this.createList("variables", VariableSubDocument.class, QVariableSubDocument.class, PathInits.DIRECT2); - - //inherited - public final NumberPath version = _super.version; - - public QConceptSearchDocument(String variable) { -===================================================================== -Found a 14 line (45 tokens) duplication in the following files: -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 24 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSubDocument.java - - public final ListPath authors = this.createList("authors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath doi = createString("doi"); - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; -===================================================================== -Found a 8 line (45 tokens) duplication in the following files: -Starting at line 49 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java - - public final BooleanPath shadow = createBoolean("shadow"); - - public final StringPath successorId = createString("successorId"); - - public final ListPath surveyIds = this.createList("surveyIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final NumberPath version; -===================================================================== -Found a 13 line (45 tokens) duplication in the following files: -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final ListPath conceptIds = this.createList("conceptIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - public final StringPath id = createString("id"); -===================================================================== -Found a 10 line (45 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final StringPath name = createString("name"); - - public final ListPath> relatedQuestions = this.>createList("relatedQuestions", eu.dzhw.fdz.metadatamanagement.variablemanagement.domain.projections.RelatedQuestionSubDocumentProjection.class, SimplePath.class, PathInits.DIRECT2); -===================================================================== -Found a 16 line (44 tokens) duplication in the following files: -Starting at line 97 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 169 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 162 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java - - .read(DataPackageAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } - javers.commitShallowDelete(currentUser, metadata); - }); - this.operations.delete(query); - } - - /** - * Load all metadata objects from gridfs (ordered by indexInDataPackage). - * - * @param dataPackageId The id of the dataPackage. - * @return A list of metadata. - */ - public List findAllByDataPackage(String dataPackageId) { -===================================================================== -Found a 16 line (44 tokens) duplication in the following files: -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java - - .read(DataPackageAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } - javers.commitShallowDelete(currentUser, metadata); - }); - this.operations.delete(query); - } - - /** - * Delete the attachment and its metadata from gridfs. - * - * @param dataPackageId The id of the dataPackage. - * @param filename The filename of the attachment. - */ - public void deleteByDataPackageIdAndFilename(String dataPackageId, String filename) { -===================================================================== -Found a 7 line (44 tokens) duplication in the following files: -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataSetSearchDocument.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/VariableSearchDocument.java - - private List nestedSurveys = new ArrayList<>(); - private List concepts = new ArrayList<>(); - private List nestedConcepts = new ArrayList<>(); - private Release release = null; - private Configuration configuration = null; - - private Integer maxNumberOfObservations; -===================================================================== -Found a 5 line (44 tokens) duplication in the following files: -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java -Starting at line 144 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java - - .regex("^" + Pattern.quote(SurveyAttachmentFilenameBuilder.buildFileNamePrefix(surveyId)))); - Iterable files = this.operations.find(query); - files.forEach(file -> { - SurveyAttachmentMetadata metadata = - mongoTemplate.getConverter().read(SurveyAttachmentMetadata.class, file.getMetadata()); -===================================================================== -Found a 7 line (44 tokens) duplication in the following files: -Starting at line 199 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); - - // read the updated attachment and check the version - mockMvc - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.[0].version", is(1))) -===================================================================== -Found a 15 line (44 tokens) duplication in the following files: -Starting at line 61 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java -Starting at line 65 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/rest/SearchResourceTest.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { -===================================================================== -Found a 5 line (44 tokens) duplication in the following files: -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 108 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the concept versions - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(equalTo(1)))) -===================================================================== -Found a 3 line (44 tokens) duplication in the following files: -Starting at line 77 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(equalTo(1)))) - .andExpect(jsonPath("$[0].id", is(concept.getId()))) -===================================================================== -Found a 3 line (44 tokens) duplication in the following files: -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(equalTo(3)))) - .andExpect(jsonPath("$[0].id", is(concept.getId()))) -===================================================================== -Found a 3 line (44 tokens) duplication in the following files: -Starting at line 133 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId() + "/versions?skip=1")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(equalTo(2)))) - .andExpect(jsonPath("$[0].id", is(concept.getId()))) -===================================================================== -Found a 13 line (44 tokens) duplication in the following files: -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 55 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); -===================================================================== -Found a 5 line (44 tokens) duplication in the following files: -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 221 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - .andExpect(jsonPath("$.[0].version", is(0))) - .andExpect(jsonPath("$.[0].createdBy", is("test"))) - .andExpect(jsonPath("$.[0].lastModifiedBy", is("test"))) - .andExpect(jsonPath("$.[0].masterId", - is("/public/files/data-packages/" + "stu-projectid$/attachments/filename.txt"))); -===================================================================== -Found a 12 line (44 tokens) duplication in the following files: -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 67 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); - dataPackageRepository.deleteAll(); -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 123 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - .andExpect(status().isCreated()); - - // read the dataPackage versions - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getId() + "/versions")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.length()", is(equalTo(1)))) -===================================================================== -Found a 7 line (44 tokens) duplication in the following files: -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/AvailableDataSetNumbersResourceControllerTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/AvailableInstrumentNumbersResourceControllerTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/AvailableSurveyNumbersResourceControllerTest.java - - mockMvc.perform(get("/api/data-acquisition-projects/test/available-data-set-numbers")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))) - .andExpect(jsonPath("$.[0]", is(1))); - } - - @Test - public void testAvailableNumbersIfThereIsOneDataSet() throws Exception { -===================================================================== -Found a 9 line (44 tokens) duplication in the following files: -Starting at line 211 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 292 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); - - // read the updated attachment and check the version - mockMvc - .perform(get( - "/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.[0].version", is(1))) -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // check that auditing attributes have been set - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 132 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - .andExpect(status().isCreated()); - - // read the data set versions - mockMvc.perform(get(API_DATASET_URI + "/" + dataSet.getId() + "/versions")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.length()", is(equalTo(1)))) -===================================================================== -Found a 9 line (44 tokens) duplication in the following files: -Starting at line 159 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 270 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); - - // read the updated attachment and check the version - mockMvc - .perform(get( - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect( -===================================================================== -Found a 11 line (44 tokens) duplication in the following files: -Starting at line 217 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 240 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - public void testCreateWithWrongId() throws Exception { - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Instrument instrument = - UnitTestCreateDomainObjectUtils.buildInstrument(project.getId(), project.getId() + "-sy1"); - - // Act and Assert - // set inconsistent id - instrument.setId("hurz"); -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // check that the instrument has been created - mockMvc.perform(get(API_INSTRUMENTS_URI + "/" + instrument.getId())) -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - .andExpect(status().isCreated()); - - // read the instrument versions - mockMvc.perform(get(API_INSTRUMENT_URI + "/" + instrument.getId() + "/versions")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.length()", is(equalTo(1)))) -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java - - order.getProducts().add(createProduct(order.getId())); - - mockMvc - .perform(put(UPDATE_ORDER_URL + order.getId()).contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(order))) - .andExpect(status().isOk()).andExpect(header().exists("Location")) -===================================================================== -Found a 7 line (44 tokens) duplication in the following files: -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java -Starting at line 102 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java - - public void testHealthCheck() throws Exception { - - //ASSERT - RestTemplate restTemplate = this.daraService.getRestTemplate(); - MockRestServiceServer mockServer = MockRestServiceServer.bindTo(restTemplate).build(); - mockServer - .expect(requestTo(this.daraService.getApiEndpoint() + DaraService.IS_ALiVE_ENDPOINT)) -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 161 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 279 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 338 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 396 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - Question question = UnitTestCreateDomainObjectUtils.buildQuestion(project.getId(), 1, instrument.getId() - ); - this.questionRepository.save(question); - QuestionImageMetadata questionImageMetadata = - UnitTestCreateDomainObjectUtils.buildQuestionImageMetadata(project.getId(), question.getId()); - UnitTestImageHelper.saveQuestionImage(this.questionImageService, questionImageMetadata); -===================================================================== -Found a 8 line (44 tokens) duplication in the following files: -Starting at line 187 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 246 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 308 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 359 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - this.dataPackageRepository.save(dataPackage); - - //Survey - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - this.surveyRepository.save(survey); - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - List listOfSurveyIds = new ArrayList<>(); -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isNotFound()); - - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (44 tokens) duplication in the following files: -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); - - // ensure it is really deleted - mockMvc.perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isNotFound()); -===================================================================== -Found a 5 line (44 tokens) duplication in the following files: -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 201 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 212 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - - this.mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 10 line (44 tokens) duplication in the following files: -Starting at line 227 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 251 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - .build()); - - // update the Question with the given id - mockMvc.perform(put(API_QUESTIONS_URI + "/" + question.getId()) - .content(TestUtil.convertObjectToJsonBytes(question))) - .andExpect(status().is4xxClientError()); - } - - @Test - public void testUpdateQuestionWithWrongNumber() throws Exception { -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 96 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 188 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 207 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 242 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 282 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildRelatedPublication(); - // ACT - // create the related publication with the given id - this.mockMvc.perform(put(API_RELATED_PUBLICATION_URI + "/" + relatedPublication.getId()) - .content(TestUtil.convertObjectToJsonBytes(relatedPublication)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 7 line (44 tokens) duplication in the following files: -Starting at line 193 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); - - // read the updated attachment and check the version - mockMvc - .perform(get("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.[0].version", is(1))) -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 294 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 320 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - // create the survey with the given id - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 335 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // read the survey under the new url - mockMvc.perform(get(API_SURVEYS_URI + "/" + survey.getId())) -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - .andExpect(status().isCreated()); - - // read the dataPackage versions - mockMvc.perform(get(API_SURVEY_URI + "/" + survey.getId() + "/versions")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.length()", is(equalTo(1)))) -===================================================================== -Found a 9 line (44 tokens) duplication in the following files: -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 216 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 318 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 346 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 368 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 397 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 429 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 451 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 469 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 486 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 504 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 543 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 562 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 581 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 639 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 676 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 696 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 716 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 736 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 756 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 776 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 797 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 823 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 842 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariable() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); -===================================================================== -Found a 8 line (44 tokens) duplication in the following files: -Starting at line 334 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 553 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 619 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.setLabel(new I18nString()); - - // create the variable with an empty label - mockMvc - .perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", -===================================================================== -Found a 8 line (44 tokens) duplication in the following files: -Starting at line 506 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 527 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.setAccessWays(null); -===================================================================== -Found a 14 line (44 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 31 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); -===================================================================== -Found a 5 line (44 tokens) duplication in the following files: -Starting at line 68 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java - - public final ListPath nestedDataPackages = this.createList("nestedDataPackages", DataPackageNestedDocument.class, QDataPackageNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 12 line (44 tokens) duplication in the following files: -Starting at line 38 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java - - public final StringPath lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final BooleanPath shadow = createBoolean("shadow"); - - public final StringPath successorId = createString("successorId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title; -===================================================================== -Found a 5 line (44 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedQuestions = this.createList("nestedQuestions", QuestionNestedDocument.class, QQuestionNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedRelatedPublications = this.createList("nestedRelatedPublications", RelatedPublicationNestedDocument.class, QRelatedPublicationNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 5 line (44 tokens) duplication in the following files: -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath nestedSponsors = this.createList("nestedSponsors", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 6 line (44 tokens) duplication in the following files: -Starting at line 51 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java - - public final StringPath successorId = createString("successorId"); - - public final ListPath surveyIds = this.createList("surveyIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final NumberPath version; -===================================================================== -Found a 5 line (43 tokens) duplication in the following files: -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/rest/I18nResourceController.java -Starting at line 26 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataFormatsResource.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveySampleTypeResource.java - - public ResponseEntity> getCountryCodes() { - return ResponseEntity.ok() - .cacheControl(CacheControl.maxAge(0, TimeUnit.DAYS).mustRevalidate().cachePublic()) - .eTag(ETAG.toString()) - .body(countryCodeProvider.getCountryCodes()); -===================================================================== -Found a 15 line (43 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptAttachmentService.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java -Starting at line 132 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java - - result.add(mongoTemplate.getConverter().read(ConceptAttachmentMetadata.class, - gridfsFile.getMetadata())); - }); - return result; - } - - - - /** - * Delete all attachments of all {@link Concept}s. - */ - public void deleteAll() { - String currentUser = SecurityUtils.getCurrentUserLogin(); - Query query = new Query(GridFsCriteria.whereFilename() - .regex("^" + Pattern.quote("/concepts/") + ".*" + Pattern.quote("/attachments/"))); -===================================================================== -Found a 9 line (43 tokens) duplication in the following files: -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/DataSet.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/Instrument.java - - message = "data-set-management.error.data-set.unique-data-set-number-in-project") -@CompoundIndex(def = "{number: 1, dataAcquisitionProjectId: 1}", unique = true) -@EqualsAndHashCode(callSuper = false, of = "id") -@ToString(callSuper = true) -@NoArgsConstructor -@Data -@AllArgsConstructor -@Builder -@ValidShadowId(message = "data-set-management.error.data-set.id.pattern") -===================================================================== -Found a 9 line (43 tokens) duplication in the following files: -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - this.gridFsOperations.delete(new Query()); - } - - @Test - @WithMockUser(authorities=AuthoritiesConstants.PUBLISHER, username="test") - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 7 line (43 tokens) duplication in the following files: -Starting at line 295 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 297 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 276 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - "/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() + "/attachments")) - .andExpect(status().isOk()).andExpect(content().json("[]")); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testCreateShadowCopyInstrumentAttachment() throws Exception { -===================================================================== -Found a 8 line (43 tokens) duplication in the following files: -Starting at line 329 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 332 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - String filename = DataPackageAttachmentFilenameBuilder.buildFileName(metadata); - try (InputStream is = new ByteArrayInputStream("Test".getBytes(StandardCharsets.UTF_8))) { - gridFsMetadataUpdateService.store(is, filename, "text/plain", metadata); - } - - mockMvc - .perform( - put("/api/data-packages/" + dataPackageId + "/attachments/" + metadata.getFileName()) -===================================================================== -Found a 7 line (43 tokens) duplication in the following files: -Starting at line 373 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 374 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 352 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - String filename = DataPackageAttachmentFilenameBuilder.buildFileName(metadata); - try (InputStream is = new ByteArrayInputStream("Test".getBytes(StandardCharsets.UTF_8))) { - gridFsMetadataUpdateService.store(is, filename, "text/plain", metadata); - } - - mockMvc - .perform(delete( -===================================================================== -Found a 6 line (43 tokens) duplication in the following files: -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 190 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 221 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 3 line (43 tokens) duplication in the following files: -Starting at line 159 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 187 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - mockMvc.perform(get(API_DATAPACKAGE_URI)).andExpect(status().isOk()) - .andExpect(jsonPath("$.content.length()", is(1))) - .andExpect(jsonPath("$.content[0].masterId", is(dataPackage.getId()))); -===================================================================== -Found a 16 line (43 tokens) duplication in the following files: -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - private DataPackageShadowCopyService shadowCopyService; - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - private DataAcquisitionProject project; - - private Release release; - - @Before - public void setUp() { - release = new Release("1.0.0", LocalDateTime.now(), null, false); - DataAcquisitionProject releasedProject = -===================================================================== -Found a 11 line (43 tokens) duplication in the following files: -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - release = new Release("1.0.0", LocalDateTime.now(), null, false); - DataAcquisitionProject releasedProject = - UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - releasedProject.setRelease(release); - project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - project.setRelease(release); - project.setId(PROJECT_ID); - } - - @After - public void tearDown() { -===================================================================== -Found a 7 line (43 tokens) duplication in the following files: -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 123 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectShadowCopyServiceTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - dataPackageRepository.findAll().stream().filter(DataPackage::isShadow).collect(Collectors.toList()); - - assertThat(result.size(), equalTo(2)); - - String successorId = master.getId() + "-" + release.getVersion(); - - Optional successor = -===================================================================== -Found a 8 line (43 tokens) duplication in the following files: -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - survey.getNumber()); - - // create the data set with the given id - mockMvc - .perform(put(API_DATASET_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 14 line (43 tokens) duplication in the following files: -Starting at line 36 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/filemanagement/rest/FileResourceTest.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac) - .build(); - } - - @After - public void cleanUp() { - this.fileService.deleteTempFiles(); -===================================================================== -Found a 6 line (43 tokens) duplication in the following files: -Starting at line 164 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 250 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - instrument.setTitle(new I18nString("Hurz2", "Hurz2")); - - // update the instrument with the given id - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().is2xxSuccessful()); -===================================================================== -Found a 8 line (43 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - Instrument instrument = UnitTestCreateDomainObjectUtils.buildInstrument(project.getId()); - - // create the instrument with the given id - mockMvc - .perform(put(API_INSTRUMENT_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 8 line (43 tokens) duplication in the following files: -Starting at line 55 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailServiceTest.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailServiceTest.java - - Future futureVoid = this.mailService.sendActivationEmail(user); - futureVoid.get(); - Message[] messages = greenMail.getReceivedMessages(); - - // Arrange - assertThat(futureVoid.isDone(), is(true)); - assertThat(messages.length, is(1)); - } -===================================================================== -Found a 6 line (43 tokens) duplication in the following files: -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 347 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isNotFound()); - - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 3 line (43 tokens) duplication in the following files: -Starting at line 247 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 264 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 281 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - mockMvc.perform(put(API_SURVEYS_URI + "/6").content(survey).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].invalidValue", is("2013-04-01d"))) -===================================================================== -Found a 6 line (43 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_SURVEY_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 10 line (43 tokens) duplication in the following files: -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/repository/MongoDBTokenStoreTest.java -Starting at line 123 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/repository/MongoDBTokenStoreTest.java - - this.mongoDBTokenStore.readAuthentication(this.accessToken); - - // Assert - assertThat(auth2Authentication, not(nullValue())); - assertThat(auth2Authentication.getName(), is("principal")); - assertThat(auth2Authentication.getPrincipal(), is("principal")); - } - - @Test - public void testReadAccessToken() { -===================================================================== -Found a 10 line (43 tokens) duplication in the following files: -Starting at line 96 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/repository/MongoDBTokenStoreTest.java -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/repository/MongoDBTokenStoreTest.java - - this.mongoDBTokenStore.readAccessToken(this.accessToken.getValue()); - - // Assert - assertThat(accessToken, not(nullValue())); - assertThat(accessToken, is(this.accessToken)); - assertThat(accessToken.getRefreshToken(), is(this.refreshToken)); - } - - @Test - public void testReadRefreshToken() { -===================================================================== -Found a 11 line (43 tokens) duplication in the following files: -Starting at line 38 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java - - public final StringPath doi = createString("doi"); - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath license = createString("license"); -===================================================================== -Found a 9 line (43 tokens) duplication in the following files: -Starting at line 33 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 37 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final ListPath dataPackages = this.createList("dataPackages", DataPackageSubDocument.class, QDataPackageSubDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 5 line (43 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 133 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 118 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 129 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final ListPath surveys = this.createList("surveys", SurveySubDocument.class, QSurveySubDocument.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.conceptmanagement.domain.QTags tags = new eu.dzhw.fdz.metadatamanagement.conceptmanagement.domain.QTags(_super.tags); -===================================================================== -Found a 5 line (43 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java - - public static final QDataSetSubDocument dataSetSubDocument = new QDataSetSubDocument("dataSetSubDocument"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - public final ListPath accessWays = this.createList("accessWays", String.class, StringPath.class, PathInits.DIRECT2); -===================================================================== -Found a 5 line (42 tokens) duplication in the following files: -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/rest/I18nResourceController.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/rest/I18nResourceController.java -Starting at line 26 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataFormatsResource.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveySampleTypeResource.java - - public ResponseEntity> getCountryCodes() { - return ResponseEntity.ok() - .cacheControl(CacheControl.maxAge(0, TimeUnit.DAYS).mustRevalidate().cachePublic()) - .eTag(ETAG.toString()) - .body(countryCodeProvider.getCountryCodes()); -===================================================================== -Found a 20 line (42 tokens) duplication in the following files: -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageOverviewResource.java -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetReportResource.java - - dataPackageId, task, version); - return ResponseEntity.accepted().location(pollUri).body(task); - } else { - // Return bad request, if file is empty. - return ResponseEntity.badRequest().body(null); - } - } - - /** - * Upload the generated data package overview and attach it to the given {@link DataPackage}. - * - * @param overviewFile The pdf overview to attach to the given {@link DataPackage} - * @param language The language of the overview. Currently supports only 'de' or 'en'. - * @param dataPackageId The id of the {@link DataPackage} to which this file shall be attached. - * @param onBehalfOf Username of the MDM user who will receive an email, when the report has been - * successfully attached. - * @return 200 if attaching succeeded. - * @throws IOException Thrown if the multipart file cannot be read. - */ - @PostMapping(value = "/data-packages/{dataPackageId}/overview/{language}") -===================================================================== -Found a 10 line (42 tokens) duplication in the following files: -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - String subject = messageSource.getMessage("email.activation.title", null, locale); - return sendEmail(null, new String[] {user.getEmail()}, null, null, subject, content, false, - true); - } - - /** - * Send password reset mail. - */ - @Async - public Future sendPasswordResetMail(User user) { -===================================================================== -Found a 12 line (42 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DaraUpdateQueueService.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - queueItemRepository.insert(new DaraUpdateQueueItem(projectId)); - } catch (DuplicateKeyException ex) { - log.debug("Ignoring attempt to enqueue a duplicate action."); - } - } - - /** - * Process the update queue every minute. - */ - @Scheduled(fixedRate = 1000 * 60, initialDelay = 1000 * 60) - public void processAllQueueItems() { - log.debug("Starting processing of DaraUpdateQueue..."); -===================================================================== -Found a 4 line (42 tokens) duplication in the following files: -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataSetSearchDocument.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/VariableSearchDocument.java - - private List nestedQuestions = new ArrayList<>(); - private List surveys = new ArrayList<>(); - private List nestedSurveys = new ArrayList<>(); - private List concepts = new ArrayList<>(); -===================================================================== -Found a 9 line (42 tokens) duplication in the following files: -Starting at line 346 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 433 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - projectRepository.findById(instrument.getDataAcquisitionProjectId()).orElse(null); - if (project == null) { - // project has been deleted, skip upsert - return false; - } - Release release = getRelease(project); - Configuration configuration = project.getConfiguration(); - DataPackageSubDocumentProjection dataPackage = - dataPackageRepository.findOneSubDocumentById(instrument.getDataPackageId()); -===================================================================== -Found a 3 line (42 tokens) duplication in the following files: -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableChangesProvider.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableChangesProvider.java - - if (oldDomainObjects.get(variableId) != null - && oldDomainObjects.get(variableId).getRelatedQuestions() != null) { - for (RelatedQuestion question : oldDomainObjects.get(variableId).getRelatedQuestions()) { -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - Concept concept = UnitTestCreateDomainObjectUtils.buildConcept(); - - // create the concept with the given id - mockMvc.perform(put(API_CONCEPT_URI + "/" + concept.getId()) - .content(TestUtil.convertObjectToJsonBytes(concept)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 8 line (42 tokens) duplication in the following files: -Starting at line 358 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 359 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 337 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - mockMvc.perform(delete("/api/data-packages/" + dataPackageId + "/attachments")) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-delete-not-allowed"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testDeleteAttachmentOfShadowCopyDataPackage() throws Exception { -===================================================================== -Found a 8 line (42 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - .andExpect(jsonPath("$.content.length()", is(0))); - - // get the empty list of pinned data packages - mockMvc.perform(get(API_DATAPACKAGE_URI + "?pinned=true")).andExpect(status().isOk()) - .andExpect(jsonPath("$.content.length()", is(0))); - - // get the empty list from the LEGACY URI - mockMvc.perform(get(API_LEGACY_URI)).andExpect(status().isOk()) -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 190 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 202 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 221 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 257 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 272 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 13 line (42 tokens) duplication in the following files: -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).addFilter(legacyUrlsFilter).build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); - dataPackageRepository.deleteAll(); - elasticsearchUpdateQueueItemRepository.deleteAll(); - elasticsearchAdminService.recreateAllIndices(); - javersService.deleteAll(); - } - - @Test -===================================================================== -Found a 7 line (42 tokens) duplication in the following files: -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java - - dataAcquisitionProject.getRelease(), null); - - GridFSFile gridFsFile = gridFsOperations.findOne( - new Query(GridFsCriteria.whereMetaData("dataAcquisitionProjectId").is(PROJECT_ID + "-1.0.0") - .andOperator(GridFsCriteria.whereMetaData("shadow").is(true)))); - - DataPackageAttachmentMetadata metaData = -===================================================================== -Found a 8 line (42 tokens) duplication in the following files: -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectShadowCopyServiceTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - private Release release; - - @Before - public void setUp() { - release = new Release("1.0.0", LocalDateTime.now(), null, false); - DataAcquisitionProject releasedProject = - UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - releasedProject.setRelease(release); -===================================================================== -Found a 5 line (42 tokens) duplication in the following files: -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 149 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java - - assertThat(count, equalTo(2L)); - - Optional persistedShadow = dataPackageRepository.findById(shadow.getId()); - assertThat(persistedShadow.isPresent(), equalTo(true)); - assertThat(persistedShadow.get().getSuccessorId(), nullValue()); -===================================================================== -Found a 7 line (42 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 165 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 215 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 239 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 255 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 284 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 294 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 333 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 365 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 258 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 369 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // delete the DataSet - mockMvc.perform(delete(API_DATASETS_URI + "/" + dataSet.getId())) -===================================================================== -Found a 8 line (42 tokens) duplication in the following files: -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - String firstDescription = dataSet.getDescription().getDe(); - - // create the data set with the given id - mockMvc - .perform(put(API_DATASET_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 7 line (42 tokens) duplication in the following files: -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java - - dataAcquisitionProject.getRelease(), null); - - GridFSFile gridFsFile = gridFsOperations.findOne( - new Query(GridFsCriteria.whereMetaData("dataAcquisitionProjectId").is(PROJECT_ID + "-1.0.0") - .andOperator(GridFsCriteria.whereMetaData("shadow").is(true)))); - - DataSetAttachmentMetadata metaData = mongoTemplate.getConverter() -===================================================================== -Found a 5 line (42 tokens) duplication in the following files: -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java - - assertThat(count, equalTo(2L)); - - Optional persistedShadow = dataSetRepository.findById(shadow.getId()); - assertThat(persistedShadow.isPresent(), equalTo(true)); - assertThat(persistedShadow.get().getSuccessorId(), nullValue()); -===================================================================== -Found a 8 line (42 tokens) duplication in the following files: -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 217 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 240 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 262 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - public void testCreateInstrument() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Instrument instrument = - UnitTestCreateDomainObjectUtils.buildInstrument(project.getId(), project.getId() + "-sy1"); -===================================================================== -Found a 7 line (42 tokens) duplication in the following files: -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 192 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 205 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 228 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 250 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 268 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 307 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildInstrument(project.getId(), project.getId() + "-sy1"); - - // Act and Assert - // create the instrument with the given id - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // delete the survey - mockMvc.perform(delete(API_INSTRUMENTS_URI + "/" + instrument.getId())) -===================================================================== -Found a 8 line (42 tokens) duplication in the following files: -Starting at line 102 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - String firstTitle = instrument.getTitle().getDe(); - - // create the instrument with the given id - mockMvc - .perform(put(API_INSTRUMENT_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 7 line (42 tokens) duplication in the following files: -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 160 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java - - dataAcquisitionProject.getRelease(), null); - - GridFSFile gridFsFile = gridFsOperations.findOne( - new Query(GridFsCriteria.whereMetaData("dataAcquisitionProjectId").is(PROJECT_ID + "-1.0.0") - .andOperator(GridFsCriteria.whereMetaData("shadow").is(true)))); - - InstrumentAttachmentMetadata metaData = mongoTemplate.getConverter() -===================================================================== -Found a 5 line (42 tokens) duplication in the following files: -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 149 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java - - assertThat(count, equalTo(2L)); - - Optional persistedShadow = instrumentRepository.findById(shadow.getId()); - assertThat(persistedShadow.isPresent(), equalTo(true)); - assertThat(persistedShadow.get().getSuccessorId(), nullValue()); -===================================================================== -Found a 5 line (42 tokens) duplication in the following files: -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 201 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 209 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 335 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 347 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 358 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 366 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - // create the project with the given id - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 386 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 407 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 422 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 439 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 456 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 482 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - rdcProjectRepository.save(project); - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); -===================================================================== -Found a 5 line (42 tokens) duplication in the following files: -Starting at line 108 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 162 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java - - .andExpect(status().isNotFound()); - - this.mockMvc - .perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + projectId + "/shadows/1.0.0/action")) - .andExpect(status().isOk()).andExpect(jsonPath("$.size()", is(0))); -===================================================================== -Found a 5 line (42 tokens) duplication in the following files: -Starting at line 96 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectShadowCopyServiceTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectShadowCopyServiceTest.java - - assertThat(count, equalTo(2L)); - - Optional persistedShadow = projectRepository.findById(shadow.getId()); - assertThat(persistedShadow.isPresent(), equalTo(true)); - assertThat(persistedShadow.get().getSuccessorId(), nullValue()); -===================================================================== -Found a 11 line (42 tokens) duplication in the following files: -Starting at line 88 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 171 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 236 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 312 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - public void testCreateQuestion() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Question question = UnitTestCreateDomainObjectUtils - .buildQuestion(project.getId(), 123, "instrument-Id"); - // Act and Assert - // create the Question with the given id - mockMvc.perform(put(API_QUESTIONS_URI + "/" + question.getId()) -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 95 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 188 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 216 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 242 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 267 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 284 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 301 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 318 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 356 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - .buildQuestion(project.getId(), 123, "instrument-Id"); - // Act and Assert - // create the Question with the given id - mockMvc.perform(put(API_QUESTIONS_URI + "/" + question.getId()) - .content(TestUtil.convertObjectToJsonBytes(question)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 7 line (42 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java - - dataAcquisitionProject.getRelease(), null); - - GridFSFile gridFsFile = gridFsOperations.findOne( - new Query(GridFsCriteria.whereMetaData("dataAcquisitionProjectId").is(PROJECT_ID + "-1.0.0") - .andOperator(GridFsCriteria.whereMetaData("shadow").is(true)))); - - QuestionImageMetadata metaData = -===================================================================== -Found a 5 line (42 tokens) duplication in the following files: -Starting at line 112 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java - - assertThat(count, equalTo(2L)); - - Optional persistedShadow = questionRepository.findById(shadow.getId()); - assertThat(persistedShadow.isPresent(), equalTo(true)); - assertThat(persistedShadow.get().getSuccessorId(), nullValue()); -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 174 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 212 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 231 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 294 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 320 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 395 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - // create the survey with the given id - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 333 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - survey.setDataType(I18nString.builder().de("Mixed Methods").en("Mixed Methods").build()); - - // create the survey with the given id but with wrong period - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 297 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 323 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // delete the survey - mockMvc.perform(delete(API_SURVEYS_URI + "/" + survey.getId())) -===================================================================== -Found a 9 line (42 tokens) duplication in the following files: -Starting at line 231 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageShadowCopyServiceTest.java - - } - - private SurveyResponseRateImageMetadata createResponseRateImageMetadata() { - SurveyResponseRateImageMetadata master = new SurveyResponseRateImageMetadata(); - master.setSurveyId(SURVEY_ID); - master.setDataAcquisitionProjectId(PROJECT_ID); - master.setLanguage("en"); - master.setFileName(FILE_NAME); - master.setSurveyNumber(1); -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - String firstTitle = survey.getTitle().getDe(); - - // create the survey with the given id - mockMvc.perform(put(API_SURVEY_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 7 line (42 tokens) duplication in the following files: -Starting at line 81 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - dataAcquisitionProject.getRelease(), null); - - GridFSFile gridFsFile = gridFsOperations.findOne( - new Query(GridFsCriteria.whereMetaData("dataAcquisitionProjectId").is(PROJECT_ID + "-1.0.0") - .andOperator(GridFsCriteria.whereMetaData("shadow").is(true)))); - - SurveyAttachmentMetadata metaData = -===================================================================== -Found a 5 line (42 tokens) duplication in the following files: -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java -Starting at line 165 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - equalTo("/surveys/sur-the-dataacquisition-project-id-sy1$-1.0.0/attachments/filename.txt")); - - List expectedFiles = new ArrayList<>(); - expectedFiles.add("/surveys/" + master.getSurveyId() + "/attachments/filename.txt"); - expectedFiles.add("/surveys/" + master.getSurveyId() + "-1.0.0/attachments/filename.txt"); -===================================================================== -Found a 7 line (42 tokens) duplication in the following files: -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - public void createShadowCopyWithSameReleaseVersion() throws Exception { - SurveyAttachmentMetadata master = - UnitTestCreateDomainObjectUtils.buildSurveyAttachmentMetadata(PROJECT_ID, 1); - master.generateId(); - master.setMasterId(master.getId()); - createTestFileForAttachment(master); - SurveyAttachmentMetadata shadow = createShadow(master, release.getVersion()); -===================================================================== -Found a 5 line (42 tokens) duplication in the following files: -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java - - assertThat(count, equalTo(2L)); - - Optional persistedShadow = surveyRepository.findById(shadow.getId()); - assertThat(persistedShadow.isPresent(), equalTo(true)); - assertThat(persistedShadow.get().getSuccessorId(), nullValue()); -===================================================================== -Found a 7 line (42 tokens) duplication in the following files: -Starting at line 162 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/repository/MongoDBTokenStoreTest.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/repository/MongoDBTokenStoreTest.java - - this.mongoDBTokenStore.findTokensByClientId("clientId"); - - // Assert - assertThat(accessTokens, not(nullValue())); - assertThat(accessTokens.size(), is(1)); - assertThat(accessTokens.contains(this.accessToken), is(true)); - } -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 207 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 225 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 305 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 327 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 334 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 355 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 384 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 416 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 460 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 477 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 495 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 513 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 534 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 553 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 571 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 589 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 646 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 658 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 686 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 706 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 746 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 766 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 805 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 886 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - - // create the variable with the given id - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 171 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 251 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 619 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 726 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 786 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildVariable(null, 1, "var1", 1, surveyNumbers); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isBadRequest()); -===================================================================== -Found a 8 line (42 tokens) duplication in the following files: -Starting at line 182 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 218 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 236 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 262 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 290 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 320 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 348 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 453 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 471 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 488 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 527 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 545 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 610 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 679 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 699 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 719 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 739 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 759 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 779 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 825 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 844 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - variable.setScaleLevel(null); -===================================================================== -Found a 10 line (42 tokens) duplication in the following files: -Starting at line 832 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 857 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.setDataType(DataTypes.DATE); - - // create the variable with the given id - mockMvc - .perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable))) - .andExpect(status().is4xxClientError()); - } - - @Test -===================================================================== -Found a 5 line (42 tokens) duplication in the following files: -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java -Starting at line 150 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - assertThat(count, equalTo(2L)); - - Optional persistedShadow = variableRepository.findById(shadow.getId()); - assertThat(persistedShadow.isPresent(), equalTo(true)); - assertThat(persistedShadow.get().getSuccessorId(), nullValue()); -===================================================================== -Found a 3 line (42 tokens) duplication in the following files: -Starting at line 59 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java - - public final BooleanPath shadow = _super.shadow; - - public final ListPath sponsors = this.createList("sponsors", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); -===================================================================== -Found a 3 line (42 tokens) duplication in the following files: -Starting at line 66 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptNestedDocument.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 165 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java -Starting at line 165 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationNestedDocument.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - this._super = new QAbstractNestedSubDocument(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.createdBy = _super.createdBy; -===================================================================== -Found a 5 line (42 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptNestedDocument.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java - - this.title = inits.isInitialized("title") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("title")) : null; - this.version = _super.version; - } - -} -===================================================================== -Found a 6 line (42 tokens) duplication in the following files: -Starting at line 76 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 104 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); - - //inherited - public final SetPath originalLanguages = _super.originalLanguages; -===================================================================== -Found a 10 line (41 tokens) duplication in the following files: -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/websocket/domain/ActiveWebsocketSession.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/usermanagement/domain/Authority.java - - } - - @Override - public boolean equals(Object object) { - if (this == object) { - return true; - } - if (object == null || getClass() != object.getClass()) { - return false; - } -===================================================================== -Found a 5 line (41 tokens) duplication in the following files: -Starting at line 102 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageOverviewResource.java -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetReportResource.java - - Path zipTmpFilePath = Files.createTempFile(dataPackageId.replace("!", ""), ".zip"); - File zipTmpFile = zipTmpFilePath.toFile(); - templateZip.transferTo(zipTmpFile); - zipTmpFile.setWritable(true); - Task task = taskService.createTask(Task.TaskType.DATA_PACKAGE_OVERVIEW); -===================================================================== -Found a 7 line (41 tokens) duplication in the following files: -Starting at line 220 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java - - .title("Datensatzreport:\n" + dataSet.getDescription().getDe()) - .description(new I18nString( - "Codebook/Variablenreport/Datensatzreport von \"" + dataSet.getDescription().getDe() - + "\"", - "Codebook/Variable Report/Dataset Report of \"" + dataSet.getDescription().getEn() - + "\"")) - .language("de").indexInDataSet(0).build(); -===================================================================== -Found a 5 line (41 tokens) duplication in the following files: -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/repository/DaraUpdateQueueItemRepositoryImpl.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/repository/ShadowCopyQueueRepositoryCustomImpl.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java - - LocalDateTime updateStartedAt) { - Query query = new Query(new Criteria().andOperator(Criteria.where("updateStartedBy") - .is(updateStartedBy), - Criteria.where("updateStartedAt") - .is(updateStartedAt))).limit(BULK_SIZE) -===================================================================== -Found a 5 line (41 tokens) duplication in the following files: -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataSetSearchDocument.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/SurveySearchDocument.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/VariableSearchDocument.java - - private List nestedSurveys = new ArrayList<>(); - private List concepts = new ArrayList<>(); - private List nestedConcepts = new ArrayList<>(); - private Release release = null; - private Configuration configuration = null; -===================================================================== -Found a 10 line (41 tokens) duplication in the following files: -Starting at line 21 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/validation/ValidDataType.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/ValidDataType.java - -@Documented -@Constraint(validatedBy = {ValidDataTypeValidator.class}) -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface ValidDataType { - /** - * Defines the default error message. - */ - String message() default "{eu.dzhw.fdz.metadatamanagement.domain.validation." - + "validsurveydatatype.message}"; -===================================================================== -Found a 6 line (41 tokens) duplication in the following files: -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 203 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") -===================================================================== -Found a 9 line (41 tokens) duplication in the following files: -Starting at line 208 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 226 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - .andExpect(jsonPath("$.[0].language", is("en"))); - } - - @Test - @WithMockUser(authorities=AuthoritiesConstants.PUBLISHER) - public void testUploadAttachmentWithWrongType() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 9 line (41 tokens) duplication in the following files: -Starting at line 228 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 245 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 242 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 223 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 222 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - is("concept-management.error.concept-attachment-metadata.type.valid-type"))); - } - - @Test - @WithMockUser(authorities=AuthoritiesConstants.PUBLISHER) - public void testUploadAttachmentWithMissingDescription() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 4 line (41 tokens) duplication in the following files: -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 129 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 133 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 125 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - .andExpect(jsonPath("$[0].id", is(concept.getId()))) - .andExpect(jsonPath("$[0].title.de", is("hurzDe3"))) - .andExpect(jsonPath("$[0].version", is(equalTo(2)))) - .andExpect(jsonPath("$[0].authors.length()", is(equalTo(concept.getAuthors().size())))) -===================================================================== -Found a 4 line (41 tokens) duplication in the following files: -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - .andExpect(jsonPath("$[1].id", is(concept.getId()))) - .andExpect(jsonPath("$[1].title.de", is("hurzDe2"))) - .andExpect(jsonPath("$[1].version", is(equalTo(1)))) - .andExpect(jsonPath("$[1].authors.length()", is(equalTo(concept.getAuthors().size())))) -===================================================================== -Found a 4 line (41 tokens) duplication in the following files: -Starting at line 125 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - .andExpect(jsonPath("$[2].id", is(concept.getId()))) - .andExpect(jsonPath("$[2].version", is(equalTo(0)))) - .andExpect(jsonPath("$[2].title.de", is(firstTitle))) - .andExpect(jsonPath("$[2].authors.length()", is(equalTo(concept.getAuthors().size())))) -===================================================================== -Found a 4 line (41 tokens) duplication in the following files: -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - .andExpect(jsonPath("$[0].id", is(concept.getId()))) - .andExpect(jsonPath("$[0].title.de", is("hurzDe2"))) - .andExpect(jsonPath("$[0].version", is(equalTo(1)))) - .andExpect(jsonPath("$[0].authors.length()", is(equalTo(concept.getAuthors().size())))) -===================================================================== -Found a 4 line (41 tokens) duplication in the following files: -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 162 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - .andExpect(jsonPath("$[1].id", is(concept.getId()))) - .andExpect(jsonPath("$[1].version", is(equalTo(0)))) - .andExpect(jsonPath("$[1].title.de", is(firstTitle))) - .andExpect(jsonPath("$[1].authors.length()", is(equalTo(concept.getAuthors().size())))) -===================================================================== -Found a 7 line (41 tokens) duplication in the following files: -Starting at line 329 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 374 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 352 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - String filename = DataPackageAttachmentFilenameBuilder.buildFileName(metadata); - try (InputStream is = new ByteArrayInputStream("Test".getBytes(StandardCharsets.UTF_8))) { - gridFsMetadataUpdateService.store(is, filename, "text/plain", metadata); - } - - mockMvc - .perform( -===================================================================== -Found a 7 line (41 tokens) duplication in the following files: -Starting at line 373 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 332 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - String filename = DataPackageAttachmentFilenameBuilder.buildFileName(metadata); - try (InputStream is = new ByteArrayInputStream("Test".getBytes(StandardCharsets.UTF_8))) { - gridFsMetadataUpdateService.store(is, filename, "text/plain", metadata); - } - - mockMvc - .perform(delete( -===================================================================== -Found a 4 line (41 tokens) duplication in the following files: -Starting at line 358 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 367 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - .andExpect(status().isOk()).andExpect(jsonPath("$.id", equalTo(dataPackage.getId()))) - .andExpect(jsonPath("$.masterId", equalTo(dataPackage.getMasterId()))) - .andExpect(jsonPath("$.completeTitle").exists()) - .andExpect(jsonPath("$.release.version", equalTo("2.0.0"))) -===================================================================== -Found a 10 line (41 tokens) duplication in the following files: -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DeleteAllDataPackagesResourceControllerTest.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); - dataPackageRepository.deleteAll(); -===================================================================== -Found a 13 line (41 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DeleteAllDataPackagesResourceControllerTest.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/AvailableDataSetNumbersResourceControllerTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DeleteAllDateSetsResourceControllerTest.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/AvailableInstrumentNumbersResourceControllerTest.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/DeleteAllInstrumentsResourceControllerTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/DeleteAllQuestionsResourceControllerTest.java -Starting at line 65 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/AvailableSurveyNumbersResourceControllerTest.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/DeleteAllSurveysResourceControllerTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/DeleteAllVariablesResourceControllerTest.java - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { -===================================================================== -Found a 5 line (41 tokens) duplication in the following files: -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 160 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - dataAcquisitionProject.getRelease(), null); - - GridFSFile gridFsFile = gridFsOperations.findOne( - new Query(GridFsCriteria.whereMetaData("dataAcquisitionProjectId").is(PROJECT_ID + "-1.0.0") - .andOperator(GridFsCriteria.whereMetaData("shadow").is(true)))); -===================================================================== -Found a 5 line (41 tokens) duplication in the following files: -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - dataAcquisitionProject.getRelease(), "1.0.0"); - - GridFSFile gridFsFile = gridFsOperations.findOne( - new Query(GridFsCriteria.whereMetaData("dataAcquisitionProjectId").is(PROJECT_ID + "-1.0.0") - .andOperator(GridFsCriteria.whereMetaData("shadow").is(true)))); -===================================================================== -Found a 7 line (41 tokens) duplication in the following files: -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 159 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectShadowCopyServiceTest.java -Starting at line 160 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - Optional persistedShadow = dataPackageRepository.findById(shadow.getId()); - - assertThat(persistedShadow.isPresent(), equalTo(true)); - assertThat(persistedShadow.get().getSuccessorId(), equalTo("DELETED")); - } - - private DataPackage createShadow(DataPackage master, String version) { -===================================================================== -Found a 9 line (41 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 194 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - public void testCreateDataSet() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); -===================================================================== -Found a 7 line (41 tokens) duplication in the following files: -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - .andExpect(jsonPath("$[2].id", is(instrument.getId()))) - .andExpect(jsonPath("$[2].version", is(equalTo(0)))) - .andExpect(jsonPath("$[2].title.de", is(firstTitle))); - } - - @Test - public void testInstrumentVersionsNotFound() throws IOException, Exception { -===================================================================== -Found a 9 line (41 tokens) duplication in the following files: -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java - - assertExpectedFilesExistence(expectedFiles); - - GridFsResource shadowCopy = gridFsOperations - .getResource("/instruments/ins-" + PROJECT_ID + "-ins1$-1.0.0/attachments/filename.txt"); - assertThat(shadowCopy.getOptions().getMetadata().get("_contentType"), equalTo("text/plain")); - } - - @Test - public void createShadowCopyWithSameReleaseVersion() throws Exception { -===================================================================== -Found a 3 line (41 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 202 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 213 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 159 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 169 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (41 tokens) duplication in the following files: -Starting at line 123 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 182 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 336 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 348 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 360 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 368 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - mockMvc - .perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))) - .andExpect(status().is4xxClientError()).andExpect(jsonPath("$.errors[0].message", -===================================================================== -Found a 3 line (41 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 171 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 211 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 218 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 246 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 286 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - this.mockMvc.perform(put(API_RELATED_PUBLICATION_URI + "/" + relatedPublication.getId()) - .content(TestUtil.convertObjectToJsonBytes(relatedPublication)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 4 line (41 tokens) duplication in the following files: -Starting at line 321 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 382 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 414 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 441 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - new HashSet<>(Arrays.asList(AuthoritiesConstants.USER)), false); - - restMvc.perform(post("/api/register").contentType(TestUtil.APPLICATION_JSON_UTF8) - .content(TestUtil.convertObjectToJsonBytes(u))).andExpect(status().isCreated()); -===================================================================== -Found a 9 line (41 tokens) duplication in the following files: -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 608 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariableWithSurveyButWithoutProject() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(null, 1, "var1", 1, surveyNumbers); -===================================================================== -Found a 7 line (41 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/QRelatedPublication.java -Starting at line 22 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; -===================================================================== -Found a 11 line (41 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java - - public final ListPath institutions = this.createList("institutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final ListPath projectContributors = this.createList("projectContributors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 6 line (41 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QSubDataSet.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QFilterDetails.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QGenerationDetails.java - - public final SetPath> dataFormats = this.>createSet("dataFormats", DataFormat.class, EnumPath.class, PathInits.DIRECT2); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); - - public final StringPath name = createString("name"); -===================================================================== -Found a 10 line (41 tokens) duplication in the following files: -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QAbstractNestedSubDocument.java -Starting at line 33 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 37 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - //inherited - public final StringPath id = _super.id; -===================================================================== -Found a 3 line (41 tokens) duplication in the following files: -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java - - public final ListPath nestedInstitutions = this.createList("nestedInstitutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 5 line (41 tokens) duplication in the following files: -Starting at line 84 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 77 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 96 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath nestedConcepts = this.createList("nestedConcepts", ConceptNestedDocument.class, QConceptNestedDocument.class, PathInits.DIRECT2); - - public final QDataPackageNestedDocument nestedDataPackage; - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 6 line (41 tokens) duplication in the following files: -Starting at line 122 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString type; - - public final ListPath variables = this.createList("variables", VariableSubDocument.class, QVariableSubDocument.class, PathInits.DIRECT2); - - //inherited - public final NumberPath version; -===================================================================== -Found a 12 line (40 tokens) duplication in the following files: -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/AbstractAttachmentShadowCopyDataSource.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/helper/DataAcquisitionProjectShadowCopyDataSource.java - - } - - @Override - public void updateElasticsearch(String dataAcquisitionProjectId, String releaseVersion, - String previousVersion) { - // there is currently no elasticsearch index for attachments - } - - @Override - public void hideExistingShadowCopies(String projectId, String version) { - setHiddenState(projectId, version, true); - } -===================================================================== -Found a 8 line (40 tokens) duplication in the following files: -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/GenericDomainObjectCrudHelper.java -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/GenericDomainObjectCrudHelper.java - - T persisted = repository.save(domainObject); - if (elasticsearchType != null) { - elasticsearchUpdateQueueService.enqueue(persisted.getId(), this.elasticsearchType, - ElasticsearchUpdateQueueAction.UPSERT); - // flush the current changes - elasticsearchUpdateQueueService.processQueueItems(this.elasticsearchType); - } - applicationEventPublisher.publishEvent(new AfterCreateEvent(persisted)); -===================================================================== -Found a 6 line (40 tokens) duplication in the following files: -Starting at line 222 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/GenericDomainObjectCrudHelper.java -Starting at line 187 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/GenericShadowableDomainObjectCrudHelper.java - - SearchSourceBuilder builder = new SearchSourceBuilder(); - builder.fetchSource(null, - ExcludeFieldsHelper.getFieldsToExcludeOnDeserialization(searchDocumentClass)); - builder - .query(QueryBuilders - .constantScoreQuery(QueryBuilders.boolQuery().must(QueryBuilders.termQuery("id", id)))) -===================================================================== -Found a 4 line (40 tokens) duplication in the following files: -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResource.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResource.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResource.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResource.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResource.java - - @RequestMapping(path = "/concepts/attachments", method = RequestMethod.POST) - @Secured(value = {AuthoritiesConstants.PUBLISHER, AuthoritiesConstants.DATA_PROVIDER}) - public ResponseEntity uploadAttachment(@RequestPart("file") MultipartFile multiPartFile, - @RequestPart("conceptAttachmentMetadata") -===================================================================== -Found a 7 line (40 tokens) duplication in the following files: -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/helper/DataPackageAttachmentShadowCopyDataSource.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetAttachmentShadowCopyDataSource.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentAttachmentShadowCopyDataSource.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionImageShadowCopyDataSource.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyAttachmentShadowCopyDataSource.java - - copy = converter.read(DataPackageAttachmentMetadata.class, gridFsFile.getMetadata()); - BeanUtils.copyProperties(source, copy, "version"); - } - - copy.setDataAcquisitionProjectId( - source.getDataAcquisitionProjectId() + "-" + release.getVersion()); - copy.setDataPackageId(source.getDataPackageId() + "-" + release.getVersion()); -===================================================================== -Found a 8 line (40 tokens) duplication in the following files: -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionShadowCopyDataSource.java -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/helper/VariableShadowCopyDataSource.java - - return surveyIds.stream().map(surveyId -> surveyId + "-" + version) - .collect(Collectors.toList()); - } - - @Override - public void deleteExistingShadowCopies(String projectId, String version) { - String oldProjectId = projectId + "-" + version; - try (Stream dataSets = dataSetRepository -===================================================================== -Found a 4 line (40 tokens) duplication in the following files: -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/repository/DaraUpdateQueueItemRepositoryImpl.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java - - new Criteria().orOperator( - Criteria.where("updateStartedAt").lte(LocalDateTime.now() - .minusMinutes(UPDATE_LOCK_EXPIRED)), - Criteria.where("updateStartedAt").exists(false)), -===================================================================== -Found a 4 line (40 tokens) duplication in the following files: -Starting at line 27 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectChangesProvider.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectChangesProvider.java - - public List getAddedPublisherUserNamesList(String projectId) { - List oldPublishers = getPublishers(oldDomainObjects.get(projectId)); - List newPublishers = getPublishers(newDomainObjects.get(projectId)); - return ListUtils.diff(newPublishers, oldPublishers); -===================================================================== -Found a 4 line (40 tokens) duplication in the following files: -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectChangesProvider.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectChangesProvider.java - - public List getAddedDataProviderUserNamesList(String projectId) { - List oldDataProviders = getDataProviders(oldDomainObjects.get(projectId)); - List newDataProviders = getDataProviders(newDomainObjects.get(projectId)); - return ListUtils.diff(newDataProviders, oldDataProviders); -===================================================================== -Found a 4 line (40 tokens) duplication in the following files: -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResource.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResource.java - - @RequestMapping(path = "/questions/images", method = RequestMethod.POST) - @Secured(value = {AuthoritiesConstants.PUBLISHER, AuthoritiesConstants.DATA_PROVIDER}) - public ResponseEntity uploadImage(@RequestParam("image") MultipartFile multiPartFile, - @RequestPart("questionImageMetadata") @Valid QuestionImageMetadata questionImageMetadata) -===================================================================== -Found a 4 line (40 tokens) duplication in the following files: -Starting at line 315 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 412 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java - - .title(I18nString.builder().de("Instrument.de").en("Instrument.en").build()) - .subtitle(I18nString.builder().de("Instrument Untertitel de") - .en("Instrument Subtitle en").build()) - .description(I18nString.builder().de("Instrument.de").en("Instrument.en").build()) -===================================================================== -Found a 5 line (40 tokens) duplication in the following files: -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 190 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - mockMvc.perform(put("/api/questions/" + question.getId()) - .content(TestUtil.convertObjectToJsonBytes(question)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); - - mockMvc.perform(delete(API_CONCEPT_URI + "/" + conceptInQuestion.getId())) -===================================================================== -Found a 5 line (40 tokens) duplication in the following files: -Starting at line 195 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 250 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - instrument.setConceptIds(Collections.singletonList(conceptInInstrument.getId())); - - mockMvc.perform(put("/api/instruments/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); -===================================================================== -Found a 5 line (40 tokens) duplication in the following files: -Starting at line 197 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - mockMvc.perform(put("/api/instruments/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); - - mockMvc.perform(delete(API_CONCEPT_URI + "/" + conceptInInstrument.getId())) -===================================================================== -Found a 6 line (40 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 67 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 161 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 235 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 264 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - public void testGetAccessWaysOfDataPackage() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - dataPackageRepository.save(dataPackage); -===================================================================== -Found a 8 line (40 tokens) duplication in the following files: -Starting at line 314 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 317 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 322 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 296 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 345 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 295 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 385 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 875 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .file(metadata)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-create-not-allowed"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testUpdateAttachmentOfShadowCopyDataPackage() throws Exception { -===================================================================== -Found a 8 line (40 tokens) duplication in the following files: -Starting at line 358 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 77 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DeleteAllDataPackagesResourceControllerTest.java -Starting at line 359 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 350 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 337 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 213 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - mockMvc.perform(delete("/api/data-packages/" + dataPackageId + "/attachments")) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-delete-not-allowed"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testDeleteAttachmentOfShadowCopyDataPackage() throws Exception { -===================================================================== -Found a 7 line (40 tokens) duplication in the following files: -Starting at line 313 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 348 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - dataPackage.setId(dataPackage.getId() + "-1.0.0"); - dataPackage.setDataAcquisitionProjectId(project.getId()); - dataPackage.setVersion(null); - dataPackage = dataPackageRepository.save(dataPackage); - - elasticsearchAdminService.recreateAllIndices(); - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(2L)); -===================================================================== -Found a 5 line (40 tokens) duplication in the following files: -Starting at line 97 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 97 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 97 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java - - equalTo("/public/files/data-packages/stu-" + PROJECT_ID + "$-1.0.0/attachments/filename.txt")); - assertThat(metaData.getDataAcquisitionProjectId(), equalTo(PROJECT_ID + "-1.0.0")); - assertThat(metaData.isShadow(), equalTo(true)); - assertThat(gridFsFile.getFilename(), - equalTo("/data-packages/stu-" + PROJECT_ID + "$-1.0.0/attachments/filename.txt")); -===================================================================== -Found a 10 line (40 tokens) duplication in the following files: -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 66 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { - this.dataAcquisitionProjectRepository.deleteAll(); - this.surveyRepository.deleteAll(); -===================================================================== -Found a 5 line (40 tokens) duplication in the following files: -Starting at line 97 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 251 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 280 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/CopyPropertiesTest.java - - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); -===================================================================== -Found a 11 line (40 tokens) duplication in the following files: -Starting at line 267 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 306 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) - .andExpect(status().isNotFound()); - - elasticsearchUpdateQueueService.processAllQueueItems(); - - // check that there are no more data set documents - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(0L)); - } - - @Test - public void testUpdateDataSet() throws Exception { -===================================================================== -Found a 5 line (40 tokens) duplication in the following files: -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - dataSet.getDescription() -===================================================================== -Found a 4 line (40 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 169 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - .andExpect(jsonPath("$.[0].version", is(0))) - .andExpect(jsonPath("$.[0].createdBy", is("test"))) - .andExpect(jsonPath("$.[0].lastModifiedBy", is("test"))) - .andExpect(jsonPath("$.[0].type.en", is(InstrumentAttachmentTypes.QUESTION_FLOW.getEn()))); -===================================================================== -Found a 7 line (40 tokens) duplication in the following files: -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - // ensure the uploaded file exists - mockMvc - .perform(get( - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 7 line (40 tokens) duplication in the following files: -Starting at line 203 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testUploadAttachmentWithWrongType() throws Exception { -===================================================================== -Found a 6 line (40 tokens) duplication in the following files: -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java - - order.setClient(OrderClient.DLP); - - mockMvc - .perform(put(UPDATE_ORDER_URL + order.getId()).contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(order))) - .andExpect(status().isOk()).andExpect(header().exists("Location")) -===================================================================== -Found a 5 line (40 tokens) duplication in the following files: -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java - - project = dataAcquisitionProjectRepository.save(project); - - // assert that there are no releases yet - mockMvc.perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId() + "/releases")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); -===================================================================== -Found a 8 line (40 tokens) duplication in the following files: -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 294 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - public void testCreateQuestionWithoutType() throws Exception { - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Question question = UnitTestCreateDomainObjectUtils - .buildQuestion(project.getId(), 123, "instrument-Id"); - question.setType(null); -===================================================================== -Found a 7 line (40 tokens) duplication in the following files: -Starting at line 352 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 366 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - public void testUpdateShadowCopyQuestion() throws Exception { - Question question = UnitTestCreateDomainObjectUtils - .buildQuestion("issue1991", 123, "instrument-Id"); - question.setId(question.getId() + "-1.0.0"); - questionRepository.save(question); - - mockMvc.perform(put(API_QUESTIONS_URI + "/" + question.getId()) -===================================================================== -Found a 5 line (40 tokens) duplication in the following files: -Starting at line 125 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 161 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .file(metadata)).andExpect(status().isCreated()); - - // ensure that there is one attachment - mockMvc.perform(get("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1)));; -===================================================================== -Found a 7 line (40 tokens) duplication in the following files: -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 371 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 401 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 433 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 527 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 799 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - dataAcquisitionProjectRepository.save(project); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); -===================================================================== -Found a 3 line (40 tokens) duplication in the following files: -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QSubDataSet.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QFilterDetails.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QGenerationDetails.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); - - public final StringPath doi = createString("doi"); -===================================================================== -Found a 7 line (40 tokens) duplication in the following files: -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final QTags tags = new QTags(forProperty("tags")); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("title")); - - //inherited - public final NumberPath version = _super.version; -===================================================================== -Found a 7 line (40 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 26 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 22 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; -===================================================================== -Found a 7 line (40 tokens) duplication in the following files: -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QSubDataSet.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QPopulation.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QFilterDetails.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QGenerationDetails.java - - public final ListPath dataCurators = this.createList("dataCurators", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); - - //inherited - public final BooleanPath hidden = _super.hidden; -===================================================================== -Found a 4 line (40 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public final ListPath institutions = this.createList("institutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; -===================================================================== -Found a 6 line (40 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/QRelatedPublication.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - public final ListPath conceptIds = this.createList("conceptIds", String.class, StringPath.class, PathInits.DIRECT2); -===================================================================== -Found a 4 line (40 tokens) duplication in the following files: -Starting at line 61 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final BooleanPath shadow = _super.shadow; - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString subtitle = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("subtitle")); -===================================================================== -Found a 2 line (40 tokens) duplication in the following files: -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QAbstractNestedSubDocument.java -Starting at line 66 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptNestedDocument.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationNestedDocument.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java - - super(type, metadata, inits); - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; -===================================================================== -Found a 4 line (40 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 133 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath variables = this.createList("variables", VariableSubDocument.class, QVariableSubDocument.class, PathInits.DIRECT2); - - //inherited - public final NumberPath version = _super.version; -===================================================================== -Found a 7 line (40 tokens) duplication in the following files: -Starting at line 35 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final StringPath dataPackageId = createString("dataPackageId"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString dataType = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("dataType")); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QPeriod fieldPeriod = new eu.dzhw.fdz.metadatamanagement.common.domain.QPeriod(forProperty("fieldPeriod")); -===================================================================== -Found a 17 line (39 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/domain/validation/I18nStringEntireNotEmptyValidator.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/domain/validation/I18nStringNotEmptyValidator.java - - public void initialize(I18nStringEntireNotEmpty constraintAnnotation) {} - - /* - * (non-Javadoc) - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(I18nString value, ConstraintValidatorContext context) { - - //Empty check - if (value == null) { - return false; - } - - //Check De /En Empty String - return !Strings.isNullOrEmpty(value.getDe()) && !Strings.isNullOrEmpty(value.getEn()); -===================================================================== -Found a 13 line (39 tokens) duplication in the following files: -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/DataSetAttachmentMetadata.java -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/InstrumentAttachmentMetadata.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/SurveyAttachmentMetadata.java - - this.setId("/public/files/data-sets/" + dataSetId + "/attachments/" + fileName); - } - - @Override - protected void setMasterIdInternal(String masterId) { - this.masterId = masterId; - } - - @Override - protected void setIdInternal(String id) { - this.id = id; - } -} -===================================================================== -Found a 14 line (39 tokens) duplication in the following files: -Starting at line 309 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 388 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - new Object[] {dataSetId, language}, locale); - sendEmail(sender, new String[] {user.getEmail()}, null, null, subject, content, false, true); - } - - /** - * Send the error during dataset report generation to the user who started the task and to all - * admins. - * - * @param onBehalfUser The user who has started the report generation. - * @param admins A list of admins. - * @param sender The sender of the email. - */ - @Async - public void sendDataSetReportErrorMail(User onBehalfUser, List admins, -===================================================================== -Found a 6 line (39 tokens) duplication in the following files: -Starting at line 35 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataSetSearchDocument.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/SurveySearchDocument.java - - static final String[] FIELDS_TO_EXCLUDE_ON_DESERIALIZATION = new String[] {"nested*", - "variables", "questions", "configuration", "guiLabels", "*Publications", "concepts"}; - - private DataPackageSubDocument dataPackage = null; - private DataPackageNestedDocument nestedDataPackage = null; - private List variables = new ArrayList<>(); -===================================================================== -Found a 6 line (39 tokens) duplication in the following files: -Starting at line 29 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/config/locale/AngularCookieLocaleResolverTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/config/locale/AngularCookieLocaleResolverTest.java - - public void testResolveLocale() { - // Arrange - AngularCookieLocaleResolver resolver = new AngularCookieLocaleResolver(); - HttpServletRequest servlet = Mockito.mock(HttpServletRequest.class); - when(servlet.getAttribute(CookieLocaleResolver.LOCALE_REQUEST_ATTRIBUTE_NAME)) - .thenReturn(Locale.GERMAN); -===================================================================== -Found a 9 line (39 tokens) duplication in the following files: -Starting at line 29 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/domain/util/PatternsTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/domain/util/PatternsTest.java - - boolean validGermanUmlaut = Pattern.matches(Patterns.GERMAN_ALPHANUMERIC_WITH_UNDERSCORE_AND_MINUS, "äbc123"); - - - //Assert - assertThat(valid, is(true)); - assertThat(validUnderscoreAtEnd, is(true)); - assertThat(validUnderscoreAtFront, is(true)); - assertThat(invalidSpace, is(false)); - assertThat(validMinus, is(true)); -===================================================================== -Found a 5 line (39 tokens) duplication in the following files: -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 275 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 275 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 254 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 254 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .content(TestUtil.convertObjectToJsonBytes(concept)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); -===================================================================== -Found a 12 line (39 tokens) duplication in the following files: -Starting at line 64 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/rest/SearchResourceTest.java -Starting at line 65 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - @Autowired - private JaversService javersService; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { -===================================================================== -Found a 10 line (39 tokens) duplication in the following files: -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 67 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); -===================================================================== -Found a 7 line (39 tokens) duplication in the following files: -Starting at line 295 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 297 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 276 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResourceTest.java - - "/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() + "/attachments")) - .andExpect(status().isOk()).andExpect(content().json("[]")); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testCreateShadowCopyInstrumentAttachment() throws Exception { -===================================================================== -Found a 7 line (39 tokens) duplication in the following files: -Starting at line 373 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 374 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 144 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 352 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - String filename = DataPackageAttachmentFilenameBuilder.buildFileName(metadata); - try (InputStream is = new ByteArrayInputStream("Test".getBytes(StandardCharsets.UTF_8))) { - gridFsMetadataUpdateService.store(is, filename, "text/plain", metadata); - } - - mockMvc - .perform(delete( -===================================================================== -Found a 4 line (39 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectShadowCopyServiceTest.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - assertThat(shadowCopy.getId(), equalTo(master.getId() + "-" + release.getVersion())); - assertThat(shadowCopy.isShadow(), equalTo(true)); - assertThat(shadowCopy.getSuccessorId(), equalTo(null)); - assertThat(shadowCopy.getMasterId(), equalTo(master.getId())); -===================================================================== -Found a 5 line (39 tokens) duplication in the following files: -Starting at line 320 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 335 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - mockMvc.perform(post(API_DATASETS_URI) - .content(TestUtil.convertObjectToJsonBytes(dataSet)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString("global.error.shadow-create-not-allowed"))); -===================================================================== -Found a 4 line (39 tokens) duplication in the following files: -Starting at line 295 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 309 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - mockMvc.perform(post(API_INSTRUMENTS_URI) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString("global.error.shadow-create-not-allowed"))); -===================================================================== -Found a 7 line (39 tokens) duplication in the following files: -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 236 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 298 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 353 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - public void testSimpleProjectForPostValidationWithWrongInformationForQuestion() throws IOException, Exception { - - //Arrange - //Project - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - project.getConfiguration().setDataPackagesState(new ProjectState(true, true)); - this.rdcProjectRepository.save(project); -===================================================================== -Found a 5 line (39 tokens) duplication in the following files: -Starting at line 470 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 484 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_URI) - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString("global.error.shadow-create-not-allowed"))); -===================================================================== -Found a 8 line (39 tokens) duplication in the following files: -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectVersionsServiceTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectVersionsServiceTest.java - - assertNull(previousRelease); - - // unrelease - project.setRelease(null); - project = projectManagementService.save(project); - - previousRelease = versionsService.findPreviousRelease(project.getId(), null); - assertThat(previousRelease.getVersion(), equalTo("0.0.1")); -===================================================================== -Found a 9 line (39 tokens) duplication in the following files: -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/DeleteAllQuestionsResourceControllerTest.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/DeleteAllVariablesResourceControllerTest.java - - questionRepo.deleteAll(); - javersService.deleteAll(); - elasticsearchUpdateQueueItemRepository.deleteAll(); - elasticsearchAdminService.recreateAllIndices(); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.DATA_PROVIDER) - public void testDeleteAllQuestionsOfProject() throws Exception { -===================================================================== -Found a 4 line (39 tokens) duplication in the following files: -Starting at line 344 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 358 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - mockMvc.perform(post(API_QUESTIONS_URI) - .content(TestUtil.convertObjectToJsonBytes(question)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString("global.error.shadow-create-not-allowed"))); -===================================================================== -Found a 5 line (39 tokens) duplication in the following files: -Starting at line 383 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 397 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - mockMvc.perform(post(API_SURVEYS_URI) - .content(TestUtil.convertObjectToJsonBytes(survey)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString("global.error.shadow-create-not-allowed"))); -===================================================================== -Found a 8 line (39 tokens) duplication in the following files: -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/domain/UserTests.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/VariableTest.java - - boolean checkSameButDifferent = user1.equals(user1_1); - - // Assert - assertThat(checkNull, is(false)); - assertThat(checkClass, is(false)); - assertThat(checkSame, is(true)); - assertThat(checkDifferent, is(false)); - assertThat(checkSameButDifferent, is(true)); -===================================================================== -Found a 4 line (39 tokens) duplication in the following files: -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResourceTest.java - - restUserMockMvc.perform(get("/api/account").accept(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(jsonPath("$.login").value("test")) -===================================================================== -Found a 5 line (39 tokens) duplication in the following files: -Starting at line 309 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 338 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 359 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 388 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 420 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 874 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 889 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString( -===================================================================== -Found a 7 line (39 tokens) duplication in the following files: -Starting at line 441 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 832 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 857 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - validResponse.setValue("hurz"); - - // create the variable with duplicate value classes - mockMvc - .perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable))) - .andExpect(status().is4xxClientError()).andReturn(); -===================================================================== -Found a 4 line (39 tokens) duplication in the following files: -Starting at line 868 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 882 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 899 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - public void testCreateVariableShadowCopy() throws Exception { - Variable variable = UnitTestCreateDomainObjectUtils.buildVariable("issue1991", 1, "varname", 1, - Collections.singletonList(1)); - variable.setId(variable.getId() + "-1.0.0"); -===================================================================== -Found a 5 line (39 tokens) duplication in the following files: -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java - - public static final QConcept concept = new QConcept("concept"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - public final ListPath authors = this.createList("authors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 3 line (39 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java - - public final ListPath authors = this.createList("authors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); - - public final StringPath citationHint = createString("citationHint"); -===================================================================== -Found a 3 line (39 tokens) duplication in the following files: -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 24 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QPopulation.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); - - public final StringPath doi = createString("doi"); -===================================================================== -Found a 4 line (39 tokens) duplication in the following files: -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QSubDataSet.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final ListPath dataCurators = this.createList("dataCurators", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); -===================================================================== -Found a 4 line (39 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 125 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public final ListPath institutions = this.createList("institutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; -===================================================================== -Found a 11 line (39 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final NumberPath number = createNumber("number", Integer.class); -===================================================================== -Found a 4 line (39 tokens) duplication in the following files: -Starting at line 71 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final ListPath> surveyNumbers = this.>createList("surveyNumbers", Integer.class, NumberPath.class, PathInits.DIRECT2); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("title")); -===================================================================== -Found a 5 line (39 tokens) duplication in the following files: -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/domain/QOrder.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QShadowCopyQueueItem.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/QElasticsearchUpdateQueueItem.java - - public static final QOrder order = new QOrder("order"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - public final EnumPath client = createEnum("client", OrderClient.class); -===================================================================== -Found a 13 line (39 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java - - public static final QConceptNestedDocument conceptNestedDocument = new QConceptNestedDocument("conceptNestedDocument"); - - public final QAbstractNestedSubDocument _super; - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; - - //inherited - public final StringPath createdBy; - - //inherited - public final DateTimePath createdDate; - - public final StringPath id = createString("id"); -===================================================================== -Found a 7 line (39 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.conceptmanagement.domain.QTags tags = new eu.dzhw.fdz.metadatamanagement.conceptmanagement.domain.QTags(_super.tags); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.title); - - public final ListPath variables = this.createList("variables", VariableSubDocument.class, QVariableSubDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 5 line (39 tokens) duplication in the following files: -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java - - this.tags = inits.isInitialized("tags") ? new eu.dzhw.fdz.metadatamanagement.conceptmanagement.domain.QTags(forProperty("tags")) : null; - this.title = inits.isInitialized("title") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("title")) : null; - } - -} -===================================================================== -Found a 3 line (39 tokens) duplication in the following files: -Starting at line 85 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 67 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedInstitutions = this.createList("nestedInstitutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); -===================================================================== -Found a 3 line (39 tokens) duplication in the following files: -Starting at line 167 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 149 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 181 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - this.configuration = inits.isInitialized("configuration") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QConfiguration(forProperty("configuration")) : null; - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; - this.release = inits.isInitialized("release") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QRelease(forProperty("release")) : null; -===================================================================== -Found a 5 line (39 tokens) duplication in the following files: -Starting at line 84 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 77 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 96 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath nestedConcepts = this.createList("nestedConcepts", ConceptNestedDocument.class, QConceptNestedDocument.class, PathInits.DIRECT2); - - public final QDataPackageNestedDocument nestedDataPackage; - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 5 line (39 tokens) duplication in the following files: -Starting at line 151 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 172 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 160 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - this.nestedDataPackage = inits.isInitialized("nestedDataPackage") ? new QDataPackageNestedDocument(forProperty("nestedDataPackage"), inits.get("nestedDataPackage")) : null; - this.release = inits.isInitialized("release") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QRelease(forProperty("release")) : null; - } - -} -===================================================================== -Found a 12 line (39 tokens) duplication in the following files: -Starting at line 58 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath dataSets = this.createList("dataSets", DataSetSubDocument.class, QDataSetSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString guiLabels; - - //inherited - public final BooleanPath hidden = _super.hidden; - - //inherited - public final StringPath id = _super.id; - - //inherited - public final NumberPath indexInInstrument = _super.indexInInstrument; -===================================================================== -Found a 4 line (38 tokens) duplication in the following files: -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/helper/DataPackageAttachmentShadowCopyDataSource.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionShadowCopyDataSource.java - - copy.setDataAcquisitionProjectId( - source.getDataAcquisitionProjectId() + "-" + release.getVersion()); - copy.setDataPackageId(source.getDataPackageId() + "-" + release.getVersion()); - copy.generateId(); -===================================================================== -Found a 4 line (38 tokens) duplication in the following files: -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetAttachmentShadowCopyDataSource.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/helper/VariableShadowCopyDataSource.java - - copy.setDataAcquisitionProjectId( - source.getDataAcquisitionProjectId() + "-" + release.getVersion()); - copy.setDataSetId(source.getDataSetId() + "-" + release.getVersion()); - copy.generateId(); -===================================================================== -Found a 5 line (38 tokens) duplication in the following files: -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/helper/VariableShadowCopyDataSource.java - - .filter(shadowCopy -> !dataSetRepository.existsById(shadowCopy.getMasterId())); - } - - private static List createDerivedSurveyIds(List surveyIds, String version) { - return surveyIds.stream().map(surveyId -> surveyId + "-" + version) -===================================================================== -Found a 5 line (38 tokens) duplication in the following files: -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/repository/DaraUpdateQueueItemRepositoryImpl.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/repository/ShadowCopyQueueRepositoryCustomImpl.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java - - LocalDateTime updateStartedAt) { - Query query = new Query(new Criteria().andOperator(Criteria.where("updateStartedBy") - .is(updateStartedBy), - Criteria.where("updateStartedAt") - .is(updateStartedAt))).limit(BULK_SIZE) -===================================================================== -Found a 7 line (38 tokens) duplication in the following files: -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/repository/DataAcquisitionProjectRepositoryCustomImpl.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/repository/DataAcquisitionProjectRepositoryCustomImpl.java - - public List findAllMastersByIdLikeAndPublisherIdOrderByIdAsc( - String projectId, String dataProviderId) { - List dataProviderIdValues = Collections.singletonList(dataProviderId); - Criteria criteria = where("configuration.dataProviders") - .in(dataProviderIdValues) - .and("_id") - .regex(projectId, "i") -===================================================================== -Found a 16 line (38 tokens) duplication in the following files: -Starting at line 20 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/validation/ValidQuestionIdNameValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/validation/ValidUniqueQuestionNumberValidator.java - - public void initialize(ValidQuestionIdName constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Question question, ConstraintValidatorContext context) { - - if (question.isShadow()) { - return true; - } else { - // check precondition - if (question.getInstrumentId() == null || question.getNumber() == null) { -===================================================================== -Found a 3 line (38 tokens) duplication in the following files: -Starting at line 77 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResource.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResource.java - - @RequestMapping(path = "/surveys/{surveyId}/attachments", method = RequestMethod.DELETE) - @Secured(value = {AuthoritiesConstants.PUBLISHER, AuthoritiesConstants.DATA_PROVIDER}) - public ResponseEntity deleteAllBySurveyId(@PathVariable("surveyId") String surveyId) { -===================================================================== -Found a 5 line (38 tokens) duplication in the following files: -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageService.java -Starting at line 88 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageService.java - - public void deleteSurveyImage(String surveyId, String fileName) throws IOException { - Optional survey = surveyRepository.findById(surveyId); - if (survey.isPresent() && survey.get().isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } -===================================================================== -Found a 13 line (38 tokens) duplication in the following files: -Starting at line 19 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/rest/I18nResourceControllerTest.java -Starting at line 15 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataFormatsResourceControllerTest.java -Starting at line 15 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveySampleTypesResourceControllerTest.java -Starting at line 15 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/UnitValuesResourceControllerTest.java - -public class I18nResourceControllerTest extends AbstractTest { - @Autowired - private WebApplicationContext wac; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @Test - public void testGetCountryCodes() throws IOException, Exception { -===================================================================== -Found a 4 line (38 tokens) duplication in the following files: -Starting at line 308 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 364 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - List surveyIds = new ArrayList<>(); - surveyIds.add(UnitTestCreateValidIds.buildSurveyId(projectId, 1)); -===================================================================== -Found a 6 line (38 tokens) duplication in the following files: -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - conceptAttachmentMetadata.generateId(); - - // ensure that there is one file - mockMvc - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 3 line (38 tokens) duplication in the following files: -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(equalTo(3)))) - .andExpect(jsonPath("$[0].id", is(concept.getId()))) -===================================================================== -Found a 10 line (38 tokens) duplication in the following files: -Starting at line 70 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - surveyRepository.deleteAll(); - dataPackageRepository.deleteAll(); - elasticsearchUpdateQueueItemRepository.deleteAll(); - elasticsearchAdminService.recreateAllIndices(); - javersService.deleteAll(); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testGetAccessWaysOfDataPackage() throws IOException, Exception { -===================================================================== -Found a 7 line (38 tokens) duplication in the following files: -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 175 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - dataPackageAttachmentMetadata.generateId(); - - // ensure that there is one attachment - mockMvc - .perform(get("/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() - + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 5 line (38 tokens) duplication in the following files: -Starting at line 221 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .andExpect(jsonPath("$.[0].version", is(1))) - .andExpect(jsonPath("$.[0].createdBy", is("test"))) - .andExpect(jsonPath("$.[0].lastModifiedBy", is("test"))) - .andExpect(jsonPath("$.[0].masterId", - is("/public/files/data-packages/" + "stu-projectid$/attachments/filename.txt"))) -===================================================================== -Found a 8 line (38 tokens) duplication in the following files: -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 166 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 217 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - public void testUnreleasedNotPubliclyVisible() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - - // create the dataPackage with the given id - mockMvc.perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) -===================================================================== -Found a 3 line (38 tokens) duplication in the following files: -Starting at line 149 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 206 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 159 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 169 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 181 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - mockMvc.perform(put("/api/data-acquisition-projects" + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); -===================================================================== -Found a 6 line (38 tokens) duplication in the following files: -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - public void testCreateDataPackageWithTooStudySeries() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - dataPackage.setStudySeries(I18nString.builder().de( -===================================================================== -Found a 5 line (38 tokens) duplication in the following files: -Starting at line 206 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 326 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); - - // read the dataPackage under the new url - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getId())).andExpect(status().isOk()) - .andExpect(jsonPath("$.id", is(dataPackage.getId()))) -===================================================================== -Found a 8 line (38 tokens) duplication in the following files: -Starting at line 150 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java - - createTestFileForAttachment(master); - - DataPackageAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - release.setVersion("1.0.1"); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); -===================================================================== -Found a 6 line (38 tokens) duplication in the following files: -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 175 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - dataSetAttachmentMetadata.generateId(); - - // ensure that there is one attachment - mockMvc - .perform(get("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1)));; -===================================================================== -Found a 5 line (38 tokens) duplication in the following files: -Starting at line 97 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 251 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 280 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 102 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); -===================================================================== -Found a 3 line (38 tokens) duplication in the following files: -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 258 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 369 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 8 line (38 tokens) duplication in the following files: -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 194 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 248 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - public void testCreateDataSetWithWrongFormat() throws Exception { - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(null, survey.getId(), 1); -===================================================================== -Found a 3 line (38 tokens) duplication in the following files: -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 8 line (38 tokens) duplication in the following files: -Starting at line 150 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java - - createTestFileForAttachment(master); - - DataSetAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - release.setVersion("1.0.1"); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); -===================================================================== -Found a 11 line (38 tokens) duplication in the following files: -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/filemanagement/rest/FileResourceTest.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac) - .build(); - } - - @After - public void cleanUp() { - this.fileService.deleteTempFiles(); -===================================================================== -Found a 3 line (38 tokens) duplication in the following files: -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 8 line (38 tokens) duplication in the following files: -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 187 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java - - createTestFileForAttachment(master); - - InstrumentAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - release.setVersion("1.0.1"); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); -===================================================================== -Found a 5 line (38 tokens) duplication in the following files: -Starting at line 162 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 219 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - ); - this.questionRepository.save(question); - QuestionImageMetadata questionImageMetadata = - UnitTestCreateDomainObjectUtils.buildQuestionImageMetadata(project.getId(), question.getId()); - UnitTestImageHelper.saveQuestionImage(this.questionImageService, questionImageMetadata); -===================================================================== -Found a 3 line (38 tokens) duplication in the following files: -Starting at line 96 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java - - String projectId = createProject(); - this.mockMvc.perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + projectId + "/shadows")) - .andExpect(status().isOk()).andExpect(jsonPath("$.content.length()", is(0))); -===================================================================== -Found a 8 line (38 tokens) duplication in the following files: -Starting at line 88 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 171 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 236 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 294 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 312 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - public void testCreateQuestion() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Question question = UnitTestCreateDomainObjectUtils - .buildQuestion(project.getId(), 123, "instrument-Id"); -===================================================================== -Found a 8 line (38 tokens) duplication in the following files: -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java - - createTestFileForAttachment(master); - - QuestionImageMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - release.setVersion("1.0.1"); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); -===================================================================== -Found a 3 line (38 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 297 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 323 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 335 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 8 line (38 tokens) duplication in the following files: -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java -Starting at line 181 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - createTestFileForAttachment(master); - - SurveyAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - release.setVersion("1.0.1"); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); -===================================================================== -Found a 6 line (38 tokens) duplication in the following files: -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QDaraUpdateQueueItem.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/QRelatedPublication.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/QElasticsearchIndicesVersion.java - - public static final QDaraUpdateQueueItem daraUpdateQueueItem = new QDaraUpdateQueueItem("daraUpdateQueueItem"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - //inherited - public final StringPath createdBy = _super.createdBy; -===================================================================== -Found a 7 line (38 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.QDataPackage _super = new eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.QDataPackage(this); - - public final ListPath accessWays = this.createList("accessWays", String.class, StringPath.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.annotations); -===================================================================== -Found a 3 line (38 tokens) duplication in the following files: -Starting at line 31 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 29 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 33 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 32 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java -Starting at line 29 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 32 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.annotations); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString completeTitle; -===================================================================== -Found a 8 line (38 tokens) duplication in the following files: -Starting at line 35 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 37 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java - - public final StringPath dataPackageId = createString("dataPackageId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description; - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy; -===================================================================== -Found a 5 line (38 tokens) duplication in the following files: -Starting at line 55 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString dataType = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.dataType); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QPeriod fieldPeriod = new eu.dzhw.fdz.metadatamanagement.common.domain.QPeriod(_super.fieldPeriod); -===================================================================== -Found a 5 line (37 tokens) duplication in the following files: -Starting at line 17 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/ConceptAttachmentTypes.java -Starting at line 16 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/DataPackageAttachmentTypes.java - - public static final I18nString INSTRUMENT = new ImmutableI18nString("Instrument", "Instrument"); - public static final I18nString OTHER = new ImmutableI18nString("Sonstiges", "Other"); - - public static final Set ALL = Collections - .unmodifiableSet(new HashSet(Arrays.asList(DOCUMENTATION, INSTRUMENT, OTHER))); -===================================================================== -Found a 5 line (37 tokens) duplication in the following files: -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResource.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResource.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResource.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResource.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResource.java - - public ResponseEntity findPreviousConceptAttachmentVersions(@PathVariable String conceptId, - @PathVariable String filename, - @RequestParam(name = "limit", defaultValue = "5") Integer limit, - @RequestParam(name = "skip", defaultValue = "0") Integer skip) { - List conceptAttachmentVersions = conceptAttachmentVersionsService -===================================================================== -Found a 4 line (37 tokens) duplication in the following files: -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResource.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResource.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResource.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResource.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResource.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResource.java - - public ResponseEntity findPreviousConceptVersions(@PathVariable String id, - @RequestParam(name = "limit", defaultValue = "5") Integer limit, - @RequestParam(name = "skip", defaultValue = "0") Integer skip) { - List conceptVersions = conceptVersionsService.findPreviousVersions(id, limit, skip); -===================================================================== -Found a 13 line (37 tokens) duplication in the following files: -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/DataPackage.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/DataSet.java -Starting at line 202 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/Instrument.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/DataAcquisitionProject.java -Starting at line 235 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/Question.java -Starting at line 214 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/Survey.java -Starting at line 344 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/Variable.java - - BeanUtils.copyProperties(dataPackage, this); - } - - @Override - protected void setMasterIdInternal(String masterId) { - this.masterId = masterId; - } - - @Override - protected void setIdInternal(String id) { - this.id = id; - } -} -===================================================================== -Found a 6 line (37 tokens) duplication in the following files: -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageOverviewService.java -Starting at line 132 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetReportService.java -Starting at line 444 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DaraService.java - - try { - // Configuration, based on Freemarker Version 2.3.23 - Configuration templateConfiguration = new Configuration(Configuration.VERSION_2_3_23); - templateConfiguration.setDefaultEncoding(StandardCharsets.UTF_8.toString()); - templateConfiguration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); - templateConfiguration.setNumberFormat("0.######"); -===================================================================== -Found a 5 line (37 tokens) duplication in the following files: -Starting at line 40 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/helper/DataPackageShadowCopyDataSource.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionShadowCopyDataSource.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyShadowCopyDataSource.java - - DataPackage copy = crudHelper.read(derivedId).orElseGet(DataPackage::new); - BeanUtils.copyProperties(source, copy, "version"); - copy.setId(derivedId); - copy.setDataAcquisitionProjectId( - source.getDataAcquisitionProjectId() + "-" + release.getVersion()); -===================================================================== -Found a 13 line (37 tokens) duplication in the following files: -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/DataSetAttachmentMetadata.java -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/InstrumentAttachmentMetadata.java -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QuestionImageMetadata.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/SurveyAttachmentMetadata.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/SurveyResponseRateImageMetadata.java - - this.setId("/public/files/data-sets/" + dataSetId + "/attachments/" + fileName); - } - - @Override - protected void setMasterIdInternal(String masterId) { - this.masterId = masterId; - } - - @Override - protected void setIdInternal(String id) { - this.id = id; - } -} -===================================================================== -Found a 10 line (37 tokens) duplication in the following files: -Starting at line 209 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetManagementService.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentManagementService.java -Starting at line 223 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyManagementService.java - - if (!dataSetNumberExists(existingNumbers, i)) { - result.add(i); - } - } - result.add(max.get().getNumber() + 1); - } - return result; - } - - private boolean dataSetNumberExists(List dataSets, Integer number) { -===================================================================== -Found a 6 line (37 tokens) duplication in the following files: -Starting at line 211 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 287 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java - - .build()) - .annotations(I18nString.builder().de("De Anmerkungen") - .en("En Annotations") - .build()) - .dataPackageId(UnitTestCreateValidIds.buildDataPackageId(projectId)) - .subDataSets(subDataSets) -===================================================================== -Found a 6 line (37 tokens) duplication in the following files: -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") -===================================================================== -Found a 4 line (37 tokens) duplication in the following files: -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 162 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); - - // read the concept under the new url - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId())).andExpect(status().isOk()) -===================================================================== -Found a 7 line (37 tokens) duplication in the following files: -Starting at line 314 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 317 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 472 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 295 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - .file(metadata)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-create-not-allowed"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) -===================================================================== -Found a 7 line (37 tokens) duplication in the following files: -Starting at line 329 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 332 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 144 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - String filename = DataPackageAttachmentFilenameBuilder.buildFileName(metadata); - try (InputStream is = new ByteArrayInputStream("Test".getBytes(StandardCharsets.UTF_8))) { - gridFsMetadataUpdateService.store(is, filename, "text/plain", metadata); - } - - mockMvc - .perform( -===================================================================== -Found a 4 line (37 tokens) duplication in the following files: -Starting at line 206 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 229 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); - - // read the dataPackage under the new url - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getId())).andExpect(status().isOk()) -===================================================================== -Found a 6 line (37 tokens) duplication in the following files: -Starting at line 263 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 298 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 373 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - mockMvc.perform(delete(API_DATASETS_URI + "/" + dataSet.getId())) - .andExpect(status().is2xxSuccessful()); - - // check that the DataSet has been deleted - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) - .andExpect(status().isNotFound()); -===================================================================== -Found a 6 line (37 tokens) duplication in the following files: -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 280 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().is2xxSuccessful()); - - // read the updated instrument and check the version - mockMvc.perform(get(API_INSTRUMENTS_URI + "/" + instrument.getId())) - .andExpect(status().isOk()) -===================================================================== -Found a 5 line (37 tokens) duplication in the following files: -Starting at line 208 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 231 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 295 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect( - jsonPath("$.errors[0].message", is("instrument-management.error.instrument.type.valid"))); -===================================================================== -Found a 4 line (37 tokens) duplication in the following files: -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java -Starting at line 470 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 484 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - .perform(post("/api/data-acquisition-projects/" + project.getMasterId() + "/release") - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", is( -===================================================================== -Found a 6 line (37 tokens) duplication in the following files: -Starting at line 479 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 493 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - public void testUpdateShadowCopyProject() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - project.setId(project.getId() + "-1.0.0"); - project = rdcProjectRepository.save(project); - - mockMvc.perform(put(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) -===================================================================== -Found a 7 line (37 tokens) duplication in the following files: -Starting at line 129 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - MockMvcRequestBuilders.multipart("/api/questions/images").file(attachment).file(metadata)) - .andExpect(status().isBadRequest()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testDeleteAllQuestionImagessOfShadowCopyQuestion() throws Exception { -===================================================================== -Found a 7 line (37 tokens) duplication in the following files: -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 326 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(question)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().is2xxSuccessful()); - - // read the updated Question and check the version - mockMvc - .perform(get(API_QUESTIONS_URI + "/" + question.getId())) - .andExpect(status().isOk()) -===================================================================== -Found a 6 line (37 tokens) duplication in the following files: -Starting at line 220 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 251 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); - - // ASSERT - // read the related publication under the new url - mockMvc.perform(get(API_RELATED_PUBLICATION_URI + "/" + relatedPublication.getId())) - .andExpect(status().isOk()).andExpect(jsonPath("$.id", is(relatedPublication.getId()))) -===================================================================== -Found a 8 line (37 tokens) duplication in the following files: -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/domain/AuthorityTest.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/domain/UserTests.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/VariableTest.java - - boolean checkDifferent = authority1.equals(authority2); - - - // Assert - assertThat(checkNull, is(false)); - assertThat(checkClass, is(false)); - assertThat(checkSame, is(true)); - assertThat(checkDifferent, is(false)); -===================================================================== -Found a 6 line (37 tokens) duplication in the following files: -Starting at line 627 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 662 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 811 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - mockMvc.perform(delete(API_VARIABLES_URI + "/" + variable.getId())) - .andExpect(status().is2xxSuccessful()); - - // check that the variable has been deleted - mockMvc.perform(get(API_VARIABLES_URI + "/" + variable.getId())) - .andExpect(status().isNotFound()); -===================================================================== -Found a 5 line (37 tokens) duplication in the following files: -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/domain/QOrder.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QDaraUpdateQueueItem.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QShadowCopyQueueItem.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/QRelatedPublication.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QAbstractNestedSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/QElasticsearchIndicesVersion.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/QElasticsearchUpdateQueueItem.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/usermanagement/domain/QUser.java - - public static final QConcept concept = new QConcept("concept"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - public final ListPath authors = this.createList("authors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 3 line (37 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - public final ListPath authors = this.createList("authors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 6 line (37 tokens) duplication in the following files: -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QDataAcquisitionProject.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public static final QDataPackage dataPackage = new QDataPackage("dataPackage"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); -===================================================================== -Found a 11 line (37 tokens) duplication in the following files: -Starting at line 58 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString introduction = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("introduction")); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final StringPath number = createString("number"); -===================================================================== -Found a 3 line (37 tokens) duplication in the following files: -Starting at line 68 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 67 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public final ListPath nestedDataPackages = this.createList("nestedDataPackages", DataPackageNestedDocument.class, QDataPackageNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 3 line (37 tokens) duplication in the following files: -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 2 line (37 tokens) duplication in the following files: -Starting at line 122 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 149 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 181 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; -===================================================================== -Found a 2 line (37 tokens) duplication in the following files: -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java - - this.tags = inits.isInitialized("tags") ? new eu.dzhw.fdz.metadatamanagement.conceptmanagement.domain.QTags(forProperty("tags")) : null; - this.title = inits.isInitialized("title") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("title")) : null; -===================================================================== -Found a 2 line (37 tokens) duplication in the following files: -Starting at line 168 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 151 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 172 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 160 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; - this.release = inits.isInitialized("release") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QRelease(forProperty("release")) : null; -===================================================================== -Found a 3 line (37 tokens) duplication in the following files: -Starting at line 104 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 123 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath nestedSurveys = this.createList("nestedSurveys", SurveyNestedDocument.class, QSurveyNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedVariables = this.createList("nestedVariables", VariableNestedDocument.class, QVariableNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 5 line (36 tokens) duplication in the following files: -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageOverviewResource.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetReportResource.java - - @PathVariable("dataPackageId") String dataPackageId, @PathVariable("version") String version, - HttpServletRequest request, - @RequestParam(name = "languages", defaultValue = "de") List languages) - throws IOException { - taskService.startReportTasks(dataPackageId, version, languages, -===================================================================== -Found a 5 line (36 tokens) duplication in the following files: -Starting at line 96 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java - - DataPackageAttachmentMetadata metadata = mongoTemplate.getConverter() - .read(DataPackageAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } -===================================================================== -Found a 7 line (36 tokens) duplication in the following files: -Starting at line 207 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageManagementService.java -Starting at line 225 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetManagementService.java -Starting at line 208 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentManagementService.java -Starting at line 172 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionManagementService.java -Starting at line 238 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyManagementService.java - - public Optional read(String id) { - return crudHelper.read(id); - } - - @Override - @Secured(value = {AuthoritiesConstants.PUBLISHER, AuthoritiesConstants.DATA_PROVIDER}) - public void delete(DataPackage dataPackage) { -===================================================================== -Found a 8 line (36 tokens) duplication in the following files: -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageOverviewService.java -Starting at line 150 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetReportService.java - - String message = "data-package-management.error" + ".files-in-template-zip-incomplete"; - TemplateIncompleteException incompleteException = - new TemplateIncompleteException(message, missingTexFiles); - log.debug(message + missingTexFiles); - task = taskService.handleErrorTask(task, incompleteException); - return; - } - log.debug("Read the one file with freemarker code"); -===================================================================== -Found a 3 line (36 tokens) duplication in the following files: -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/helper/DataPackageAttachmentShadowCopyDataSource.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyShadowCopyDataSource.java - - copy.setDataAcquisitionProjectId( - source.getDataAcquisitionProjectId() + "-" + release.getVersion()); - copy.setDataPackageId(source.getDataPackageId() + "-" + release.getVersion()); -===================================================================== -Found a 7 line (36 tokens) duplication in the following files: -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/helper/DataPackageShadowCopyDataSource.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/helper/DataAcquisitionProjectShadowCopyDataSource.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyShadowCopyDataSource.java - - .filter(shadowCopy -> !dataPackageRepository.existsById(shadowCopy.getMasterId())); - } - - @Override - public void deleteExistingShadowCopies(String projectId, String version) { - String oldProjectId = projectId + "-" + version; - try (Stream dataPackages = dataPackageRepository -===================================================================== -Found a 5 line (36 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java - - DataSetAttachmentMetadata metadata = - mongoTemplate.getConverter().read(DataSetAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } -===================================================================== -Found a 5 line (36 tokens) duplication in the following files: -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java -Starting at line 161 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java - - InstrumentAttachmentMetadata metadata = - mongoTemplate.getConverter().read(InstrumentAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } -===================================================================== -Found a 3 line (36 tokens) duplication in the following files: -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentManagementService.java -Starting at line 197 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyManagementService.java - - Set instrumentIds = - questionRepository.streamIdsByConceptIdsContaining(concept.getId()) - .map(question -> question.getInstrumentId()).collect(Collectors.toSet()); -===================================================================== -Found a 9 line (36 tokens) duplication in the following files: -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 361 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - return sendEmail(null, emailAddresses.toArray(new String[emailAddresses.size()]), null, null, - subject, content, false, true); - } - - /** - * Send a mail to users who were added as publishers to a project. - */ - @Async - public void sendPublishersAddedMail(List publishers, String projectId, String sender) { -===================================================================== -Found a 4 line (36 tokens) duplication in the following files: -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/repository/DaraUpdateQueueItemRepositoryImpl.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java - - Query query = new Query(getUnlockedOrExpiredCriteria()).limit(BULK_SIZE); - Update update = new Update() - .set("updateStartedAt", updateStartedAt).set("updateStartedBy", updateStartedBy); - mongoOperations.updateMulti(query, update, DaraUpdateQueueItem.class); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataPackageSearchDocument.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataSetSearchDocument.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/VariableSearchDocument.java - - private List nestedRelatedPublications = new ArrayList<>(); - - private List surveys = new ArrayList<>(); - private List nestedSurveys = new ArrayList<>(); - - private List questions = new ArrayList<>(); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataPackageSearchDocument.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataSetSearchDocument.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/SurveySearchDocument.java - - private List nestedSurveys = new ArrayList<>(); - - private List questions = new ArrayList<>(); - private List nestedQuestions = new ArrayList<>(); - - private List instruments = new ArrayList<>(); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataPackageSearchDocument.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataSetSearchDocument.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/SurveySearchDocument.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/VariableSearchDocument.java - - private List nestedQuestions = new ArrayList<>(); - - private List instruments = new ArrayList<>(); - private List nestedInstruments = new ArrayList<>(); - - private List concepts = new ArrayList<>(); -===================================================================== -Found a 5 line (36 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java -Starting at line 178 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java - - SurveyAttachmentMetadata metadata = - mongoTemplate.getConverter().read(SurveyAttachmentMetadata.class, file.getMetadata()); - if (metadata.isShadow()) { - throw new ShadowCopyDeleteNotAllowedException(); - } -===================================================================== -Found a 4 line (36 tokens) duplication in the following files: -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageService.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageService.java - - private String getResponseRateFileNameGerman(String surveyId) { - String[] surveyNumberWithDollar = surveyId.split("-sy"); - String[] surveyNumber = surveyNumberWithDollar[1].split("\\$"); - return surveyNumber[0] + "_responserate_de"; -===================================================================== -Found a 5 line (36 tokens) duplication in the following files: -Starting at line 307 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 404 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java - - public static Instrument buildInstrument(String projectId, Integer instrumentNumber) { - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - List surveyIds = new ArrayList<>(); - surveyIds.add(UnitTestCreateValidIds.buildSurveyId(projectId, 1)); -===================================================================== -Found a 19 line (36 tokens) duplication in the following files: -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestUserManagementUtils.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestUserManagementUtils.java - - public static void login(String login, String password) { - // Empty Context (no user is logged) - SecurityContext securityContextEmpty = SecurityContextHolder.createEmptyContext(); - - // Login (!) - securityContextEmpty - .setAuthentication(new UsernamePasswordAuthenticationToken(login, password)); - - // Set Context with logged user. - SecurityContextHolder.setContext(securityContextEmpty); - } - - /** - * This helper methods log a account into the application by customuserdetails and password - * - * @param login - * @param password - */ - public static void login(CustomUserDetails login, String password) { -===================================================================== -Found a 11 line (36 tokens) duplication in the following files: -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { - this.conceptRepository.deleteAll(); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); - - // delete the file - mockMvc - .perform(delete("/api/concepts/" + conceptAttachmentMetadata.getConceptId() -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - .andExpect(status().is2xxSuccessful()); - - // ensure the uploaded file does not exist anymore - mockMvc - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); -===================================================================== -Found a 4 line (36 tokens) duplication in the following files: -Starting at line 197 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java -Starting at line 208 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 209 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java - - .perform(put("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments/" - + attachment.getOriginalFilename()).content(TestUtil.convertObjectToJsonBytes(current)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()); -===================================================================== -Found a 3 line (36 tokens) duplication in the following files: -Starting at line 259 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - mockMvc.perform(put("/api/concepts/" + concept.getId()) - .content(TestUtil.convertObjectToJsonBytes(concept)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 3 line (36 tokens) duplication in the following files: -Starting at line 125 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - .andExpect(jsonPath("$[2].id", is(concept.getId()))) - .andExpect(jsonPath("$[2].version", is(equalTo(0)))) - .andExpect(jsonPath("$[2].title.de", is(firstTitle))) -===================================================================== -Found a 8 line (36 tokens) duplication in the following files: -Starting at line 61 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DeleteAllDataPackagesResourceControllerTest.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DeleteAllDateSetsResourceControllerTest.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/DeleteAllInstrumentsResourceControllerTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/DeleteAllQuestionsResourceControllerTest.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/DeleteAllSurveysResourceControllerTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/DeleteAllVariablesResourceControllerTest.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); -===================================================================== -Found a 3 line (36 tokens) duplication in the following files: -Starting at line 274 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 199 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 96 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 193 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 224 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - mockMvc.perform(put("/api/data-packages/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 380 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 379 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 357 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - "/api/data-packages/" + dataPackageId + "/attachments/" + metadata.getFileName())) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-delete-not-allowed"))); - } - -} -===================================================================== -Found a 4 line (36 tokens) duplication in the following files: -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - .andExpect(jsonPath("$.content.length()", is(0))); - // ensure that there are still no pinned data packages - mockMvc.perform(get(API_DATAPACKAGE_URI + "?pinned=true")).andExpect(status().isOk()) - .andExpect(jsonPath("$.content.length()", is(0))); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 239 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - public void testCreateHiddenDataPackage() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); - dataPackage.setHidden(true); -===================================================================== -Found a 7 line (36 tokens) duplication in the following files: -Starting at line 269 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 284 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - public void testUpdateShadowCopyDataPackage() throws Exception { - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage("issue1991"); - dataPackage.setId(dataPackage.getId() + "-1.0.0"); - dataPackageRepository.save(dataPackage); - - mockMvc - .perform(put(API_DATAPACKAGE_URI + "/" + dataPackage.getId()) -===================================================================== -Found a 4 line (36 tokens) duplication in the following files: -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - mongoTemplate.getConverter().read(DataPackageAttachmentMetadata.class, shadowFile.getMetadata()); - - assertThat(metadata.getSuccessorId(), nullValue()); - assertThat(shadowFile.getMetadata().get("_contentType"), equalTo("text/plain")); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 187 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 183 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - DataPackageAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - release.setVersion("1.0.1"); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 149 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - DataPackageAttachmentMetadata shadow = createShadow(master, "1.0.0"); - createTestFileForAttachment(shadow); - release.setVersion("1.0.1"); - - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 175 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 212 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - .andExpect(status().is2xxSuccessful()); - - // ensure the uploaded file does not exist anymore - mockMvc - .perform(get("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); -===================================================================== -Found a 7 line (36 tokens) duplication in the following files: -Starting at line 227 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 247 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - public void testUploadAttachmentWithWrongLanguage() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataSetAttachmentMetadata dataSetAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildDataSetAttachmentMetadata("projectid", 1); - dataSetAttachmentMetadata.setLanguage("test"); -===================================================================== -Found a 3 line (36 tokens) duplication in the following files: -Starting at line 274 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 258 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 369 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - mockMvc.perform(put("/api/data-sets/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 299 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - .andExpect(status().isCreated()); - - // check that auditing attributes have been set - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.createdDate", not(isEmptyOrNullString()))) -===================================================================== -Found a 5 line (36 tokens) duplication in the following files: -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - mockMvc.perform(post(API_DATASETS_URI).content(TestUtil.convertObjectToJsonBytes(dataSet)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // check that auditing attributes have been set - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())).andExpect(status().isOk()) -===================================================================== -Found a 9 line (36 tokens) duplication in the following files: -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - // read the created attachment and check the version - mockMvc - .perform(get( - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect( - jsonPath("$.[0].instrumentId", is(instrumentAttachmentMetadata.getInstrumentId()))) -===================================================================== -Found a 7 line (36 tokens) duplication in the following files: -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 160 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - // ensure the uploaded file exists - mockMvc - .perform(get( - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 7 line (36 tokens) duplication in the following files: -Starting at line 209 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 228 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - public void testUploadAttachmentWithWrongType() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - InstrumentAttachmentMetadata instrumentAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildInstrumentAttachmentMetadata("projectid", 1); - instrumentAttachmentMetadata.setType(new I18nString("hurz", "hurz")); -===================================================================== -Found a 3 line (36 tokens) duplication in the following files: -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - mockMvc.perform(put("/api/instruments/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 11 line (36 tokens) duplication in the following files: -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { -===================================================================== -Found a 9 line (36 tokens) duplication in the following files: -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 433 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - buildValidProject(); - - // Act & Assert - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_POST_VALIDATION_URI)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.errors", hasSize(0)));//no errors - } - - private DataAcquisitionProject buildValidProject() { -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 416 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 432 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - applyNotReadyState(dataAcquisitionProject); - rdcProjectRepository.save(dataAcquisitionProject); - - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_POST_VALIDATION_URI)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.errors", hasSize(1))) -===================================================================== -Found a 8 line (36 tokens) duplication in the following files: -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @After - public void cleanUp() { - rdcProjectRepository.deleteAll(); -===================================================================== -Found a 10 line (36 tokens) duplication in the following files: -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 64 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - greenMail.start(); - } - - @After - public void cleanUp() { - dataAcquisitionProjectRepository.deleteAll(); - shadowCopyQueueItemRepository.deleteAll(); - elasticsearchUpdateQueueItemRepository.deleteAll(); - elasticsearchAdminService.recreateAllIndices(); - javersService.deleteAll(); -===================================================================== -Found a 5 line (36 tokens) duplication in the following files: -Starting at line 108 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 150 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java - - .andExpect(status().isNotFound()); - - this.mockMvc - .perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + projectId + "/shadows/1.0.0/action")) - .andExpect(status().isOk()).andExpect(jsonPath("$.size()", is(0))); -===================================================================== -Found a 7 line (36 tokens) duplication in the following files: -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 125 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 161 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 194 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .andExpect(status().isCreated()); - - // read the created attachment and check the version - mockMvc.perform( - get("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.[0].surveyId", is(surveyAttachmentMetadata.getSurveyId()))) -===================================================================== -Found a 7 line (36 tokens) duplication in the following files: -Starting at line 207 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 227 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 283 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - public void testUploadAttachmentWithWrongLanguage() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - SurveyAttachmentMetadata surveyAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildSurveyAttachmentMetadata("projectid", 1); - surveyAttachmentMetadata.setLanguage("test"); -===================================================================== -Found a 3 line (36 tokens) duplication in the following files: -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 297 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 323 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 335 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(put("/api/surveys/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 8 line (36 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 290 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 316 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - public void testCreateValidSurvey() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - rdcProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - // create the survey with the given id - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) -===================================================================== -Found a 5 line (36 tokens) duplication in the following files: -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(post(API_SURVEYS_URI).content(TestUtil.convertObjectToJsonBytes(survey)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the survey under the new url - mockMvc.perform(get(API_SURVEYS_URI + "/" + survey.getId())).andExpect(status().isOk()); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - public void testCreateSurveyWithMixedMethodDataType() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - rdcProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - survey.setDataType(I18nString.builder().de("Mixed Methods").en("Mixed Methods").build()); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 392 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 406 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - public void testUpdateShadowCopySurvey() throws Exception { - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey("issue1991"); - survey.setId(survey.getId() + "-1.0.0"); - surveyRepository.save(survey); - - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) -===================================================================== -Found a 7 line (36 tokens) duplication in the following files: -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 193 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - UnitTestUserManagementUtils.login(user.getLogin(), user.getPassword()); - - // Act - - // Assert - this.restMvc.perform(post("/api/account").contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(dto))).andExpect(status().isOk()); -===================================================================== -Found a 8 line (36 tokens) duplication in the following files: -Starting at line 240 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 266 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - dto.setNewPassword("newPassword"); - - // Act - - // Assert - this.restMvc.perform(post("/api/account/reset-password/finish") - .contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(dto))) - .andExpect(status().isOk()); -===================================================================== -Found a 11 line (36 tokens) duplication in the following files: -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/common/domain/QAbstractShadowableRdcDomainObject.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/common/domain/QTask.java - - public static final QAbstractShadowableRdcDomainObject abstractShadowableRdcDomainObject = new QAbstractShadowableRdcDomainObject("abstractShadowableRdcDomainObject"); - - public final QAbstractRdcDomainObject _super = new QAbstractRdcDomainObject(this); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final BooleanPath hidden = createBoolean("hidden"); -===================================================================== -Found a 9 line (36 tokens) duplication in the following files: -Starting at line 33 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/common/domain/QAbstractShadowableRdcDomainObject.java -Starting at line 66 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final StringPath id = _super.id; - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); -===================================================================== -Found a 9 line (36 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/common/domain/QTask.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java - - public final QAbstractRdcDomainObject _super = new QAbstractRdcDomainObject(this); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final eu.dzhw.fdz.metadatamanagement.common.rest.errors.QErrorListDto errorList; -===================================================================== -Found a 11 line (36 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 24 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QShadowCopyQueueItem.java -Starting at line 31 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final StringPath dataPackageId = createString("dataPackageId"); -===================================================================== -Found a 11 line (36 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/domain/QOrder.java -Starting at line 22 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QDaraUpdateQueueItem.java -Starting at line 22 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/QElasticsearchIndicesVersion.java - - public final EnumPath client = createEnum("client", OrderClient.class); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath id = createString("id"); - - public final StringPath languageKey = createString("languageKey"); -===================================================================== -Found a 6 line (36 tokens) duplication in the following files: -Starting at line 55 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 66 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final StringPath id = _super.id; - - public final ListPath instruments = this.createList("instruments", InstrumentSubDocument.class, QInstrumentSubDocument.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; -===================================================================== -Found a 10 line (36 tokens) duplication in the following files: -Starting at line 61 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString guiLabels; - - //inherited - public final BooleanPath hidden = _super.hidden; - - //inherited - public final StringPath id = _super.id; - - //inherited - public final ListPath institutions = _super.institutions; -===================================================================== -Found a 7 line (36 tokens) duplication in the following files: -Starting at line 116 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath> surveyNumbers; - - public final ListPath surveys = this.createList("surveys", SurveySubDocument.class, QSurveySubDocument.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString type; -===================================================================== -Found a 11 line (36 tokens) duplication in the following files: -Starting at line 43 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final NumberPath instrumentNumber = createNumber("instrumentNumber", Integer.class); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final StringPath number = createString("number"); -===================================================================== -Found a 1 line (36 tokens) duplication in the following files: -Starting at line 55 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java -Starting at line 55 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java - - public final ListPath> relatedQuestions = this.>createList("relatedQuestions", eu.dzhw.fdz.metadatamanagement.variablemanagement.domain.projections.RelatedQuestionSubDocumentProjection.class, SimplePath.class, PathInits.DIRECT2); -===================================================================== -Found a 7 line (35 tokens) duplication in the following files: -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/GenericDomainObjectCrudHelper.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/GenericShadowableDomainObjectCrudHelper.java - - repository.delete(domainObject); - if (elasticsearchType != null) { - elasticsearchUpdateQueueService.enqueue(domainObject.getId(), this.elasticsearchType, - ElasticsearchUpdateQueueAction.DELETE); - // flush the current changes - elasticsearchUpdateQueueService.processQueueItems(this.elasticsearchType); - } -===================================================================== -Found a 5 line (35 tokens) duplication in the following files: -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptAttachmentVersionsService.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentVersionsService.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentVersionsService.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentVersionsService.java -Starting at line 67 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentVersionsService.java - - Stream> shadows = - javers.findShadowsAndStream(jqlQuery.build()); - shadows = shadows.skip(skip).limit(limit); - - return shadows.map(shadow -> { -===================================================================== -Found a 13 line (35 tokens) duplication in the following files: -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/DataPackage.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/DataSet.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/DataSetAttachmentMetadata.java -Starting at line 202 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/Instrument.java -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/InstrumentAttachmentMetadata.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/DataAcquisitionProject.java -Starting at line 235 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/Question.java -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QuestionImageMetadata.java -Starting at line 214 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/Survey.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/SurveyAttachmentMetadata.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/SurveyResponseRateImageMetadata.java -Starting at line 344 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/Variable.java - - BeanUtils.copyProperties(dataPackage, this); - } - - @Override - protected void setMasterIdInternal(String masterId) { - this.masterId = masterId; - } - - @Override - protected void setIdInternal(String id) { - this.id = id; - } -} -===================================================================== -Found a 5 line (35 tokens) duplication in the following files: -Starting at line 30 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DaraOaiPmhClient.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataCiteClient.java - - public DaraOaiPmhClient() { - restTemplate = new RestTemplate(new HttpComponentsClientHttpRequestFactory()); - restTemplate.getMessageConverters().add(0, - new StringHttpMessageConverter(Charset.forName("UTF-8"))); - } -===================================================================== -Found a 9 line (35 tokens) duplication in the following files: -Starting at line 175 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageOverviewService.java -Starting at line 272 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetReportService.java -Starting at line 468 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DaraService.java - - ESCAPE_PREFIX + templateContent + ESCAPE_SUFFIX, templateConfiguration); - - try (Writer stringWriter = new StringWriter()) { - texTemplate.process(dataForTemplate, stringWriter); - - stringWriter.flush(); - return stringWriter.toString(); - } - } -===================================================================== -Found a 5 line (35 tokens) duplication in the following files: -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetManagementService.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetManagementService.java -Starting at line 187 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetManagementService.java - - variableRepository.streamIdsByRelatedQuestionsQuestionId(question.getId()) - .map(variable -> variable.getDataSetId()).collect(Collectors.toSet()); - return dataSetRepository.streamIdsByIdIn(dataSetIds); - }, ElasticsearchType.data_sets); - } -===================================================================== -Found a 16 line (35 tokens) duplication in the following files: -Starting at line 20 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/validation/ValidInstrumentIdPatternValidator.java -Starting at line 30 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/validation/ValidUniqueInstrumentNumberValidator.java - - public void initialize(ValidInstrumentIdPattern constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Instrument instrument, ConstraintValidatorContext context) { - - if (instrument.isShadow()) { - return true; - } else { - // check precondition - if (instrument.getDataAcquisitionProjectId() == null || instrument.getId() == null -===================================================================== -Found a 9 line (35 tokens) duplication in the following files: -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 361 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - return sendEmail(null, emailAddresses.toArray(new String[emailAddresses.size()]), null, null, - subject, content, false, true); - } - - /** - * Send an mail, if an automatic update to dara was not successful. - */ - @Async - public Future sendMailOnDaraAutomaticUpdateError(List admins, String projectId) { -===================================================================== -Found a 5 line (35 tokens) duplication in the following files: -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchAdminService.java -Starting at line 218 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchAdminService.java - - resourceLoader.getResource("classpath:elasticsearch/settings.json").getInputStream(); - Reader reader = new InputStreamReader(inputStream, "UTF-8");) { - return FileCopyUtils.copyToString(reader); - } catch (IOException e) { - throw new RuntimeException("Unable to load settings!", e); -===================================================================== -Found a 7 line (35 tokens) duplication in the following files: -Starting at line 346 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 433 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 472 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 542 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java -Starting at line 635 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - projectRepository.findById(instrument.getDataAcquisitionProjectId()).orElse(null); - if (project == null) { - // project has been deleted, skip upsert - return false; - } - Release release = getRelease(project); - Configuration configuration = project.getConfiguration(); -===================================================================== -Found a 16 line (35 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/validation/ValidSurveyIdNameValidator.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/validation/ValidUniqueSurveyNumberValidator.java - - public void initialize(ValidSurveyIdName constraintAnnotation) { - } - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Survey survey, ConstraintValidatorContext context) { - if (survey.isShadow()) { - return true; - } else { - // check for set project id - if (survey.getId() == null || survey.getDataAcquisitionProjectId() == null -===================================================================== -Found a 14 line (35 tokens) duplication in the following files: -Starting at line 22 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/ValidDerivedVariablesIdentifierValidator.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/ValidRepeatedMeasurementIdentifierValidator.java -Starting at line 24 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/ValidVariableIdNameValidator.java - - public void initialize(ValidDerivedVariablesIdentifier constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Variable variable, ConstraintValidatorContext context) { - if (variable.isShadow()) { - return true; - } else { - if (variable.getDerivedVariablesIdentifier() == null) { -===================================================================== -Found a 6 line (35 tokens) duplication in the following files: -Starting at line 29 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/config/locale/AngularCookieLocaleResolverTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/config/locale/AngularCookieLocaleResolverTest.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/config/locale/AngularCookieLocaleResolverTest.java - - public void testResolveLocale() { - // Arrange - AngularCookieLocaleResolver resolver = new AngularCookieLocaleResolver(); - HttpServletRequest servlet = Mockito.mock(HttpServletRequest.class); - when(servlet.getAttribute(CookieLocaleResolver.LOCALE_REQUEST_ATTRIBUTE_NAME)) - .thenReturn(Locale.GERMAN); -===================================================================== -Found a 7 line (35 tokens) duplication in the following files: -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/domain/I18nStringTest.java -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/domain/PeriodTest.java - - assertThat(checkSameButDifferentNoEnPart, is(false)); - assertThat(checkSameButDifferent, is(true)); - assertThat(checkSameButDifferentStart, is(false)); - assertThat(checkSameButDifferentEnd, is(false)); - } - -} -===================================================================== -Found a 5 line (35 tokens) duplication in the following files: -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 214 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); - - // read the concept under the new url - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId())).andExpect(status().isOk()) - .andExpect(jsonPath("$.id", is(concept.getId()))).andExpect(jsonPath("$.version", is(1))) -===================================================================== -Found a 5 line (35 tokens) duplication in the following files: -Starting at line 206 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 302 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 326 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); - - // read the dataPackage under the new url - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getId())).andExpect(status().isOk()) - .andExpect(jsonPath("$.id", is(dataPackage.getId()))) -===================================================================== -Found a 6 line (35 tokens) duplication in the following files: -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 88 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - mongoTemplate.getConverter().read(DataPackageAttachmentMetadata.class, gridFsFile.getMetadata()); - - assertThat(gridFsFile, notNullValue()); - assertThat(metaData, notNullValue()); - assertThat(metaData.getId(), - equalTo("/public/files/data-packages/stu-" + PROJECT_ID + "$-1.0.0/attachments/filename.txt")); -===================================================================== -Found a 11 line (35 tokens) duplication in the following files: -Starting at line 306 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 344 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - .andExpect(jsonPath("$.description.de", is("Angepasst."))); - - elasticsearchUpdateQueueService.processAllQueueItems(); - - // check that there is one data set documents - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(1L)); - } - - @Test - @WithMockUser(authorities=AuthoritiesConstants.PUBLISHER) - public void testCreateShadowCopyDataSet() throws Exception { -===================================================================== -Found a 7 line (35 tokens) duplication in the following files: -Starting at line 371 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 324 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 809 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .andExpect(status().isCreated()); - - mockMvc.perform(delete("/api/data-acquisition-projects/" + project.getId())) - .andExpect(status().is2xxSuccessful()); - - // check that the DataSet has been deleted - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) -===================================================================== -Found a 6 line (35 tokens) duplication in the following files: -Starting at line 77 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java - - public void createShadowCopy() throws Exception { - DataSetAttachmentMetadata master = - UnitTestCreateDomainObjectUtils.buildDataSetAttachmentMetadata(PROJECT_ID, 1); - master.generateId(); - master.setMasterId(master.getId()); - createTestFileForAttachment(master); -===================================================================== -Found a 6 line (35 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 169 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(1L)); - - // check that auditing attributes have been set - mockMvc.perform(get(API_INSTRUMENTS_URI + "/" + instrument.getId())) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.createdDate", not(isEmptyOrNullString()))) -===================================================================== -Found a 6 line (35 tokens) duplication in the following files: -Starting at line 77 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java - - public void createShadowCopy() throws Exception { - InstrumentAttachmentMetadata master = - UnitTestCreateDomainObjectUtils.buildInstrumentAttachmentMetadata(PROJECT_ID, 1); - master.generateId(); - master.setMasterId(master.getId()); - createTestFileForAttachment(master); -===================================================================== -Found a 4 line (35 tokens) duplication in the following files: -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/logmanagement/rest/LogsResourceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResourceTest.java - - this.restUserMockMvc.perform(get("/api/logs").accept(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andReturn(); -===================================================================== -Found a 8 line (35 tokens) duplication in the following files: -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java -Starting at line 791 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testReleaseShadowThrowsError() throws Exception { -===================================================================== -Found a 17 line (35 tokens) duplication in the following files: -Starting at line 26 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 26 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - -public class DataAcquisitionProjectLastReleaseResourceTest extends AbstractTest { - private static final String API_DATA_ACQUISITION_PROJECTS_URI = "/api/data-acquisition-projects"; - - @Autowired - private WebApplicationContext wac; - - @Autowired - private DataAcquisitionProjectRepository dataAcquisitionProjectRepository; - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; -===================================================================== -Found a 7 line (35 tokens) duplication in the following files: -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 343 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 433 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - buildValidProject(); - - // Act & Assert - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_POST_VALIDATION_URI)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.errors", hasSize(0)));//no errors - } -===================================================================== -Found a 6 line (35 tokens) duplication in the following files: -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 192 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(1L)); - - // check that auditing attributes have been set - mockMvc.perform(get(API_QUESTIONS_URI + "/" + question.getId())) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.createdDate", not(isEmptyOrNullString()))) -===================================================================== -Found a 6 line (35 tokens) duplication in the following files: -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java - - public void createShadowCopy() throws Exception { - QuestionImageMetadata master = - UnitTestCreateDomainObjectUtils.buildQuestionImageMetadata(PROJECT_ID, QUESTION_ID); - master.generateId(); - master.setMasterId(master.getId()); - createTestFileForAttachment(master); -===================================================================== -Found a 6 line (35 tokens) duplication in the following files: -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - public void createShadowCopy() throws Exception { - SurveyAttachmentMetadata master = - UnitTestCreateDomainObjectUtils.buildSurveyAttachmentMetadata(PROJECT_ID, 1); - master.generateId(); - master.setMasterId(master.getId()); - createTestFileForAttachment(master); -===================================================================== -Found a 5 line (35 tokens) duplication in the following files: -Starting at line 174 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 189 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - public void testSaveAccount() throws Exception { - // Arrange - Optional userO = this.userRepository.findOneByLogin("admin"); - User user = userO.get(); - UserDto dto = new UserDto(user); -===================================================================== -Found a 6 line (35 tokens) duplication in the following files: -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/service/UserServiceTest.java -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/service/UserServiceTest.java - - public void assertThatResetKeyMustNotBeOlderThan24Hours() { - User user = userService.createUserInformation("johndoe", "johndoe", "John", "Doe", - "john.doe@localhost", "en-US"); - - LocalDateTime daysAgo = LocalDateTime.now() - .minusHours(25); -===================================================================== -Found a 5 line (35 tokens) duplication in the following files: -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 662 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(1L)); - - // check that auditing attributes have been set - mockMvc.perform(get(API_VARIABLES_URI + "/" + variable.getId())).andExpect(status().isOk()) - .andExpect(jsonPath("$.createdDate", not(isEmptyOrNullString()))) -===================================================================== -Found a 9 line (35 tokens) duplication in the following files: -Starting at line 35 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/common/domain/QTask.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 30 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QDaraUpdateQueueItem.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath location = createString("location"); -===================================================================== -Found a 11 line (35 tokens) duplication in the following files: -Starting at line 38 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 32 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QShadowCopyQueueItem.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/QElasticsearchUpdateQueueItem.java - - public final StringPath doi = createString("doi"); - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath license = createString("license"); -===================================================================== -Found a 4 line (35 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 22 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); -===================================================================== -Found a 11 line (35 tokens) duplication in the following files: -Starting at line 26 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 24 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QShadowCopyQueueItem.java -Starting at line 31 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); - - public final ListPath dataCurators = this.createList("dataCurators", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 9 line (35 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath institutions = this.createList("institutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); -===================================================================== -Found a 11 line (35 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QDataAcquisitionProject.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final ListPath institutions = this.createList("institutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final ListPath projectContributors = this.createList("projectContributors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 3 line (35 tokens) duplication in the following files: -Starting at line 54 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 101 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java - - public final StringPath masterId = createString("masterId"); - - public final ListPath projectContributors = this.createList("projectContributors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 3 line (35 tokens) duplication in the following files: -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 65 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 55 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java -Starting at line 97 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final ListPath surveyIds = this.createList("surveyIds", String.class, StringPath.class, PathInits.DIRECT2); - - public final ListPath> surveyNumbers = this.>createList("surveyNumbers", Integer.class, NumberPath.class, PathInits.DIRECT2); -===================================================================== -Found a 4 line (35 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString additionalQuestionText = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("additionalQuestionText")); -===================================================================== -Found a 8 line (35 tokens) duplication in the following files: -Starting at line 61 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java - - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final StringPath number = createString("number"); -===================================================================== -Found a 8 line (35 tokens) duplication in the following files: -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java - - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final StringPath number = createString("number"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString questionText = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("questionText")); -===================================================================== -Found a 11 line (35 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/QRelatedPublication.java -Starting at line 22 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSubDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); - - public final StringPath authors = createString("authors"); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final ListPath dataPackageIds = this.createList("dataPackageIds", String.class, StringPath.class, PathInits.DIRECT2); -===================================================================== -Found a 9 line (35 tokens) duplication in the following files: -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QAbstractNestedSubDocument.java -Starting at line 33 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/QElasticsearchIndicesVersion.java - - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - //inherited - public final NumberPath version = _super.version; - - public QAbstractNestedSubDocument(String variable) { -===================================================================== -Found a 2 line (35 tokens) duplication in the following files: -Starting at line 67 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptNestedDocument.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 77 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 149 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 77 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationNestedDocument.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java -Starting at line 77 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java - - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; - this.createdBy = _super.createdBy; -===================================================================== -Found a 3 line (35 tokens) duplication in the following files: -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public final ListPath dataPackages = this.createList("dataPackages", DataPackageSubDocument.class, QDataPackageSubDocument.class, PathInits.DIRECT2); - - public final ListPath dataSets = this.createList("dataSets", DataSetSubDocument.class, QDataSetSubDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 11 line (35 tokens) duplication in the following files: -Starting at line 47 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.description); - - //inherited - public final StringPath doi = _super.doi; - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString guiLabels; - - //inherited - public final StringPath id = _super.id; - - public final ListPath instruments = this.createList("instruments", InstrumentSubDocument.class, QInstrumentSubDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 4 line (35 tokens) duplication in the following files: -Starting at line 57 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath instruments = this.createList("instruments", InstrumentSubDocument.class, QInstrumentSubDocument.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; -===================================================================== -Found a 3 line (35 tokens) duplication in the following files: -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedInstruments = this.createList("nestedInstruments", InstrumentNestedDocument.class, QInstrumentNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 3 line (35 tokens) duplication in the following files: -Starting at line 83 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 99 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 102 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java - - public final ListPath questions = this.createList("questions", QuestionSubDocument.class, QQuestionSubDocument.class, PathInits.DIRECT2); - - public final StringPath release = createString("release"); -===================================================================== -Found a 5 line (35 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 133 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 129 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath surveys = this.createList("surveys", SurveySubDocument.class, QSurveySubDocument.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.conceptmanagement.domain.QTags tags = new eu.dzhw.fdz.metadatamanagement.conceptmanagement.domain.QTags(_super.tags); -===================================================================== -Found a 12 line (35 tokens) duplication in the following files: -Starting at line 59 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final StringPath doi = createString("doi"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString guiLabels; - - //inherited - public final BooleanPath hidden = _super.hidden; - - //inherited - public final StringPath id = _super.id; - - //inherited - public final ListPath institutions = _super.institutions; -===================================================================== -Found a 4 line (35 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java - - public final ListPath instruments = this.createList("instruments", InstrumentSubDocument.class, QInstrumentSubDocument.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; -===================================================================== -Found a 3 line (35 tokens) duplication in the following files: -Starting at line 83 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 84 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath nestedConcepts = this.createList("nestedConcepts", ConceptNestedDocument.class, QConceptNestedDocument.class, PathInits.DIRECT2); - - public final ListPath nestedDataSets = this.createList("nestedDataSets", DataSetNestedDocument.class, QDataSetNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 2 line (35 tokens) duplication in the following files: -Starting at line 168 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 150 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 169 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 159 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 182 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; - this.release = inits.isInitialized("release") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QRelease(forProperty("release")) : null; -===================================================================== -Found a 2 line (35 tokens) duplication in the following files: -Starting at line 169 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java - - this.release = inits.isInitialized("release") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QRelease(forProperty("release")) : null; - this.surveyPeriod = inits.isInitialized("surveyPeriod") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QPeriod(forProperty("surveyPeriod")) : null; -===================================================================== -Found a 2 line (35 tokens) duplication in the following files: -Starting at line 80 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 90 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 80 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java - - this.description = inits.isInitialized("description") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")) : null; - this.lastModifiedBy = _super.lastModifiedBy; -===================================================================== -Found a 5 line (35 tokens) duplication in the following files: -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java - - public final ListPath accessWays = this.createList("accessWays", String.class, StringPath.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations; -===================================================================== -Found a 2 line (35 tokens) duplication in the following files: -Starting at line 84 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java -Starting at line 84 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java - - this.questionText = inits.isInitialized("questionText") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("questionText")) : null; - this.version = _super.version; -===================================================================== -Found a 4 line (34 tokens) duplication in the following files: -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/rest/I18nResourceController.java -Starting at line 26 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataFormatsResource.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveySampleTypeResource.java -Starting at line 33 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/UnitValueResource.java - - public ResponseEntity> getCountryCodes() { - return ResponseEntity.ok() - .cacheControl(CacheControl.maxAge(0, TimeUnit.DAYS).mustRevalidate().cachePublic()) - .eTag(ETAG.toString()) -===================================================================== -Found a 10 line (34 tokens) duplication in the following files: -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/Concept.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/DataPackage.java -Starting at line 26 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/domain/Order.java - -@Document(collection = "concepts") -@EqualsAndHashCode(callSuper = false, of = "id") -@ToString(callSuper = true) -@NoArgsConstructor -@Data -@AllArgsConstructor -@Builder -@Schema( - description = "Go here" -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 19 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/validation/ConceptExists.java -Starting at line 19 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/validation/DataPackageExists.java -Starting at line 19 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/validation/VariableExists.java - -@Constraint(validatedBy = {ConceptExistsValidator.class}) -@Repeatable(List.class) -@Target({ElementType.TYPE, ElementType.TYPE_USE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface ConceptExists { -===================================================================== -Found a 9 line (34 tokens) duplication in the following files: -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/helper/DataPackageShadowCopyDataSource.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/helper/DataSetShadowCopyDataSource.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentShadowCopyDataSource.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionShadowCopyDataSource.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/helper/SurveyShadowCopyDataSource.java -Starting at line 123 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/helper/VariableShadowCopyDataSource.java - - dataPackages.forEach(crudHelper::deleteShadow); - } - } - - @Override - public void updateElasticsearch(String dataAcquisitionProjectId, String releaseVersion, - String previousVersion) { - elasticsearchUpdateQueueService.enqueueUpsertsAsync(() -> { - return dataPackageRepository -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 299 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 378 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - log.debug("Sending activation e-mail to '{}'", user.getEmail()); - Locale locale = Locale.forLanguageTag(user.getLangKey()); - Context context = new Context(locale); - context.setVariable("user", user); - context.setVariable("baseUrl", baseUrl); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 236 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 264 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - public void sendAssigneeGroupChangedMail(List users, String projectId, String message, - String sender, User currentUser) { - - if (!users.isEmpty()) { - log.debug("Sending 'assignee group changed mail'"); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectAttachmentsResourceController.java -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectAttachmentsResourceController.java - - ArrayList::new)); - } - - private List sort(List attachments, Function firstOrderCriteria, - Function secondOrderCriteria) { -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataPackageSearchDocument.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/DataSetSearchDocument.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/SurveySearchDocument.java - - private List nestedInstruments = new ArrayList<>(); - - private List concepts = new ArrayList<>(); - private List nestedConcepts = new ArrayList<>(); - - private List nestedInstitutions = new ArrayList<>(); -===================================================================== -Found a 4 line (34 tokens) duplication in the following files: -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java - - .is(updateStartedAt))).limit(BULK_SIZE) - .with(Sort.by(Direction.ASC, "createdDate")); - return mongoOperations.find(query, ElasticsearchUpdateQueueItem.class); - } -===================================================================== -Found a 3 line (34 tokens) duplication in the following files: -Starting at line 29 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/usermanagement/repository/OAuth2AccessTokenRepositoryImpl.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/usermanagement/repository/OAuth2RefreshTokenRepositoryImpl.java - - public OAuth2AuthenticationAccessToken findByTokenId(final String tokenId) { - final Query query = Query.query(Criteria.where(ID).is(tokenId)); - return mongoTemplate.findOne(query, OAuth2AuthenticationAccessToken.class); -===================================================================== -Found a 4 line (34 tokens) duplication in the following files: -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 183 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 190 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java - - .description(I18nString.builder().de("Description DE") - .en("Description 3 EN") - .build()).build()); - subDataSets.add(SubDataSet.builder().name(UnitTestCreateValidIds.buildDataSetId(projectId, 2)) -===================================================================== -Found a 4 line (34 tokens) duplication in the following files: -Starting at line 405 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 364 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - List surveyIds = new ArrayList<>(); - surveyIds.add(surveyId); -===================================================================== -Found a 10 line (34 tokens) duplication in the following files: -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java -Starting at line 67 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 67 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/rest/SearchResourceTest.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { -===================================================================== -Found a 7 line (34 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - conceptAttachmentMetadata.generateId(); - - // read the created attachment and check the version - mockMvc.perform( - get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.[0].conceptId", is(conceptAttachmentMetadata.getConceptId()))) -===================================================================== -Found a 4 line (34 tokens) duplication in the following files: -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 205 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 221 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 219 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 169 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 199 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .andExpect(jsonPath("$.[0].version", is(0))) - .andExpect(jsonPath("$.[0].createdBy", is("test"))) - .andExpect(jsonPath("$.[0].lastModifiedBy", is("test"))) - .andExpect(jsonPath("$.[0].id", is("/public/files/concepts/" -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 278 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - .andExpect(status().is2xxSuccessful()); - - // ensure the uploaded file does not exist anymore - mockMvc - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); -===================================================================== -Found a 7 line (34 tokens) duplication in the following files: -Starting at line 213 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 233 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - public void testUploadAttachmentWithWrongType() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - ConceptAttachmentMetadata conceptAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildConceptAttachmentMetadata("con-conceptid$"); - conceptAttachmentMetadata.setType(new I18nString("hurz","hurz")); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java - - mockMvc.perform(post(API_CONCEPT_URI).content(TestUtil.convertObjectToJsonBytes(concept)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the concept under the new url - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId())).andExpect(status().isOk()); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 166 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 217 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 239 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 67 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 161 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 235 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 264 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - public void testGetAccessWaysOfDataPackage() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - DataPackage dataPackage = UnitTestCreateDomainObjectUtils.buildDataPackage(project.getId()); -===================================================================== -Found a 9 line (34 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 175 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - dataPackageAttachmentMetadata.generateId(); - - // read the created attachment and check the version - mockMvc - .perform(get("/api/data-packages/" - + dataPackageAttachmentMetadata.getDataPackageId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect( - jsonPath("$.[0].dataPackageId", is(dataPackageAttachmentMetadata.getDataPackageId()))) -===================================================================== -Found a 7 line (34 tokens) duplication in the following files: -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 212 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - dataPackageAttachmentMetadata.generateId(); - - // ensure that there is one attachment - mockMvc - .perform(get("/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() - + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 175 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 212 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 291 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - .andExpect(status().is2xxSuccessful()); - - // ensure the uploaded file does not exist anymore - mockMvc.perform(get( - "/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); -===================================================================== -Found a 7 line (34 tokens) duplication in the following files: -Starting at line 231 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 250 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 301 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - public void testUploadAttachmentWithWrongType() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataPackageAttachmentMetadata dataPackageAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildDataPackageAttachmentMetadata("projectid"); - dataPackageAttachmentMetadata.setType(new I18nString("hurz", "hurz")); -===================================================================== -Found a 3 line (34 tokens) duplication in the following files: -Starting at line 149 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 206 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 183 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 211 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 337 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 349 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 361 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 369 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - mockMvc.perform(put("/api/data-acquisition-projects" + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isNoContent()); -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 224 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - .perform(post(API_DATAPACKAGE_URI).content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); - - // read the dataPackage under the new url - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getId())) -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java - - equalTo("/data-packages/stu-" + PROJECT_ID + "$-1.0.0/attachments/filename.txt")); - - List expectedFiles = new ArrayList<>(); - expectedFiles.add("/data-packages/stu-" + PROJECT_ID + "$/attachments/filename.txt"); - expectedFiles.add("/data-packages/stu-" + PROJECT_ID + "$-1.0.0/attachments/filename.txt"); -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - .getResource("/data-packages/stu-" + PROJECT_ID + "$-1.0.0/attachments/filename.txt"); - assertThat(shadowCopy.getOptions().getMetadata().get("_contentType"), equalTo("text/plain")); - } - - @Test - public void createShadowCopyWithSameReleaseVersion() throws Exception { -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 174 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - .getResource("/data-packages/stu-" + PROJECT_ID + "$-1.0.0/attachments/filename.txt"); - assertThat(predecessor.getOptions().getMetadata().get("_contentType"), equalTo("text/plain")); - } - - @Test - public void createShadowCopyWithDeletedMaster() throws Exception { -===================================================================== -Found a 3 line (34 tokens) duplication in the following files: -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 159 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectShadowCopyServiceTest.java -Starting at line 160 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - Optional persistedShadow = dataPackageRepository.findById(shadow.getId()); - assertThat(persistedShadow.isPresent(), equalTo(true)); - assertThat(persistedShadow.get().getSuccessorId(), nullValue()); -===================================================================== -Found a 4 line (34 tokens) duplication in the following files: -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectShadowCopyServiceTest.java -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 108 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - Optional persistedShadow = dataPackageRepository.findById(shadow.getId()); - - assertThat(persistedShadow.isPresent(), equalTo(true)); - assertThat(persistedShadow.get().getSuccessorId(), equalTo("DELETED")); -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 227 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 247 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataSetAttachmentMetadata dataSetAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildDataSetAttachmentMetadata("projectid", 1); -===================================================================== -Found a 7 line (34 tokens) duplication in the following files: -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 175 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 212 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - dataSetAttachmentMetadata.generateId(); - - // read the created attachment and check the version - mockMvc.perform( - get("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.[0].dataSetId", is(dataSetAttachmentMetadata.getDataSetId()))) -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 175 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 293 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - .andExpect(status().is2xxSuccessful()); - - // ensure the uploaded file does not exist anymore - mockMvc - .perform(get("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(0))); -===================================================================== -Found a 7 line (34 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 194 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 357 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - public void testCreateDataSet() throws Exception { - - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); -===================================================================== -Found a 3 line (34 tokens) duplication in the following files: -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 258 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 369 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 129 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 318 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); - - // Act and Assert - // create the variable with the given id - mockMvc.perform(post(API_DATASETS_URI).content(TestUtil.convertObjectToJsonBytes(dataSet)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 258 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 369 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - mockMvc.perform(post(API_DATASETS_URI).content(TestUtil.convertObjectToJsonBytes(dataSet)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // check that auditing attributes have been set - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())).andExpect(status().isOk()) -===================================================================== -Found a 3 line (34 tokens) duplication in the following files: -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 188 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 219 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 242 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 297 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 335 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); -===================================================================== -Found a 7 line (34 tokens) duplication in the following files: -Starting at line 371 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 277 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 324 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 365 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 809 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .andExpect(status().isCreated()); - - mockMvc.perform(delete("/api/data-acquisition-projects/" + project.getId())) - .andExpect(status().is2xxSuccessful()); - - // check that the DataSet has been deleted - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - public void testCreateDataSetAndReadVersions() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java - - equalTo("/data-sets/dat-" + PROJECT_ID + "-ds1$-1.0.0/attachments/filename.txt")); - - List expectedFiles = new ArrayList<>(); - expectedFiles.add("/data-sets/dat-" + PROJECT_ID + "-ds1$/attachments/filename.txt"); - expectedFiles.add("/data-sets/dat-" + PROJECT_ID + "-ds1$-1.0.0/attachments/filename.txt"); -===================================================================== -Found a 8 line (34 tokens) duplication in the following files: -Starting at line 67 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - this.elasticsearchUpdateQueueItemRepository.deleteAll(); - this.elasticsearchAdminService.recreateAllIndices(); - this.javersService.deleteAll(); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = "test") - public void testUploadValidAttachment() throws Exception { -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 133 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 209 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 228 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - InstrumentAttachmentMetadata instrumentAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildInstrumentAttachmentMetadata("projectid", 1); -===================================================================== -Found a 8 line (34 tokens) duplication in the following files: -Starting at line 84 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 186 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java - - .file(attachment).file(metadata)).andExpect(status().isCreated()); - - // read the created attachment and check the version - mockMvc - .perform(get( - "/api/instruments/" + instrumentAttachmentMetadata.getInstrumentId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect( -===================================================================== -Found a 3 line (34 tokens) duplication in the following files: -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 293 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildInstrument(project.getId(), project.getId() + "-sy1"); - - // Act and Assert - // create the instrument with the given id - mockMvc.perform(post(API_INSTRUMENTS_URI).content(TestUtil.convertObjectToJsonBytes(instrument)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 3 line (34 tokens) duplication in the following files: -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 208 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 231 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 309 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - mockMvc.perform(put(API_INSTRUMENTS_URI + "/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().is2xxSuccessful()); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 97 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - public void testCreateInstrumentAndReadVersions() throws IOException, Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - dataAcquisitionProjectRepository.save(project); - - Instrument instrument = UnitTestCreateDomainObjectUtils.buildInstrument(project.getId()); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 171 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java - - equalTo("/instruments/ins-" + PROJECT_ID + "-ins1$-1.0.0/attachments/filename.txt")); - - List expectedFiles = new ArrayList<>(); - expectedFiles.add("/instruments/ins-" + PROJECT_ID + "-ins1$/attachments/filename.txt"); - expectedFiles.add("/instruments/ins-" + PROJECT_ID + "-ins1$-1.0.0/attachments/filename.txt"); -===================================================================== -Found a 3 line (34 tokens) duplication in the following files: -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java - - Order order = createOrder(); - mockMvc.perform(post("/api/orders").contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(order))).andExpect(status().isCreated()); -===================================================================== -Found a 4 line (34 tokens) duplication in the following files: -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 236 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - // create the project with the given id - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_URI).contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_URI).contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); - - // read the project under the new url - mockMvc.perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId())) -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 159 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 214 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); - - // ensure it is really deleted - mockMvc.perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isNotFound()); -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 150 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 162 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java - - .andExpect(status().isAccepted()); - - // check if hiding is in progress - this.mockMvc - .perform(get(API_DATA_ACQUISITION_PROJECTS_URI + "/" + projectId + "/shadows/1.0.0/action")) - .andExpect(status().isOk()).andExpect(jsonPath("$.action", is(Action.HIDE.name()))); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java - - public void testUploadQuestionImageResource() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("image", "image.png", "image/png", "fakeimage".getBytes()); - QuestionImageMetadata questionImageMetadata = - UnitTestCreateDomainObjectUtils.buildQuestionImageMetadata("projectid", "questionid"); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 342 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildQuestion(project.getId(), 123, "instrument-Id"); - // Act and Assert - // create the Question with the given id - mockMvc.perform(post(API_QUESTIONS_URI).content(TestUtil.convertObjectToJsonBytes(question)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 322 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - mockMvc.perform(post(API_QUESTIONS_URI).content(TestUtil.convertObjectToJsonBytes(question)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // assert that the question exists - mockMvc.perform(get(API_QUESTIONS_URI + "/" + question.getId())).andExpect(status().isOk()); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 102 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 169 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java - - equalTo("/questions/que-" + PROJECT_ID + "-ins1-1.1$-1.0.0/images/TestFileName.PNG")); - - List expectedFiles = new ArrayList<>(); - expectedFiles.add("/questions/que-" + PROJECT_ID + "-ins1-1.1$/images/TestFileName.PNG"); - expectedFiles.add("/questions/que-" + PROJECT_ID + "-ins1-1.1$-1.0.0/images/TestFileName.PNG"); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 207 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 227 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 283 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java - - public void testUploadValidAttachment() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - SurveyAttachmentMetadata surveyAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildSurveyAttachmentMetadata("projectid", 1); -===================================================================== -Found a 7 line (34 tokens) duplication in the following files: -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 125 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 161 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 272 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .andExpect(status().isCreated()); - - // read the created attachment and check the version - mockMvc.perform( - get("/api/surveys/" + surveyAttachmentMetadata.getSurveyId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.[0].surveyId", is(surveyAttachmentMetadata.getSurveyId()))) -===================================================================== -Found a 3 line (34 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 297 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 323 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 335 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 381 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - - // create the survey with the given id - mockMvc.perform(post(API_SURVEYS_URI).content(TestUtil.convertObjectToJsonBytes(survey)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 297 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 323 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - mockMvc.perform(post(API_SURVEYS_URI).content(TestUtil.convertObjectToJsonBytes(survey)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the survey under the new url - mockMvc.perform(get(API_SURVEYS_URI + "/" + survey.getId())).andExpect(status().isOk()); -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - public void testCreateSurveyWithMixedMethodDataType() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - rdcProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); - survey.setDataType(I18nString.builder().de("Mixed Methods").en("Mixed Methods").build()); -===================================================================== -Found a 3 line (34 tokens) duplication in the following files: -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 194 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 215 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 397 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) -===================================================================== -Found a 7 line (34 tokens) duplication in the following files: -Starting at line 250 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 267 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 284 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - .andExpect(jsonPath("$.errors[0].property", is("end"))) - .andExpect(jsonPath("$.errors[0].entity", is("Survey"))) - .andExpect(jsonPath("$.errors[0].message", is("global.error.import.json-parsing-error"))); - } - - @Test - public void testCreateSurveyWithUnparsableSampleSize() throws Exception { -===================================================================== -Found a 4 line (34 tokens) duplication in the following files: -Starting at line 102 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/service/UserServiceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/service/UserServiceTest.java - - user.setResetKey("1234"); - userRepository.save(user); - Optional maybeUser = userService.completePasswordReset("johndoe2", user.getResetKey()); - assertThat(maybeUser.isPresent()).isFalse(); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 871 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); - - // create the variable with the given id - mockMvc.perform(post(API_VARIABLES_URI).content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 7 line (34 tokens) duplication in the following files: -Starting at line 527 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 564 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 583 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 641 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - accessWays.add("WrongAccessWay"); - - List surveyNumbers = new ArrayList<>(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); -===================================================================== -Found a 5 line (34 tokens) duplication in the following files: -Starting at line 619 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 857 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .en(ScaleLevels.ORDINAL.getEn()).build()); - - // create the variable with the given id - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) -===================================================================== -Found a 8 line (34 tokens) duplication in the following files: -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/common/domain/QAbstractShadowableRdcDomainObject.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QDataAcquisitionProject.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final BooleanPath shadow = createBoolean("shadow"); -===================================================================== -Found a 9 line (34 tokens) duplication in the following files: -Starting at line 35 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/common/domain/QTask.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 30 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QDaraUpdateQueueItem.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/QShadowCopyQueueItem.java -Starting at line 37 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 30 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/QElasticsearchIndicesVersion.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/QElasticsearchUpdateQueueItem.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final StringPath id = createString("id"); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath location = createString("location"); -===================================================================== -Found a 1 line (34 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java - - public final ListPath authors = this.createList("authors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 1 line (34 tokens) duplication in the following files: -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java - - public final ListPath dataCurators = this.createList("dataCurators", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 1 line (34 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java - - public final ListPath institutions = this.createList("institutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); -===================================================================== -Found a 1 line (34 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 125 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public final ListPath institutions = this.createList("institutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); -===================================================================== -Found a 7 line (34 tokens) duplication in the following files: -Starting at line 43 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java - - public final StringPath masterId = createString("masterId"); - - public final BooleanPath shadow = createBoolean("shadow"); - - public final StringPath successorId = createString("successorId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title; -===================================================================== -Found a 12 line (34 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 99 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final ListPath instruments = this.createList("instruments", InstrumentSubDocument.class, QInstrumentSubDocument.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - //inherited - public final StringPath masterId = _super.masterId; - - public final ListPath nestedConcepts = this.createList("nestedConcepts", ConceptNestedDocument.class, QConceptNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 1 line (34 tokens) duplication in the following files: -Starting at line 116 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java - - public final ListPath sponsors = _super.sponsors; -===================================================================== -Found a 6 line (34 tokens) duplication in the following files: -Starting at line 55 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description; - - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString format; - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString guiLabels; -===================================================================== -Found a 10 line (34 tokens) duplication in the following files: -Starting at line 60 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 84 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString guiLabels; - - //inherited - public final BooleanPath hidden = _super.hidden; - - //inherited - public final StringPath id = _super.id; - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; -===================================================================== -Found a 3 line (34 tokens) duplication in the following files: -Starting at line 150 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 170 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 159 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 182 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; - this.nestedDataPackage = inits.isInitialized("nestedDataPackage") ? new QDataPackageNestedDocument(forProperty("nestedDataPackage"), inits.get("nestedDataPackage")) : null; - this.release = inits.isInitialized("release") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QRelease(forProperty("release")) : null; -===================================================================== -Found a 4 line (33 tokens) duplication in the following files: -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/rest/I18nResourceController.java -Starting at line 33 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/UnitValueResource.java - - defaultValue = "de") String locale) { - return ResponseEntity.ok() - .cacheControl(CacheControl.maxAge(0, TimeUnit.DAYS).mustRevalidate().cachePublic()) - .eTag(ETAG.toString()) -===================================================================== -Found a 5 line (33 tokens) duplication in the following files: -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResource.java -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResource.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResource.java -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResource.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResource.java - - @RequestMapping(path = "/concepts/{conceptId}/attachments/{filename:.+}", - method = RequestMethod.PUT) - @Secured(value = {AuthoritiesConstants.PUBLISHER, AuthoritiesConstants.DATA_PROVIDER}) - public ResponseEntity update( - @Valid @RequestBody ConceptAttachmentMetadata conceptAttachmentMetadata) { -===================================================================== -Found a 7 line (33 tokens) duplication in the following files: -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResource.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResource.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResource.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResource.java -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResource.java - - if (conceptAttachmentVersions == null) { - return ResponseEntity.notFound().build(); - } - - return ResponseEntity.ok() - .cacheControl(CacheControl.noStore()) - .body(conceptAttachmentVersions); -===================================================================== -Found a 3 line (33 tokens) duplication in the following files: -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptAttachmentService.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 165 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java - - .regex("^" + Pattern.quote("/concepts/") + ".*" + Pattern.quote("/attachments/"))); - Iterable files = this.operations.find(query); - files.forEach(file -> { -===================================================================== -Found a 6 line (33 tokens) duplication in the following files: -Starting at line 97 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageOverviewResource.java -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetReportResource.java - - @PathVariable("dataPackageId") String dataPackageId, @RequestParam("version") String version) - throws IOException, TemplateException, TemplateIncompleteException { - - // Handles no empty latex templates - if (!templateZip.isEmpty()) { - Path zipTmpFilePath = Files.createTempFile(dataPackageId.replace("!", ""), ".zip"); -===================================================================== -Found a 8 line (33 tokens) duplication in the following files: -Starting at line 37 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/repository/InstrumentRepository.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/repository/SurveyRepository.java - - @Param("dataAcquisitionProjectId") String dataAcquisitionProjectId); - - @RestResource(exported = false) - List findIdsByNumberAndDataAcquisitionProjectId(Integer number, - String dataAcquisitionProjectId); - - @RestResource(exported = false) - Stream streamIdsBySurveyIdsContaining(String surveyId); -===================================================================== -Found a 4 line (33 tokens) duplication in the following files: -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 219 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 244 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 272 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 300 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 379 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - Locale locale = Locale.forLanguageTag(user.getLangKey()); - Context context = new Context(locale); - context.setVariable("user", user); - context.setVariable("baseUrl", baseUrl); -===================================================================== -Found a 3 line (33 tokens) duplication in the following files: -Starting at line 227 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 309 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 388 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - String subject = messageSource.getMessage(subjectKey, new Object[] {projectId}, locale); - sendEmail(sender, new String[] {user.getEmail()}, null, null, subject, content, false, true); - }); -===================================================================== -Found a 19 line (33 tokens) duplication in the following files: -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResource.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResource.java - - dataAcquisitionProjectManagementService.hideShadows(optional.get()); - } else { - return ResponseEntity.notFound().build(); - } - - return ResponseEntity.accepted().build(); - } - - /** - * Unhide the shadow copies of the given project with the given version. - * - * @param id The id of the project - * @param version the version of the shadows to hide - * - * @return ACCEPTED if the hiding task has been started - * @throws ShadowUnhidingNotAllowedException Thrown if the given project version is already - * unhidden - */ - @DeleteMapping("/data-acquisition-projects/{id}/shadows/{version}/hidden") -===================================================================== -Found a 5 line (33 tokens) duplication in the following files: -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResource.java -Starting at line 132 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResource.java - - @RequestMapping(value = "/users/{login}/public", method = RequestMethod.GET, - produces = MediaType.APPLICATION_JSON_VALUE) - @Secured({AuthoritiesConstants.ADMIN, AuthoritiesConstants.DATA_PROVIDER, - AuthoritiesConstants.PUBLISHER}) - public ResponseEntity getUserPublic(@PathVariable String login) { -===================================================================== -Found a 14 line (33 tokens) duplication in the following files: -Starting at line 31 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/UniqueVariableNameInDataSetValidator.java -Starting at line 22 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/ValidDerivedVariablesIdentifierValidator.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/ValidRepeatedMeasurementIdentifierValidator.java -Starting at line 24 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/validation/ValidVariableIdNameValidator.java - - public void initialize(UniqueVariableNameInDataSet constraintAnnotation) {} - - /* - * (non-Javadoc) - * - * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, - * javax.validation.ConstraintValidatorContext) - */ - @Override - public boolean isValid(Variable variable, ConstraintValidatorContext context) { - if (variable.isShadow()) { - return true; - } else { - if (StringUtils.isEmpty(variable.getName()) && StringUtils.isEmpty(variable.getDataSetId())) { -===================================================================== -Found a 9 line (33 tokens) duplication in the following files: -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 66 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 64 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { - this.conceptRepository.deleteAll(); -===================================================================== -Found a 9 line (33 tokens) duplication in the following files: -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - questionRepository.deleteAll(); - elasticsearchUpdateQueueItemRepository.deleteAll(); - elasticsearchAdminService.recreateAllIndices(); - javersService.deleteAll(); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testCreateConcept() throws IOException, Exception { -===================================================================== -Found a 4 line (33 tokens) duplication in the following files: -Starting at line 380 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 379 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 357 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 228 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - "/api/data-packages/" + dataPackageId + "/attachments/" + metadata.getFileName())) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-delete-not-allowed"))); - } -===================================================================== -Found a 5 line (33 tokens) duplication in the following files: -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - mockMvc.perform(get(API_DATAPACKAGE_URI)).andExpect(status().isOk()) - .andExpect(jsonPath("$.content.length()", is(0))); - - // get the empty list of pinned data packages - mockMvc.perform(get(API_DATAPACKAGE_URI + "?pinned=true")).andExpect(status().isOk()) -===================================================================== -Found a 6 line (33 tokens) duplication in the following files: -Starting at line 289 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 350 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - mockMvc.perform(delete(API_DATAPACKAGE_URI + "/" + dataPackage.getId())) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-delete-not-allowed"))); - } - - @Test -===================================================================== -Found a 9 line (33 tokens) duplication in the following files: -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DeleteAllDataPackagesResourceControllerTest.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - dataPackageRepository.deleteAll(); - javersService.deleteAll(); - elasticsearchUpdateQueueItemRepository.deleteAll(); - elasticsearchAdminService.recreateAllIndices(); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testDeleteAllDataPackagesOfShadowCopyProject() throws Exception { -===================================================================== -Found a 6 line (33 tokens) duplication in the following files: -Starting at line 77 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java - - public void createShadowCopy() throws Exception { - DataPackageAttachmentMetadata master = - UnitTestCreateDomainObjectUtils.buildDataPackageAttachmentMetadata(PROJECT_ID); - master.generateId(); - master.setMasterId(master.getId()); - createTestFileForAttachment(master); -===================================================================== -Found a 7 line (33 tokens) duplication in the following files: -Starting at line 209 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 209 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 213 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 206 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - shadow.setDataPackageId(master.getDataPackageId() + "-" + version); - shadow.setDataAcquisitionProjectId(shadow.getDataAcquisitionProjectId() + "-" + version); - shadow.generateId(); - return shadow; - } - - private void createTestFileForAttachment(DataPackageAttachmentMetadata metadata) throws Exception { -===================================================================== -Found a 6 line (33 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - dataPackageRepository.saveAll(Arrays.asList(master, shadow)); - - shadowCopyService.createShadowCopies(project.getId(), project.getRelease(), - "1.0.0"); - - long count = dataPackageRepository.count(); -===================================================================== -Found a 9 line (33 tokens) duplication in the following files: -Starting at line 61 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DeleteAllDateSetsResourceControllerTest.java -Starting at line 64 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/DeleteAllInstrumentsResourceControllerTest.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/DeleteAllQuestionsResourceControllerTest.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/DeleteAllSurveysResourceControllerTest.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/DeleteAllVariablesResourceControllerTest.java - - dataSetRepo.deleteAll(); - javersService.deleteAll(); - elasticsearchUpdateQueueItemRepository.deleteAll(); - elasticsearchAdminService.recreateAllIndices(); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.DATA_PROVIDER) - public void testDeleteAllDataSetsOfProject() throws Exception { -===================================================================== -Found a 8 line (33 tokens) duplication in the following files: -Starting at line 48 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailServiceTest.java -Starting at line 65 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailServiceTest.java - - public void testSendActivationEmail() throws Exception { - // Arrange - User user = User.builder().langKey("de") - .email("anyMail@localhost.com") - .build(); - - // Act - Future futureVoid = this.mailService.sendActivationEmail(user); -===================================================================== -Found a 17 line (33 tokens) duplication in the following files: -Starting at line 26 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 26 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - -public class DataAcquisitionProjectLastReleaseResourceTest extends AbstractTest { - private static final String API_DATA_ACQUISITION_PROJECTS_URI = "/api/data-acquisition-projects"; - - @Autowired - private WebApplicationContext wac; - - @Autowired - private DataAcquisitionProjectRepository dataAcquisitionProjectRepository; - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; -===================================================================== -Found a 6 line (33 tokens) duplication in the following files: -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 236 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 298 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - private DataAcquisitionProject buildValidProject() { - //Arrange - //Project - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - project.getConfiguration().setDataPackagesState(new ProjectState(true, true)); - this.rdcProjectRepository.save(project); -===================================================================== -Found a 8 line (33 tokens) duplication in the following files: -Starting at line 330 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 631 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 815 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - mockMvc.perform(get(API_QUESTIONS_URI + "/" + question.getId())) - .andExpect(status().isNotFound()); - - // check that there are no question documents anymore - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(0L)); - } - - @Test -===================================================================== -Found a 9 line (33 tokens) duplication in the following files: -Starting at line 33 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/common/domain/QAbstractShadowableRdcDomainObject.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QAbstractNestedSubDocument.java -Starting at line 66 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final StringPath id = _super.id; - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); -===================================================================== -Found a 5 line (33 tokens) duplication in the following files: -Starting at line 56 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/common/domain/QTask.java -Starting at line 84 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QAbstractNestedSubDocument.java -Starting at line 52 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptNestedDocument.java -Starting at line 108 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 133 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 133 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionNestedDocument.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationNestedDocument.java -Starting at line 97 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java - - public QTask(Path path) { - this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); - } - - public QTask(PathMetadata metadata) { -===================================================================== -Found a 3 line (33 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 101 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractRdcDomainObject(this); - - public final ListPath authors = this.createList("authors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 4 line (33 tokens) duplication in the following files: -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 79 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final QTags tags = new QTags(forProperty("tags")); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("title")); -===================================================================== -Found a 4 line (33 tokens) duplication in the following files: -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 23 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 26 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/QRelatedPublication.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 29 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 22 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject _super = new eu.dzhw.fdz.metadatamanagement.common.domain.QAbstractShadowableRdcDomainObject(this); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); -===================================================================== -Found a 3 line (33 tokens) duplication in the following files: -Starting at line 44 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 37 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 67 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public final StringPath id = createString("id"); - - public final ListPath institutions = this.createList("institutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); -===================================================================== -Found a 9 line (33 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java - - public final ListPath institutions = this.createList("institutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); - - //inherited - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); -===================================================================== -Found a 4 line (33 tokens) duplication in the following files: -Starting at line 38 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 21 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QPopulation.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QFilterDetails.java -Starting at line 20 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QGenerationDetails.java - - public final StringPath dataPackageId = createString("dataPackageId"); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); -===================================================================== -Found a 4 line (33 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final ListPath> surveyNumbers = this.>createList("surveyNumbers", Integer.class, NumberPath.class, PathInits.DIRECT2); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString type = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("type")); -===================================================================== -Found a 1 line (33 tokens) duplication in the following files: -Starting at line 98 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java - - this.format = inits.isInitialized("format") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("format")) : null; -===================================================================== -Found a 9 line (33 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 31 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java -Starting at line 29 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/usermanagement/domain/QUser.java - - public final ListPath conceptIds = this.createList("conceptIds", String.class, StringPath.class, PathInits.DIRECT2); - - //inherited - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final StringPath dataAcquisitionProjectId = createString("dataAcquisitionProjectId"); -===================================================================== -Found a 4 line (33 tokens) duplication in the following files: -Starting at line 84 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 133 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final QTechnicalRepresentation technicalRepresentation = new QTechnicalRepresentation(forProperty("technicalRepresentation")); - - // custom - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString topic = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("topic")); -===================================================================== -Found a 6 line (33 tokens) duplication in the following files: -Starting at line 33 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/QRelatedPublication.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public final StringPath createdBy = _super.createdBy; - - //inherited - public final DateTimePath createdDate = _super.createdDate; - - public final ListPath dataPackageIds = this.createList("dataPackageIds", String.class, StringPath.class, PathInits.DIRECT2); -===================================================================== -Found a 1 line (33 tokens) duplication in the following files: -Starting at line 65 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QAbstractNestedSubDocument.java -Starting at line 149 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java - - this.completeTitle = inits.isInitialized("completeTitle") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("completeTitle")) : null; -===================================================================== -Found a 1 line (33 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptNestedDocument.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 88 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSubDocument.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java - - this.title = inits.isInitialized("title") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("title")) : null; -===================================================================== -Found a 1 line (33 tokens) duplication in the following files: -Starting at line 123 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 112 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - this.guiLabels = inits.isInitialized("guiLabels") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("guiLabels")) : null; -===================================================================== -Found a 5 line (33 tokens) duplication in the following files: -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSubDocument.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySubDocument.java - - public final BooleanPath shadow = createBoolean("shadow"); - - public final StringPath successorId = createString("successorId"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString title; -===================================================================== -Found a 9 line (33 tokens) duplication in the following files: -Starting at line 108 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final ListPath relatedPublications = this.createList("relatedPublications", RelatedPublicationSubDocument.class, QRelatedPublicationSubDocument.class, PathInits.DIRECT2); - - public final eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QRelease release; - - //inherited - public final BooleanPath shadow = _super.shadow; - - //inherited - public final ListPath sponsors = _super.sponsors; -===================================================================== -Found a 1 line (33 tokens) duplication in the following files: -Starting at line 107 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSubDocument.java - - public final ListPath subDataSets; -===================================================================== -Found a 1 line (33 tokens) duplication in the following files: -Starting at line 167 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 161 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - this.release = inits.isInitialized("release") ? new eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.QRelease(forProperty("release")) : null; -===================================================================== -Found a 9 line (33 tokens) duplication in the following files: -Starting at line 69 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 102 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - public final StringPath lastModifiedBy = _super.lastModifiedBy; - - //inherited - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - //inherited - public final StringPath masterId = _super.masterId; - - public final ListPath nestedConcepts = this.createList("nestedConcepts", ConceptNestedDocument.class, QConceptNestedDocument.class, PathInits.DIRECT2); -===================================================================== -Found a 5 line (33 tokens) duplication in the following files: -Starting at line 51 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final ListPath dataSets = this.createList("dataSets", DataSetSubDocument.class, QDataSetSubDocument.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString dataType = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.dataType); -===================================================================== -Found a 5 line (33 tokens) duplication in the following files: -Starting at line 55 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString dataType = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.dataType); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QPeriod fieldPeriod = new eu.dzhw.fdz.metadatamanagement.common.domain.QPeriod(_super.fieldPeriod); -===================================================================== -Found a 1 line (33 tokens) duplication in the following files: -Starting at line 82 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java -Starting at line 84 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java - - this.label = inits.isInitialized("label") ? new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("label")) : null; -===================================================================== -Found a 5 line (33 tokens) duplication in the following files: -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java -Starting at line 65 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final ListPath instruments = this.createList("instruments", InstrumentSubDocument.class, QInstrumentSubDocument.class, PathInits.DIRECT2); - - // custom - // inherited - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString label = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.label); -===================================================================== -Found a 7 line (33 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/usermanagement/domain/QOAuth2AuthenticationAccessToken.java -Starting at line 22 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/usermanagement/domain/QOAuth2AuthenticationRefreshToken.java - - public final StringPath refreshToken = createString("refreshToken"); - - public final ArrayPath token = createArray("token", byte[].class); - - public final StringPath tokenId = createString("tokenId"); - - public final StringPath username = createString("username"); -===================================================================== -Found a 12 line (32 tokens) duplication in the following files: -Starting at line 38 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/rest/filter/CachingHttpHeadersFilter.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/rest/filter/StaticResourcesProductionFilter.java - - } - - @Override - public void destroy() { - // Nothing to destroy - } - - @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) - throws IOException, ServletException { - - if (response instanceof HttpServletResponse && request instanceof HttpServletRequest) { -===================================================================== -Found a 7 line (32 tokens) duplication in the following files: -Starting at line 24 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/repository/ConceptRepository.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/repository/DataPackageRepository.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/repository/VariableRepository.java - - List findSubDocumentsByIdIn(Collection conceptIds); - - @RestResource(exported = false) - Stream streamAllIdAndVersionsBy(); - - @RestResource(exported = false) - Stream streamIdsByIdIn(Collection conceptIds); -===================================================================== -Found a 4 line (32 tokens) duplication in the following files: -Starting at line 91 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResource.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResource.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResource.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResource.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResource.java - - @RequestMapping(path = "/concepts/{conceptId}/attachments/{filename:.+}", - method = RequestMethod.DELETE) - @Secured(value = {AuthoritiesConstants.PUBLISHER, AuthoritiesConstants.DATA_PROVIDER}) - public ResponseEntity delete(@PathVariable("conceptId") String conceptId, -===================================================================== -Found a 4 line (32 tokens) duplication in the following files: -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResource.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResource.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResource.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResource.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResource.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResource.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResource.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResource.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResource.java -Starting at line 42 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResource.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResource.java - - @PathVariable String filename, - @RequestParam(name = "limit", defaultValue = "5") Integer limit, - @RequestParam(name = "skip", defaultValue = "0") Integer skip) { - List conceptAttachmentVersions = conceptAttachmentVersionsService -===================================================================== -Found a 7 line (32 tokens) duplication in the following files: -Starting at line 245 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/service/RelatedPublicationManagementService.java - - public Optional read(String id) { - return crudHelper.read(id); - } - - @Override - @Secured(value = {AuthoritiesConstants.PUBLISHER}) - public void delete(Concept concept) { -===================================================================== -Found a 8 line (32 tokens) duplication in the following files: -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/DataSet.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/Instrument.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/DataAcquisitionProject.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/Question.java - -@CompoundIndex(def = "{number: 1, dataAcquisitionProjectId: 1}", unique = true) -@EqualsAndHashCode(callSuper = false, of = "id") -@ToString(callSuper = true) -@NoArgsConstructor -@Data -@AllArgsConstructor -@Builder -@ValidShadowId(message = "data-set-management.error.data-set.id.pattern") -===================================================================== -Found a 5 line (32 tokens) duplication in the following files: -Starting at line 303 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java -Starting at line 382 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/mailmanagement/service/MailService.java - - context.setVariable("dataSetId", dataSetId); - context.setVariable("locale", locale); - context.setVariable("language", language); - context.setVariable("baseUrl", baseUrl); - String content = templateEngine.process("datasetReportGeneratedEmail", context); -===================================================================== -Found a 6 line (32 tokens) duplication in the following files: -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResource.java -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResource.java - - throws ShadowHidingNotAllowedException { - String shadowId = id + "-" + version; - Optional optional = - dataAcquisitionProjectManagementService.read(shadowId); - if (optional.isPresent()) { - dataAcquisitionProjectManagementService.hideShadows(optional.get()); -===================================================================== -Found a 14 line (32 tokens) duplication in the following files: -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyManagementService.java -Starting at line 165 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyManagementService.java -Starting at line 179 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyManagementService.java - - List surveyIds = instrumentChangesProvider.getAffectedSurveyIds(instrument.getId()); - elasticsearchUpdateQueueService.enqueueUpsertsAsync( - () -> surveyRepository.streamIdsByIdIn(surveyIds), ElasticsearchType.surveys); - } - - /** - * Enqueue update of survey search documents when the question is changed. - * - * @param question the updated, created or deleted question. - */ - @HandleAfterCreate - @HandleAfterSave - @HandleAfterDelete - public void onQuestionChanged(Question question) { -===================================================================== -Found a 11 line (32 tokens) duplication in the following files: -Starting at line 20 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/rest/I18nResourceControllerTest.java -Starting at line 16 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataFormatsResourceControllerTest.java -Starting at line 64 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java -Starting at line 16 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveySampleTypesResourceControllerTest.java -Starting at line 16 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/UnitValuesResourceControllerTest.java - - @Autowired - private WebApplicationContext wac; - - private MockMvc mockMvc; - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); - } - - @Test -===================================================================== -Found a 2 line (32 tokens) duplication in the following files: -Starting at line 55 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/service/TaskServiceTest.java -Starting at line 68 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/service/TaskServiceTest.java - - Task taskForError = taskRepo.insert(Task.builder().id(id).state(TaskState.RUNNING).build()); - Task result = taskService.handleErrorTask(taskForError, -===================================================================== -Found a 6 line (32 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 213 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 233 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - ConceptAttachmentMetadata conceptAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildConceptAttachmentMetadata("con-conceptid$"); -===================================================================== -Found a 7 line (32 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 278 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java - - conceptAttachmentMetadata.generateId(); - - // read the created attachment and check the version - mockMvc.perform( - get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.[0].conceptId", is(conceptAttachmentMetadata.getConceptId()))) -===================================================================== -Found a 6 line (32 tokens) duplication in the following files: -Starting at line 223 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 244 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 242 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 262 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 237 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 258 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 220 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 240 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 217 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 238 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/concepts/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", - is("concept-management.error.concept-attachment-metadata.type.valid-type"))); -===================================================================== -Found a 3 line (32 tokens) duplication in the following files: -Starting at line 259 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - mockMvc.perform(put("/api/concepts/" + concept.getId()) - .content(TestUtil.convertObjectToJsonBytes(concept)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 2 line (32 tokens) duplication in the following files: -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java -Starting at line 74 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java - - + conceptAttachmentMetadata.getFileName() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 3 line (32 tokens) duplication in the following files: -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 220 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 246 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 305 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 322 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 358 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - mockMvc.perform(put("/api/questions/" + question.getId()) - .content(TestUtil.convertObjectToJsonBytes(question)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); -===================================================================== -Found a 3 line (32 tokens) duplication in the following files: -Starting at line 197 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 208 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 231 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 309 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - mockMvc.perform(put("/api/instruments/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); -===================================================================== -Found a 6 line (32 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 231 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 250 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 301 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataPackageAttachmentMetadata dataPackageAttachmentMetadata = - UnitTestCreateDomainObjectUtils.buildDataPackageAttachmentMetadata("projectid"); -===================================================================== -Found a 8 line (32 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 291 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java - - dataPackageAttachmentMetadata.generateId(); - - // read the created attachment and check the version - mockMvc - .perform(get("/api/data-packages/" - + dataPackageAttachmentMetadata.getDataPackageId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect( -===================================================================== -Found a 3 line (32 tokens) duplication in the following files: -Starting at line 274 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 260 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 275 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - mockMvc.perform(put("/api/data-packages/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (32 tokens) duplication in the following files: -Starting at line 295 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 297 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 276 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 276 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - "/api/data-packages/" + dataPackageAttachmentMetadata.getDataPackageId() + "/attachments")) - .andExpect(status().isOk()).andExpect(content().json("[]")); - } - - @Test -===================================================================== -Found a 5 line (32 tokens) duplication in the following files: -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - mockMvc.perform(get(API_DATAPACKAGE_URI)).andExpect(status().isOk()) - .andExpect(jsonPath("$.content.length()", is(0))); - - // get the empty list of pinned data packages - mockMvc.perform(get(API_DATAPACKAGE_URI + "?pinned=true")).andExpect(status().isOk()) -===================================================================== -Found a 5 line (32 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - .andExpect(jsonPath("$.content.length()", is(0))); - - // get the empty list of pinned data packages - mockMvc.perform(get(API_DATAPACKAGE_URI + "?pinned=true")).andExpect(status().isOk()) - .andExpect(jsonPath("$.content.length()", is(0))); -===================================================================== -Found a 6 line (32 tokens) duplication in the following files: -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentShadowCopyServiceTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentShadowCopyServiceTest.java -Starting at line 127 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentShadowCopyServiceTest.java -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionImageShadowCopyServiceTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentShadowCopyServiceTest.java - - gridFsOperations.find(new Query()).iterator().forEachRemaining(files::add); - - assertThat(files.size(), equalTo(2)); - - Query shadowQuery = new Query(GridFsCriteria.whereFilename() - .is("/data-packages/stu-" + PROJECT_ID + "$-1.0.0/attachments/filename.txt")); -===================================================================== -Found a 5 line (32 tokens) duplication in the following files: -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java - - DataPackage shadow = createShadow(master, release.getVersion()); - dataPackageRepository.saveAll(Arrays.asList(master, shadow)); - - shadowCopyService.createShadowCopies(project.getId(), project.getRelease(), - "1.0.0"); -===================================================================== -Found a 6 line (32 tokens) duplication in the following files: -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 125 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - dataPackageRepository.saveAll(Arrays.asList(master, shadow)); - - shadowCopyService.createShadowCopies(project.getId(), project.getRelease(), - "1.0.0"); - - List result = -===================================================================== -Found a 4 line (32 tokens) duplication in the following files: -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/AvailableDataSetNumbersResourceControllerTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 290 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 316 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 354 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - public void testAvailableNumbersIfThereIsOneDataSet() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - rdcProjectRepository.save(project); - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); -===================================================================== -Found a 7 line (32 tokens) duplication in the following files: -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 164 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 293 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - dataSetAttachmentMetadata.generateId(); - - // read the created attachment and check the version - mockMvc.perform( - get("/api/data-sets/" + dataSetAttachmentMetadata.getDataSetId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.[0].dataSetId", is(dataSetAttachmentMetadata.getDataSetId()))) -===================================================================== -Found a 3 line (32 tokens) duplication in the following files: -Starting at line 274 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 188 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 219 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 242 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 297 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 335 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 129 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - mockMvc.perform(put("/api/data-sets/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 7 line (32 tokens) duplication in the following files: -Starting at line 267 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 255 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 306 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - mockMvc.perform(get(API_DATASETS_URI + "/" + dataSet.getId())) - .andExpect(status().isNotFound()); - - elasticsearchUpdateQueueService.processAllQueueItems(); - - // check that there are no more data set documents - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(0L)); -===================================================================== -Found a 3 line (32 tokens) duplication in the following files: -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - .andExpect(jsonPath("$[0].description.de", is("hurzDe3"))) - .andExpect(jsonPath("$[0].version", is(equalTo(2)))) - .andExpect(jsonPath("$[1].id", is(dataSet.getId()))) -===================================================================== -Found a 3 line (32 tokens) duplication in the following files: -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 129 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - .andExpect(jsonPath("$[1].description.de", is("hurzDe2"))) - .andExpect(jsonPath("$[1].version", is(equalTo(1)))) - .andExpect(jsonPath("$[2].id", is(dataSet.getId()))) -===================================================================== -Found a 5 line (32 tokens) duplication in the following files: -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 123 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java - - DataSet shadow = createShadow(master, release.getVersion()); - dataSetRepository.saveAll(Arrays.asList(master, shadow)); - - shadowCopyService.createShadowCopies(project.getId(), project.getRelease(), - "1.0.0"); -===================================================================== -Found a 3 line (32 tokens) duplication in the following files: -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - mockMvc.perform(put("/api/instruments/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (32 tokens) duplication in the following files: -Starting at line 324 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 498 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 372 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 411 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 905 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - mockMvc.perform(delete(API_INSTRUMENTS_URI + "/" + instrument.getId())) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", containsString("global.error.shadow-delete-not-allowed"))); - } -} -===================================================================== -Found a 5 line (32 tokens) duplication in the following files: -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java - - Instrument shadow = createShadow(master, release.getVersion()); - instrumentRepository.saveAll(Arrays.asList(master, shadow)); - - shadowCopyService.createShadowCopies(project.getId(), project.getRelease(), - "1.0.0"); -===================================================================== -Found a 4 line (32 tokens) duplication in the following files: -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - //delete not created project - mockMvc.perform(delete(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isNotFound()); -===================================================================== -Found a 7 line (32 tokens) duplication in the following files: -Starting at line 459 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 306 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = PUBLISHER_USERNAME) -===================================================================== -Found a 5 line (32 tokens) duplication in the following files: -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java - - Question shadow = createShadow(master, release.getVersion()); - questionRepository.saveAll(Arrays.asList(master, shadow)); - - shadowCopyService.createShadowCopies(project.getId(), project.getRelease(), - "1.0.0"); -===================================================================== -Found a 7 line (32 tokens) duplication in the following files: -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - this.mockMvc.perform(get(API_RELATED_PUBLICATION_URI + "/" + relatedPublication.getId())) - .andExpect(status().isOk()); - - elasticsearchUpdateQueueService.processAllQueueItems(); - - // check that there is one dataPackage and one publication document - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(2L)); -===================================================================== -Found a 7 line (32 tokens) duplication in the following files: -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueServiceTest.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueServiceTest.java - - public void testEnqueuingOfSingleDocument() { - elasticsearchUpdateQueueService.enqueue("testId", ElasticsearchType.variables, - ElasticsearchUpdateQueueAction.DELETE); - - assertThat(itemRepository.count(), is(1L)); - - elasticsearchUpdateQueueService.processAllQueueItems(); -===================================================================== -Found a 3 line (32 tokens) duplication in the following files: -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 194 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 215 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 397 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(put("/api/surveys/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 5 line (32 tokens) duplication in the following files: -Starting at line 102 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java - - Survey shadow = createShadow(master, release.getVersion()); - surveyRepository.saveAll(Arrays.asList(master, shadow)); - - shadowCopyService.createShadowCopies(project.getId(), project.getRelease(), - "1.0.0"); -===================================================================== -Found a 7 line (32 tokens) duplication in the following files: -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 227 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - public void testRequestPasswordReset() throws Exception { - // Arrange - User user = UnitTestUserManagementUtils.getDefaultUser(); - user.setPassword("sdkgfsdkkgfsdglkfglsdjkagfjklsdgfhklsdglkfglksdgslkfgsdklj12"); - user.setActivationKey("testActivateTrue"); - user.setActivated(true); - user = this.userRepository.save(user); -===================================================================== -Found a 2 line (32 tokens) duplication in the following files: -Starting at line 323 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 343 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 361 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 385 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 417 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 446 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - restMvc.perform(post("/api/register").contentType(TestUtil.APPLICATION_JSON_UTF8) - .content(TestUtil.convertObjectToJsonBytes(u))).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (32 tokens) duplication in the following files: -Starting at line 460 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 495 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 857 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - variable.setScaleLevel(I18nString.builder().de("InvalidValue").en("InvalidValue").build()); - - // create the variable with a survey but without a project - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) -===================================================================== -Found a 5 line (32 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - Variable shadow = createShadow(master, release.getVersion()); - variableRepository.saveAll(Arrays.asList(master, shadow)); - - shadowCopyService.createShadowCopies(project.getId(), project.getRelease(), - "1.0.0"); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSubDocument.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 104 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java - - public final ListPath authors = this.createList("authors", eu.dzhw.fdz.metadatamanagement.common.domain.Person.class, eu.dzhw.fdz.metadatamanagement.common.domain.QPerson.class, PathInits.DIRECT2); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 36 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/QConcept.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QConceptSearchDocument.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString description = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("description")); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 26 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/QDataSet.java -Starting at line 26 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/QInstrument.java -Starting at line 29 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/domain/QRelatedPublication.java -Starting at line 32 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java -Starting at line 32 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java -Starting at line 25 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java -Starting at line 28 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString annotations = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("annotations")); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 95 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 125 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSubDocument.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QRelatedPublicationSearchDocument.java - - public final ListPath institutions = this.createList("institutions", eu.dzhw.fdz.metadatamanagement.common.domain.I18nString.class, eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString.class, PathInits.DIRECT2); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 120 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString studySeries = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("studySeries")); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 70 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/domain/QDataPackage.java -Starting at line 129 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString surveyDesign = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("surveyDesign")); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/domain/QProduct.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/domain/QProduct.java - - public final SetPath> dataFormats = this.>createSet("dataFormats", eu.dzhw.fdz.metadatamanagement.datasetmanagement.domain.DataFormat.class, EnumPath.class, PathInits.DIRECT2); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 51 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString instruction = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("instruction")); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 58 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 85 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString introduction = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("introduction")); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 71 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/domain/QQuestion.java -Starting at line 113 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString questionText = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(forProperty("questionText")); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 111 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 66 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString sample = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.sample); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 64 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/domain/QSurvey.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString dataType = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.dataType); -===================================================================== -Found a 1 line (32 tokens) duplication in the following files: -Starting at line 138 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/QVariable.java - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString scaleLevel = new eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString(_super.scaleLevel); -===================================================================== -Found a 3 line (31 tokens) duplication in the following files: -Starting at line 61 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/rest/GenericDomainObjectResourceController.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/rest/I18nResourceController.java -Starting at line 57 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/rest/I18nResourceController.java -Starting at line 27 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataFormatsResource.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResource.java -Starting at line 35 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveySampleTypeResource.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/UnitValueResource.java - - return ResponseEntity.ok() - .cacheControl(CacheControl.maxAge(0, TimeUnit.DAYS).mustRevalidate().cachePublic()) - .eTag(domainObject.getVersion().toString()).lastModified(domainObject -===================================================================== -Found a 5 line (31 tokens) duplication in the following files: -Starting at line 132 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/TaskManagementService.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/TaskManagementService.java - - private void handleDataSetReportError(TaskErrorNotification errorNotification, User onBehalfUser, - String projectManagementEmailSender) { - List admins = - userRepository.findAllByAuthoritiesContaining(new Authority(AuthoritiesConstants.ADMIN)); - mailService.sendDataSetReportErrorMail(onBehalfUser, admins, errorNotification, -===================================================================== -Found a 7 line (31 tokens) duplication in the following files: -Starting at line 207 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/TaskManagementService.java -Starting at line 214 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/TaskManagementService.java - - crudHelper.delete(domainObject); - } - - @Override - @Secured(value = {AuthoritiesConstants.PUBLISHER, AuthoritiesConstants.ADMIN, - AuthoritiesConstants.DATA_PROVIDER, AuthoritiesConstants.TASK_USER}) - public Task save(Task domainObject) { -===================================================================== -Found a 3 line (31 tokens) duplication in the following files: -Starting at line 31 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DaraOaiPmhClient.java -Starting at line 26 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataCiteClient.java -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/rest/SearchResource.java - - restTemplate = new RestTemplate(new HttpComponentsClientHttpRequestFactory()); - restTemplate.getMessageConverters().add(0, - new StringHttpMessageConverter(Charset.forName("UTF-8"))); -===================================================================== -Found a 4 line (31 tokens) duplication in the following files: -Starting at line 203 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 212 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java - - case "de": - metadata = DataPackageAttachmentMetadata.builder().dataPackageId(dataPackageId) - .dataAcquisitionProjectId(dataPackage.getDataAcquisitionProjectId()) - .fileName(dataPackage.getDataAcquisitionProjectId() + "_Overview_de.pdf") -===================================================================== -Found a 3 line (31 tokens) duplication in the following files: -Starting at line 54 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/helper/DataPackageAttachmentShadowCopyDataSource.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionShadowCopyDataSource.java -Starting at line 49 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/helper/VariableShadowCopyDataSource.java - - source.getDataAcquisitionProjectId() + "-" + release.getVersion()); - copy.setDataPackageId(source.getDataPackageId() + "-" + release.getVersion()); - copy.generateId(); -===================================================================== -Found a 3 line (31 tokens) duplication in the following files: -Starting at line 54 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/helper/InstrumentAttachmentShadowCopyDataSource.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/helper/QuestionShadowCopyDataSource.java - - source.getDataAcquisitionProjectId() + "-" + release.getVersion()); - copy.setInstrumentId(source.getInstrumentId() + "-" + release.getVersion()); - copy.generateId(); -===================================================================== -Found a 9 line (31 tokens) duplication in the following files: -Starting at line 28 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/DaraUpdateQueueItem.java -Starting at line 33 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/domain/ElasticsearchUpdateQueueItem.java - - @CompoundIndex(def = "{updateStartedAt: 1, updateStartedBy: 1, createdDate: 1}") - }) -@EqualsAndHashCode(callSuper = false, of = "id") -@ToString(callSuper = true) -@NoArgsConstructor -@Data -@AllArgsConstructor -@Builder -public class DaraUpdateQueueItem extends AbstractRdcDomainObject { -===================================================================== -Found a 4 line (31 tokens) duplication in the following files: -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResource.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/rest/SearchResource.java - - @RequestMapping(value = "/data-acquisition-projects/{id}/post-validate", - method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) - @Secured(value = {AuthoritiesConstants.PUBLISHER, AuthoritiesConstants.DATA_PROVIDER}) - public ResponseEntity postValidate(@PathVariable String id, -===================================================================== -Found a 8 line (31 tokens) duplication in the following files: -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 61 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAccessWaysResourceControllerTest.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentVersionsResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DeleteAllDataPackagesResourceControllerTest.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/AvailableDataSetNumbersResourceControllerTest.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DeleteAllDateSetsResourceControllerTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/AvailableInstrumentNumbersResourceControllerTest.java -Starting at line 56 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/DeleteAllInstrumentsResourceControllerTest.java -Starting at line 58 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentVersionsResourceTest.java -Starting at line 66 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectAttachmentsResourceControllerTest.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectLastReleaseResourceTest.java -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectReleasesResourceTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/DeleteAllQuestionsResourceControllerTest.java -Starting at line 64 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 52 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/rest/SearchResourceTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/AvailableSurveyNumbersResourceControllerTest.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/DeleteAllSurveysResourceControllerTest.java -Starting at line 72 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentVersionsResourceTest.java -Starting at line 70 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 53 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/DeleteAllVariablesResourceControllerTest.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - @Before - public void setup() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .build(); - } - - @After - public void cleanUp() { -===================================================================== -Found a 4 line (31 tokens) duplication in the following files: -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 142 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the concept under the new url - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId())).andExpect(status().isOk()); -===================================================================== -Found a 6 line (31 tokens) duplication in the following files: -Starting at line 95 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 108 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId())).andExpect(status().isOk()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testCreateConceptWithPost() throws IOException, Exception { -===================================================================== -Found a 6 line (31 tokens) duplication in the following files: -Starting at line 166 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 233 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 284 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 372 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId())).andExpect(status().isNotFound()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testDeleteUsedConceptByQuestion() throws Exception { -===================================================================== -Found a 4 line (31 tokens) duplication in the following files: -Starting at line 178 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(question)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().is2xxSuccessful()); - - mockMvc.perform(delete(API_CONCEPT_URI + "/" + conceptInQuestion.getId())) -===================================================================== -Found a 5 line (31 tokens) duplication in the following files: -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 206 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 326 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the dataPackage under the new url - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getId())) - .andExpect(status().isOk()); -===================================================================== -Found a 4 line (31 tokens) duplication in the following files: -Starting at line 289 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 350 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 324 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 498 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 372 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 411 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 905 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - mockMvc.perform(delete(API_DATAPACKAGE_URI + "/" + dataPackage.getId())) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-delete-not-allowed"))); - } -===================================================================== -Found a 3 line (31 tokens) duplication in the following files: -Starting at line 76 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/AvailableDataSetNumbersResourceControllerTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/AvailableInstrumentNumbersResourceControllerTest.java -Starting at line 63 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/AvailableSurveyNumbersResourceControllerTest.java - - .perform(get("/api/study-serieses")).andExpect(status().isOk()) - .andExpect(jsonPath("$.length()", is(1))) - .andExpect(jsonPath("$.[0].de", is(dataPackage.getStudySeries().getDe()))); -===================================================================== -Found a 7 line (31 tokens) duplication in the following files: -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 149 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - shadow = dataPackageRepository.save(shadow); - release.setVersion("1.0.1"); - - shadowCopyService.createShadowCopies(project.getId(), project.getRelease(), - "1.0.0"); - - Optional persistedShadow = dataPackageRepository.findById(shadow.getId()); -===================================================================== -Found a 3 line (31 tokens) duplication in the following files: -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 159 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - DataPackage shadow = new DataPackage(master); - shadow.setId(master.getId() + "-" + version); - shadow.setDataAcquisitionProjectId(master.getDataAcquisitionProjectId() + "-" + version); -===================================================================== -Found a 4 line (31 tokens) duplication in the following files: -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/AvailableDataSetNumbersResourceControllerTest.java -Starting at line 69 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/AvailableSurveyNumbersResourceControllerTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 131 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 290 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 316 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 354 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - public void testAvailableNumbersIfThereIsOneDataSet() throws Exception { - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - rdcProjectRepository.save(project); - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); -===================================================================== -Found a 6 line (31 tokens) duplication in the following files: -Starting at line 324 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 346 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 366 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java - - public void testUpdateAttachmentOfShadowDataSet() throws Exception { - String dataSetId = "dat-issue1991-ds1$-1.0.0"; - DataSetAttachmentMetadata metadata = UnitTestCreateDomainObjectUtils - .buildDataSetAttachmentMetadata("issue1991", 1); - metadata.setDataSetId(dataSetId); - metadata.generateId(); -===================================================================== -Found a 6 line (31 tokens) duplication in the following files: -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 248 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 357 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - public void testCreateDataSetWithSurveyButWithoutProject() throws Exception { - // Arrange - DataAcquisitionProject project = UnitTestCreateDomainObjectUtils.buildDataAcquisitionProject(); - this.dataAcquisitionProjectRepository.save(project); - - Survey survey = UnitTestCreateDomainObjectUtils.buildSurvey(project.getId()); -===================================================================== -Found a 5 line (31 tokens) duplication in the following files: -Starting at line 169 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 273 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - .andExpect(status().is2xxSuccessful()); - - // read the updated instrument and check the version - mockMvc.perform(get(API_INSTRUMENTS_URI + "/" + instrument.getId())) - .andExpect(status().isOk()) -===================================================================== -Found a 3 line (31 tokens) duplication in the following files: -Starting at line 108 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/ordermanagement/rest/OrderResourceTest.java - - mockMvc.perform(post("/api/orders").contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(order))).andExpect(status().isBadRequest()); - } -===================================================================== -Found a 7 line (31 tokens) duplication in the following files: -Starting at line 371 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 460 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(project))) - .andExpect(status().isBadRequest()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER, username = PUBLISHER_USERNAME) - public void testUpdateRequiredObjectTypes() throws Exception { -===================================================================== -Found a 7 line (31 tokens) duplication in the following files: -Starting at line 410 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 306 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.DATA_PROVIDER, username = DATA_PROVIDER_USERNAME) -===================================================================== -Found a 4 line (31 tokens) duplication in the following files: -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 192 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // assert that the question exists - mockMvc.perform(get(API_QUESTIONS_URI + "/" + question.getId())).andExpect(status().isOk()); -===================================================================== -Found a 5 line (31 tokens) duplication in the following files: -Starting at line 163 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 327 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - mockMvc.perform(delete(API_QUESTIONS_URI + "/" + question.getId())).andExpect(status().isNoContent()); - - // assert that the question does not exist anymore - mockMvc.perform(get(API_QUESTIONS_URI + "/" + question.getId())) - .andExpect(status().isNotFound()); -===================================================================== -Found a 6 line (31 tokens) duplication in the following files: -Starting at line 302 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 324 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 344 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - public void testUpdateAttachmentOfShadowCopySurvey() throws Exception { - String surveyId = "sur-issue1991-sy1$-1.0.0"; - SurveyAttachmentMetadata metadata = UnitTestCreateDomainObjectUtils - .buildSurveyAttachmentMetadata("issue1991", 1); - metadata.setSurveyId(surveyId); - metadata.generateId(); -===================================================================== -Found a 4 line (31 tokens) duplication in the following files: -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 177 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 383 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andReturn(); -===================================================================== -Found a 5 line (31 tokens) duplication in the following files: -Starting at line 71 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageShadowCopyServiceTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageShadowCopyServiceTest.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyResponseRateImageShadowCopyServiceTest.java - - createTestFileForSurveyRateImage(master); - DataAcquisitionProject dataAcquisitionProject = createDataAcquisitionProject(); - release.setVersion("1.0.1"); - shadowCopyService.createShadowCopies(dataAcquisitionProject.getId(), - dataAcquisitionProject.getRelease(), "1.0.0"); -===================================================================== -Found a 8 line (31 tokens) duplication in the following files: -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 246 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - .content(user.getEmail())).andExpect(status().isOk()); - - this.userRepository.deleteById(user.getId()); - } - - - @Test - public void testSaveAccount() throws Exception { -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 102 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/AbstractAttachmentShadowCopyDataSource.java -Starting at line 144 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/AbstractAttachmentShadowCopyDataSource.java -Starting at line 169 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/AbstractAttachmentShadowCopyDataSource.java - - new Query(GridFsCriteria.whereMetaData("dataAcquisitionProjectId").is(oldProjectVersion) - .andOperator(GridFsCriteria.whereFilename().regex(getMasterFileNamePattern()), - GridFsCriteria.whereMetaData("shadow").is(true))); -===================================================================== -Found a 6 line (30 tokens) duplication in the following files: -Starting at line 199 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/common/service/TaskManagementService.java -Starting at line 235 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/service/DataAcquisitionProjectManagementService.java - - public Optional read(String id) { - return crudHelper.read(id); - } - - @Override - @Secured(value = {AuthoritiesConstants.PUBLISHER, AuthoritiesConstants.ADMIN, -===================================================================== -Found a 8 line (30 tokens) duplication in the following files: -Starting at line 29 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/domain/ConceptAttachmentMetadata.java -Starting at line 31 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/domain/DataSetAttachmentMetadata.java -Starting at line 31 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/domain/InstrumentAttachmentMetadata.java - -@Entity -@EqualsAndHashCode(callSuper = false, of = "id") -@ToString(callSuper = true) -@NoArgsConstructor -@Data -@AllArgsConstructor -@Builder -public class ConceptAttachmentMetadata extends AbstractRdcDomainObject { -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 72 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptAttachmentService.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptAttachmentService.java -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageAttachmentService.java -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 162 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetAttachmentService.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentAttachmentService.java -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java - - public void deleteAllByConceptId(String conceptId) { - String currentUser = SecurityUtils.getCurrentUserLogin(); - Query query = new Query(GridFsCriteria.whereFilename() - .regex("^" + Pattern.quote( -===================================================================== -Found a 12 line (30 tokens) duplication in the following files: -Starting at line 117 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptAttachmentService.java -Starting at line 148 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyAttachmentService.java - - ConceptAttachmentMetadata.class, file.getMetadata()); - javers.commitShallowDelete(currentUser, metadata); - }); - this.operations.delete(query); - } - - /** - * Delete the attachment and its metadata from gridfs. - * @param conceptId The id of the {@link Concept}. - * @param filename The filename of the attachment. - */ - public void deleteByConceptIdAndFilename(String conceptId, String filename) { -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 93 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 145 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 187 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 211 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/service/ConceptManagementService.java -Starting at line 499 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/service/ElasticsearchUpdateQueueService.java - - .map(instrument -> instrument.getConceptIds() != null ? instrument.getConceptIds() - : new ArrayList()) - .flatMap(List::stream).collect(Collectors.toSet())); -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageOverviewResource.java -Starting at line 91 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetReportResource.java - - @PostMapping(value = "/data-packages/{dataPackageId}/overview/fill-template") - @Secured(value = {AuthoritiesConstants.TASK_USER}) - public ResponseEntity fillTemplate(@RequestParam("file") MultipartFile templateZip, - @PathVariable("dataPackageId") String dataPackageId, @RequestParam("version") String version) -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 55 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageListService.java -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageListService.java - - .query(QueryBuilders.boolQuery().filter(QueryBuilders.termQuery("shadow", true)) - .mustNot(QueryBuilders.existsQuery("successorId"))) - .from(page * size).size(size).sort("title.de", SortOrder.ASC); -===================================================================== -Found a 6 line (30 tokens) duplication in the following files: -Starting at line 113 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageOverviewService.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetReportService.java - - dataForTemplate.put("version", version); - dataForTemplate.put("removeMarkdown", markdownHelper.createRemoveMarkdownMethod()); - dataForTemplate.put("displayAccessWay", AccessWays.createDisplayAccessWayMethod()); - - try { - String mainFilledStr = -===================================================================== -Found a 7 line (30 tokens) duplication in the following files: -Starting at line 41 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/repository/InstrumentRepository.java -Starting at line 34 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/repository/VariableRepository.java - - String dataAcquisitionProjectId); - - @RestResource(exported = false) - Stream streamIdsBySurveyIdsContaining(String surveyId); - - @RestResource(exported = false) - Stream streamIdsByDataPackageId(String dataPackageId); -===================================================================== -Found a 7 line (30 tokens) duplication in the following files: -Starting at line 61 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentChangesProvider.java -Starting at line 40 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionChangesProvider.java - - List oldConceptIds = oldInstrument.getConceptIds(); - - if (oldConceptIds == null || oldConceptIds.isEmpty()) { - return Collections.emptySet(); - } - - List newConceptIds = newInstrument.getConceptIds(); -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 44 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/repository/DaraUpdateQueueItemRepositoryImpl.java -Starting at line 37 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/repository/ShadowCopyQueueRepositoryCustomImpl.java -Starting at line 38 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/repository/ElasticsearchUpdateQueueItemRepositoryImpl.java - - Query query = new Query(getUnlockedOrExpiredCriteria()).limit(BULK_SIZE); - Update update = new Update() - .set("updateStartedAt", updateStartedAt).set("updateStartedBy", updateStartedBy); - mongoOperations.updateMulti(query, update, DaraUpdateQueueItem.class); -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 73 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/usermanagement/security/SecurityUtils.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/main/java/eu/dzhw/fdz/metadatamanagement/usermanagement/security/SecurityUtils.java - - public static CustomUserDetails getCurrentUser() { - SecurityContext securityContext = SecurityContextHolder.getContext(); - Authentication authentication = securityContext.getAuthentication(); - if (authentication != null && authentication.getPrincipal() instanceof CustomUserDetails) { -===================================================================== -Found a 7 line (30 tokens) duplication in the following files: -Starting at line 66 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/domain/I18nStringTest.java -Starting at line 75 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/domain/PeriodTest.java -Starting at line 62 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/domain/AuthorityTest.java -Starting at line 51 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/domain/UserTests.java -Starting at line 36 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/domain/VariableTest.java - - boolean checkSameButDifferentEnd = i18nString1.equals(i18nString2); - - // Assert - assertThat(checkNull, is(false)); - assertThat(checkClass, is(false)); - assertThat(checkSame, is(true)); - assertThat(checkSameButDifferentNoEnNoDe, is(true)); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 318 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 415 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java - - .title(I18nString.builder().de("Titel De").en("Title En").build()) - .annotations(I18nString.builder().de("De Anmerkungen").en("En Annotations").build()) - .tags(tags).surveyDesign(SurveyDesigns.PANEL) -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 451 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java -Starting at line 457 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/common/unittesthelper/util/UnitTestCreateDomainObjectUtils.java - - .dataPackageId(UnitTestCreateValidIds.buildDataPackageId(projectId)).fileName("filename.txt") - .description(new I18nString("Beschreibung", "Description")).title("Title").language("de") - .type(DataPackageAttachmentTypes.METHOD_REPORT).indexInDataPackage(1).build(); -===================================================================== -Found a 6 line (30 tokens) duplication in the following files: -Starting at line 79 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 141 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 213 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 233 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentVersionsResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - ConceptAttachmentMetadata conceptAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildConceptAttachmentMetadata("con-conceptid$"); -===================================================================== -Found a 2 line (30 tokens) duplication in the following files: -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 200 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 182 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 2 line (30 tokens) duplication in the following files: -Starting at line 188 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 115 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 155 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - .perform(get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(1))); -===================================================================== -Found a 5 line (30 tokens) duplication in the following files: -Starting at line 223 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 244 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 242 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 262 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 313 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 237 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 258 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 315 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 220 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 240 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 109 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 217 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 238 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 293 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 198 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/concepts/attachments") - .file(attachment) - .file(metadata)) - .andExpect(status().isBadRequest()) - .andExpect(jsonPath("$.errors[0].message", -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 259 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 104 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - mockMvc.perform(put("/api/concepts/" + concept.getId()) - .content(TestUtil.convertObjectToJsonBytes(concept)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 282 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptAttachmentResourceTest.java -Starting at line 295 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 297 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 276 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 276 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java - - get("/api/concepts/" + conceptAttachmentMetadata.getConceptId() + "/attachments")) - .andExpect(status().isOk()) - .andExpect(content().json("[]")); - } -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java -Starting at line 214 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the concept under the new url - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId())).andExpect(status().isOk()); -===================================================================== -Found a 2 line (30 tokens) duplication in the following files: -Starting at line 77 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 135 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(equalTo(1)))) -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 78 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 112 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java - - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(equalTo(1)))) - .andExpect(jsonPath("$[0].id", is(concept.getId()))) - .andExpect(jsonPath("$[0].title.de", is(concept.getTitle().getDe()))) -===================================================================== -Found a 2 line (30 tokens) duplication in the following files: -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 92 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 87 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(get(API_CONCEPT_URI + "/" + concept.getId() + "/versions")) - .andExpect(status().isOk()).andExpect(jsonPath("$.length()", is(equalTo(3)))) -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/conceptmanagement/rest/ConceptVersionsResourceTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 151 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(get(API_CONCEPT_URI + "/spaß/versions")).andExpect(status().isOk()) - .andExpect(jsonPath("$.length()", is(0))); - } -} -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 274 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 143 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 199 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 193 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - mockMvc.perform(put("/api/data-packages/" + dataPackage.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataPackage)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 337 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 261 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 276 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 338 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 321 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 336 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 296 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 471 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 485 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 345 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 359 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 153 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 173 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 193 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 316 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 384 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 398 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 310 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 339 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 360 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 389 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 421 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 874 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 890 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - .content(TestUtil.convertObjectToJsonBytes(metadata)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-save-not-allowed"))); -===================================================================== -Found a 6 line (30 tokens) duplication in the following files: -Starting at line 380 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageAttachmentResourceTest.java -Starting at line 379 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 324 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 498 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 372 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 357 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 411 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 905 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - "/api/data-packages/" + dataPackageId + "/attachments/" + metadata.getFileName())) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", - containsString("global.error.shadow-delete-not-allowed"))); - } - -} -===================================================================== -Found a 17 line (30 tokens) duplication in the following files: -Starting at line 46 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 50 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 31 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/StudySeriesesResourceControllerTest.java - - @Autowired - private WebApplicationContext wac; - - @Autowired - private DataAcquisitionProjectRepository dataAcquisitionProjectRepository; - - @Autowired - private DataPackageRepository dataPackageRepository; - - @Autowired - private ElasticsearchUpdateQueueItemRepository elasticsearchUpdateQueueItemRepository; - - @Autowired - private ElasticsearchAdminService elasticsearchAdminService; - - @Autowired - private JaversService javersService; -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackagePublicListResourceControllerTest.java - - UnitTestUserManagementUtils.logout(); - mockMvc.perform(get(API_DATAPACKAGE_URI)).andExpect(status().isOk()) - .andExpect(jsonPath("$.content.length()", is(0))); -===================================================================== -Found a 5 line (30 tokens) duplication in the following files: -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 121 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java -Starting at line 302 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageResourceControllerTest.java - - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); - - // read the dataPackage under the new url - mockMvc.perform(get(API_DATAPACKAGE_URI + "/" + dataPackage.getId())) - .andExpect(status().isOk()); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java -Starting at line 154 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/rest/DataPackageVersionsResourceTest.java - - .andExpect(jsonPath("$.length()", is(equalTo(1)))) - .andExpect(jsonPath("$[0].id", is(dataPackage.getId()))) - .andExpect(jsonPath("$[0].title.de", is(dataPackage.getTitle().getDe()))) -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 125 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 126 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 122 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - dataPackageRepository.saveAll(Arrays.asList(master, shadow)); - - shadowCopyService.createShadowCopies(project.getId(), project.getRelease(), - "1.0.0"); -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DataPackageShadowCopyServiceTest.java -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/service/DataSetShadowCopyServiceTest.java -Starting at line 99 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/service/InstrumentShadowCopyServiceTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/service/QuestionShadowCopyServiceTest.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/service/SurveyShadowCopyServiceTest.java -Starting at line 100 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/service/VariableShadowCopyServiceTest.java - - dataPackageRepository.saveAll(Arrays.asList(master, shadow)); - - shadowCopyService.createShadowCopies(project.getId(), project.getRelease(), - "1.0.0"); -===================================================================== -Found a 9 line (30 tokens) duplication in the following files: -Starting at line 60 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/AvailableDataSetNumbersResourceControllerTest.java -Starting at line 54 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/AvailableSurveyNumbersResourceControllerTest.java - - surveyRepo.deleteAll(); - rdcProjectRepository.deleteAll(); - javersService.deleteAll(); - elasticsearchUpdateQueueItemRepository.deleteAll(); - elasticsearchAdminService.recreateAllIndices(); - } - - @Test - public void testAvailableNumbersIfThereAreNoDataSets() throws Exception { -===================================================================== -Found a 6 line (30 tokens) duplication in the following files: -Starting at line 90 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 152 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 185 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 227 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 247 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 304 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 59 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentVersionsResourceTest.java - - public void testUploadValidAttachment() throws Exception { - - MockMultipartFile attachment = - new MockMultipartFile("file", "filename.txt", "text/plain", "some text".getBytes()); - DataSetAttachmentMetadata dataSetAttachmentMetadata = UnitTestCreateDomainObjectUtils - .buildDataSetAttachmentMetadata("projectid", 1); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 274 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetAttachmentResourceTest.java -Starting at line 140 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 111 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - mockMvc.perform(put("/api/data-sets/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 8 line (30 tokens) duplication in the following files: -Starting at line 86 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 81 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 82 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - this.dataSetRepository.deleteAll(); - this.elasticsearchUpdateQueueService.clearQueue(); - this.elasticsearchAdminService.recreateAllIndices(); - this.javersService.deleteAll(); - } - - @Test - public void testCreateDataSet() throws Exception { -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 170 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 188 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 320 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - mockMvc.perform(put(API_DATASETS_URI + "/" + dataSet.getId()) - .content(TestUtil.convertObjectToJsonBytes(dataSet)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 316 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 329 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java -Starting at line 344 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetResourceControllerTest.java - - public void testCreateShadowCopyDataSet() throws Exception { - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet("issue1991", "test", 1); - dataSet.setId(dataSet.getId() + "-1.0.0"); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 94 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java -Starting at line 137 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/datasetmanagement/rest/DataSetVersionsResourceTest.java - - .andExpect(jsonPath("$.length()", is(equalTo(1)))) - .andExpect(jsonPath("$[0].id", is(dataSet.getId()))) - .andExpect(jsonPath("$[0].description.de", is(dataSet.getDescription().getDe()))); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentAttachmentResourceTest.java -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 196 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 83 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - mockMvc.perform(put("/api/instruments/" + instrument.getId()) - .content(TestUtil.convertObjectToJsonBytes(instrument)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (30 tokens) duplication in the following files: -Starting at line 101 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 134 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 273 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java - - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(1L)); - - // check that auditing attributes have been set - mockMvc.perform(get(API_INSTRUMENTS_URI + "/" + instrument.getId())) - .andExpect(status().isOk()) -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 209 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 232 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 254 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentResourceControllerTest.java -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java - - .content(TestUtil.convertObjectToJsonBytes(instrument)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()) - .andExpect( - jsonPath("$.errors[0].message", is("instrument-management.error.instrument.type.valid"))); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 91 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java -Starting at line 132 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/instrumentmanagement/rest/InstrumentVersionsResourceTest.java - - .andExpect(jsonPath("$.length()", is(equalTo(1)))) - .andExpect(jsonPath("$[0].id", is(instrument.getId()))) - .andExpect(jsonPath("$[0].title.de", is(instrument.getTitle().getDe()))); -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 120 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java - - mockMvc.perform(post("/api/data-acquisition-projects/" + project.getId() + "/release") - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 138 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DaraServiceTest.java -Starting at line 409 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 458 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 470 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - .perform(post("/api/data-acquisition-projects/" + project.getMasterId() + "/release") - .content(TestUtil.convertObjectToJsonBytes(project)) - .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()).andExpect(jsonPath("$.errors[0].message", is( -===================================================================== -Found a 6 line (30 tokens) duplication in the following files: -Starting at line 114 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 223 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 284 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 343 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 401 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 417 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 433 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - buildValidProject(); - - // Act & Assert - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_POST_VALIDATION_URI)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.errors", hasSize(0)));//no errors -===================================================================== -Found a 5 line (30 tokens) duplication in the following files: -Starting at line 205 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 264 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 326 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java -Starting at line 383 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectPostValidationResourceTest.java - - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "name3", 3, surveyNumbers); - this.variableRepository.save(variable3); - - //DataSet - DataSet dataSet = UnitTestCreateDomainObjectUtils.buildDataSet(project.getId(), survey.getId(), 1); -===================================================================== -Found a 2 line (30 tokens) duplication in the following files: -Starting at line 106 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 176 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 204 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 191 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectShadowsResourceTest.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectVersionsResourceTest.java - - mockMvc.perform(post(API_DATA_ACQUISITION_PROJECTS_URI).contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))).andExpect(status().isCreated()); -===================================================================== -Found a 2 line (30 tokens) duplication in the following files: -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 149 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - mockMvc.perform(delete(API_DATA_ACQUISITION_PROJECTS_URI + "/" + project.getId()) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isNotFound()); -===================================================================== -Found a 7 line (30 tokens) duplication in the following files: -Starting at line 166 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 222 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - .andExpect(status().isOk()).andExpect(jsonPath("$.id", is(project.getId()))) - .andExpect(jsonPath("$.version", is(0))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testUpdateProject() throws IOException, Exception { -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 240 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 337 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 349 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 361 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java -Starting at line 369 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/rest/DataAcquisitionProjectResourceControllerTest.java - - .perform(post(API_DATA_ACQUISITION_PROJECTS_URI).contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(project))) - .andExpect(status().isBadRequest()) -===================================================================== -Found a 8 line (30 tokens) duplication in the following files: -Starting at line 112 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionImageResourceTest.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - containsString("global.error.shadow-create-not-allowed"))); - } - - @Test - @WithMockUser(authorities = AuthoritiesConstants.PUBLISHER) - public void testUploadEmptyImage() throws Exception { - MockMultipartFile attachment = - new MockMultipartFile("image", "image.png", "image/png", "".getBytes()); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 98 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 156 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - mockMvc.perform(put(API_QUESTIONS_URI + "/" + question.getId()) - .content(TestUtil.convertObjectToJsonBytes(question)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 5 line (30 tokens) duplication in the following files: -Starting at line 105 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 136 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 157 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - assertThat(elasticsearchAdminService.countAllDocuments(), equalTo(1L)); - - // check that auditing attributes have been set - mockMvc.perform(get(API_QUESTIONS_URI + "/" + question.getId())) - .andExpect(status().isOk()) -===================================================================== -Found a 2 line (30 tokens) duplication in the following files: -Starting at line 130 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 220 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 246 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 322 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - mockMvc.perform(post(API_QUESTIONS_URI).content(TestUtil.convertObjectToJsonBytes(question)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 271 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 288 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 305 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 344 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - mockMvc.perform(put(API_QUESTIONS_URI + "/" + question.getId()) - .content(TestUtil.convertObjectToJsonBytes(question)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 339 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 352 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java -Starting at line 366 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/questionmanagement/rest/QuestionResourceControllerTest.java - - public void testCreateShadowCopyQuestion() throws Exception { - Question question = UnitTestCreateDomainObjectUtils - .buildQuestion("issue1991", 123, "instrument-Id"); - question.setId(question.getId() + "-1.0.0"); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 125 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 211 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java -Starting at line 246 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/relatedpublicationmanagement/rest/RelatedPublicationResourceControllerTest.java - - this.mockMvc.perform(post(API_RELATED_PUBLICATION_URI) - .content(TestUtil.convertObjectToJsonBytes(relatedPublication)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 5 line (30 tokens) duplication in the following files: -Starting at line 95 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/rest/SearchResourceTest.java -Starting at line 107 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 139 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 202 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 220 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 238 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 264 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 292 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 322 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 350 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 373 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 403 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 435 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 455 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 472 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 490 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 508 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 529 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 547 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 612 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 681 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 701 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 721 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 741 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 761 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 781 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 801 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 827 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 846 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - List surveyNumbers = new ArrayList(); - surveyNumbers.add(1); - - Variable variable = - UnitTestCreateDomainObjectUtils.buildVariable(project.getId(), 1, "var1", 1, surveyNumbers); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 253 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyAttachmentResourceTest.java -Starting at line 118 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 103 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - mockMvc.perform(put("/api/surveys/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isCreated()); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 194 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 215 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 234 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java -Starting at line 383 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResourceControllerTest.java - - mockMvc.perform(put(API_SURVEYS_URI + "/" + survey.getId()) - .content(TestUtil.convertObjectToJsonBytes(survey)).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isBadRequest()); -===================================================================== -Found a 5 line (30 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 110 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 128 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyResponseRateImageResourceTest.java - - new MockMultipartFile("image", FILE_NAME, "image/png", "fakeimage".getBytes()); - SurveyResponseRateImageMetadata surveyResponseRateImageMetadata = - createResponseRateImageMetadata(); - MockMultipartFile metadata = new MockMultipartFile("surveyResponseRateImageMetadata", FILE_NAME, - "application/json", TestUtil.convertObjectToJsonBytes(surveyResponseRateImageMetadata)); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 89 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java -Starting at line 124 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/surveymanagement/rest/SurveyVersionsResourceTest.java - - .andExpect(jsonPath("$.length()", is(equalTo(1)))) - .andExpect(jsonPath("$[0].id", is(survey.getId()))) - .andExpect(jsonPath("$[0].title.de", is(survey.getTitle().getDe()))); -===================================================================== -Found a 4 line (30 tokens) duplication in the following files: -Starting at line 119 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 80 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResourceTest.java -Starting at line 116 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/UserResourceTest.java - - restUserMockMvc.perform(get("/api/account").accept(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(jsonPath("$.login").value("test")) -===================================================================== -Found a 9 line (30 tokens) duplication in the following files: -Starting at line 147 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 167 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 246 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - .perform(get("/api/activate?key=testActivateTrue").accept(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()); - - // Delete - this.userRepository.deleteById(user.getId()); - } - - @Test - public void testRequestPasswordReset() throws Exception { -===================================================================== -Found a 2 line (30 tokens) duplication in the following files: -Starting at line 184 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 245 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - this.restMvc.perform(post("/api/account").contentType(MediaType.APPLICATION_JSON) - .content(TestUtil.convertObjectToJsonBytes(dto))).andExpect(status().isOk()); -===================================================================== -Found a 7 line (30 tokens) duplication in the following files: -Starting at line 221 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java -Starting at line 273 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/usermanagement/rest/AccountResourceTest.java - - .content("john.doe@jhipter.com")).andExpect(status().is4xxClientError()); - - this.userRepository.deleteById(user.getId()); - } - - @Test - public void testFinishPasswordReset() throws Exception { -===================================================================== -Found a 2 line (30 tokens) duplication in the following files: -Starting at line 146 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 254 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 281 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 592 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 622 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 649 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 730 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 790 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 807 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - mockMvc.perform(post(API_VARIABLES_URI).content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isCreated()); -===================================================================== -Found a 3 line (30 tokens) duplication in the following files: -Starting at line 174 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 192 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 210 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 228 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 330 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 463 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 480 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 498 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 516 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 537 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 556 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 574 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 690 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 710 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 750 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 770 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java -Starting at line 874 of /home/reitmann/data/metadatamanagement/src/test/java/eu/dzhw/fdz/metadatamanagement/variablemanagement/rest/VariableResourceControllerTest.java - - mockMvc.perform(put(API_VARIABLES_URI + "/" + variable.getId()) - .content(TestUtil.convertObjectToJsonBytes(variable)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isBadRequest()); -===================================================================== -Found a 10 line (30 tokens) duplication in the following files: -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/common/domain/QAbstractShadowableRdcDomainObject.java -Starting at line 41 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataPackageNestedDocument.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetNestedDocument.java -Starting at line 45 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentNestedDocument.java -Starting at line 43 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveyNestedDocument.java -Starting at line 47 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java - - public final DateTimePath lastModifiedDate = _super.lastModifiedDate; - - public final StringPath masterId = createString("masterId"); - - public final BooleanPath shadow = createBoolean("shadow"); - - public final StringPath successorId = createString("successorId"); - - //inherited - public final NumberPath version = _super.version; -===================================================================== -Found a 2 line (30 tokens) duplication in the following files: -Starting at line 154 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 149 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 168 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 158 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 180 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - this.dataPackage = inits.isInitialized("dataPackage") ? new QDataPackageSubDocument(forProperty("dataPackage"), inits.get("dataPackage")) : null; - this.dataPackageId = _super.dataPackageId; -===================================================================== -Found a 2 line (30 tokens) duplication in the following files: -Starting at line 165 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QDataSetSearchDocument.java -Starting at line 151 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QInstrumentSearchDocument.java -Starting at line 171 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QQuestionSearchDocument.java -Starting at line 160 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QSurveySearchDocument.java -Starting at line 183 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSearchDocument.java - - this.nestedDataPackage = inits.isInitialized("nestedDataPackage") ? new QDataPackageNestedDocument(forProperty("nestedDataPackage"), inits.get("nestedDataPackage")) : null; - this.number = _super.number; -===================================================================== -Found a 8 line (30 tokens) duplication in the following files: -Starting at line 37 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableNestedDocument.java -Starting at line 39 of /home/reitmann/data/metadatamanagement/target/generated-sources/java/eu/dzhw/fdz/metadatamanagement/searchmanagement/documents/QVariableSubDocument.java - - public final StringPath dataSetId = createString("dataSetId"); - - public final StringPath id = createString("id"); - - public final eu.dzhw.fdz.metadatamanagement.common.domain.QI18nString label; - - //inherited - public final StringPath lastModifiedBy; diff --git a/src/main/java/eu/dzhw/fdz/metadatamanagement/analysispackagemanagement/domain/AbstractAnalysisDataPackage.java b/src/main/java/eu/dzhw/fdz/metadatamanagement/analysispackagemanagement/domain/AbstractAnalysisDataPackage.java new file mode 100644 index 0000000000..89fdaffb83 --- /dev/null +++ b/src/main/java/eu/dzhw/fdz/metadatamanagement/analysispackagemanagement/domain/AbstractAnalysisDataPackage.java @@ -0,0 +1,25 @@ +package eu.dzhw.fdz.metadatamanagement.analysispackagemanagement.domain; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Analysis data which is part of an analysis package. There are three concrete implementations. + * + * @author René Reitmann + */ +@Data +@NoArgsConstructor +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({@Type(value = DataPackage.class, name = "dataPackage"), + @Type(value = ExternalDataPackage.class, name = "externalData")}) +public abstract class AbstractAnalysisDataPackage implements Serializable { + + private static final long serialVersionUID = -2179924716031946800L; +} diff --git a/src/main/java/eu/dzhw/fdz/metadatamanagement/analysispackagemanagement/domain/AnalysisPackage.java b/src/main/java/eu/dzhw/fdz/metadatamanagement/analysispackagemanagement/domain/AnalysisPackage.java new file mode 100644 index 0000000000..fe51c70ad3 --- /dev/null +++ b/src/main/java/eu/dzhw/fdz/metadatamanagement/analysispackagemanagement/domain/AnalysisPackage.java @@ -0,0 +1,231 @@ +package eu.dzhw.fdz.metadatamanagement.analysispackagemanagement.domain; + +import java.util.List; + +import javax.validation.Valid; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.validation.constraints.Size; + +import org.javers.core.metamodel.annotation.Entity; +import org.springframework.beans.BeanUtils; +import org.springframework.data.annotation.Id; +import org.springframework.data.mongodb.core.index.Indexed; +import org.springframework.data.mongodb.core.mapping.Document; + +import eu.dzhw.fdz.metadatamanagement.analysispackagemanagement.domain.projection.AnalysisPackageSubDocumentProjection; +import eu.dzhw.fdz.metadatamanagement.analysispackagemanagement.domain.validation.ValidAnalysisPackageId; +import eu.dzhw.fdz.metadatamanagement.common.domain.AbstractShadowableRdcDomainObject; +import eu.dzhw.fdz.metadatamanagement.common.domain.I18nLink; +import eu.dzhw.fdz.metadatamanagement.common.domain.I18nString; +import eu.dzhw.fdz.metadatamanagement.common.domain.Person; +import eu.dzhw.fdz.metadatamanagement.common.domain.util.Patterns; +import eu.dzhw.fdz.metadatamanagement.common.domain.validation.I18nStringEntireNotEmpty; +import eu.dzhw.fdz.metadatamanagement.common.domain.validation.I18nStringSize; +import eu.dzhw.fdz.metadatamanagement.common.domain.validation.StringLengths; +import eu.dzhw.fdz.metadatamanagement.common.domain.validation.ValidShadowId; +import eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.DataAcquisitionProject; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +/** + * An analysis package contains all metadata of scripts and analysis data. It will get a DOI + * (Digital Object Identifier) when the {@link DataAcquisitionProject} is released. + */ +@Entity +@Document(collection = "analysis_packages") +@ValidAnalysisPackageId( + message = "analysis-package-management.error.analysis-package.id.not-valid-id") +@EqualsAndHashCode(callSuper = false, of = "id") +@ToString(callSuper = true) +@NoArgsConstructor +@Data +@AllArgsConstructor +@Builder +@Schema(description = "Go here for further details.") +@ValidShadowId(message = "analysis-package-management.error.analysis-package.id.pattern") +public class AnalysisPackage extends AbstractShadowableRdcDomainObject + implements AnalysisPackageSubDocumentProjection { + private static final long serialVersionUID = 3006197991079331471L; + /** + * The id of the analysis package which uniquely identifies the analysis package in this + * application. + */ + @Id + @Setter(AccessLevel.NONE) + @NotEmpty(message = "analysis-package-management.error.analysis-package.id.not-empty") + private String id; + + /** + * The master id of the analysis package. + * + * The master id must not be empty, must be of the form {@code ana-{{dataAcquisitionProjectId}}$} + * and the master id must not contain more than 512 characters. + */ + @NotEmpty(message = "analysis-package-management.error.analysis-package.master-id.not-empty") + @Size(max = StringLengths.MEDIUM, + message = "analysis-package-management.error.analysis-package.master-id.size") + @Pattern(regexp = Patterns.GERMAN_ALPHANUMERIC_WITH_UNDERSCORE_AND_MINUS_AND_DOLLAR, + message = "analysis-package-management.error.analysis-package.master-id.pattern") + @Setter(AccessLevel.NONE) + @Indexed + private String masterId; + + /** + * The id of the {@link DataAcquisitionProject} to which this analysis package belongs. + * + * The dataAcquisitionProjectId must not be empty. + */ + @Indexed + @NotEmpty(message = "analysis-package-management.error.analysis-package." + + "data-acquisition-project.id.not-empty") + private String dataAcquisitionProjectId; + + /** + * The title of the analysis package. + * + * It must be specified in German and English and it must not contain more than 2048 characters. + */ + @NotNull(message = "analysis-package-management.error.analysis-package.title.not-null") + @I18nStringSize(max = StringLengths.LARGE, + message = "analysis-package-management.error.analysis-package.title.i18n-string-size") + @I18nStringEntireNotEmpty(message = "analysis-package-management.error.analysis-package.title." + + "i18n-string-entire-not-empty") + private I18nString title; + + /** + * A description of the analysis package. Markdown is supported. + * + * It must be specified in German and English and it must not contain more than 2048 characters. + */ + @NotNull(message = "analysis-package-management.error.analysis-package.description.not-null") + @I18nStringSize(max = StringLengths.LARGE, + message = "analysis-package-management.error.analysis-package.description.i18n-string-size") + @I18nStringEntireNotEmpty( + message = "analysis-package-management.error.analysis-package.description." + + "i18n-string-not-empty") + private I18nString description; + + /** + * Arbitrary additional text for this analysis package. Markdown is supported. + * + * Must not contain more than 2048 characters. + */ + @I18nStringSize(max = StringLengths.LARGE, + message = "analysis-package-management.error.analysis-package.annotations.i18n-string-size") + private I18nString annotations; + + /** + * List of {@link Person}s which have created this analysis package. + * + * Must not be empty. + */ + @Valid + @NotEmpty(message = "analysis-package-management.error.analysis-package.authors.not-empty") + private List authors; + + /** + * List of {@link Person}s which have curated this analysis package. + * + * Must not be empty. + */ + @Valid + @NotEmpty(message = "analysis-package-management.error.analysis-package.data-curators.not-empty") + private List dataCurators; + + /** + * The names of the institutions which have participated in creating this analysis package. + * + * It can be empty but if present must be specified in German and English and it must not contain + * more than 512 characters. + */ + @Valid + private List<@I18nStringSize(max = StringLengths.MEDIUM, + message = "analysis-package-management.error.analysis-package.institution.i18n-string-size") + @I18nStringEntireNotEmpty( + message = "analysis-package-management.error.analysis-package.institution" + + ".i18n-string-entire-not-empty") I18nString> institutions; + + /** + * The names of the sponsors which have sponsored the study or project from which this analysis + * package results. + * + * It can be empty but if present must be specified in German and English and it must not contain + * more than 512 characters. + */ + @Valid + private List<@I18nStringSize(max = StringLengths.MEDIUM, + message = "analysis-package-management.error.analysis-package.sponsor.i18n-string-size") + @I18nStringEntireNotEmpty( + message = "analysis-package-management.error.sponsor.institution" + + ".i18n-string-entire-not-empty") I18nString> sponsors; + + /** + * The license of this analysis package. Markdown is supported. + * + * May be empty. Must not contain more than 1 MB characters. + */ + @Size(max = StringLengths.X_LARGE, + message = "analysis-package-management.error.analysis-package.license.size") + private String license; + + /** + * A list of additional links for the analysis package. + * + * May be empty. + */ + @Valid + private List additionalLinks; + + /** + * List of data packages used by the scripts in this analysis package. + * + * May be empty. + */ + @Valid + private List analysisDataPackages; + + /** + * List of scripts which are part of the analysis package. + * + * At least one {@link Script} must be specified. + */ + @Valid + @Size(min = 1, message = "analysis-package-management.error.analysis-package." + + "scripts.at-leat-one") + private List