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 extends InstrumentSearchDocument> 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 extends InstrumentSearchDocument> 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 extends Tags> 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 extends ConceptNestedDocument> 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 extends DataSetNestedDocument> 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 extends InstrumentSearchDocument> 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 extends GrantedAuthority> 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 extends ConceptNestedDocument> 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 extends ConceptSearchDocument> 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 extends DataPackageSearchDocument> 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 extends ConceptNestedDocument> 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.