From 822c101c555afc85ac9b75296f6b74550e7f8000 Mon Sep 17 00:00:00 2001 From: torarnet <6398417+torarnet@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:48:28 +0200 Subject: [PATCH] np-45284: removing unnecessary project creation. We already create two projects for each run --- .../projects/create/createProject.feature | 16 ---------------- .../projects/create/createSampleProject.feature | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/cristin-project/src/test/java/no/unit/nva/cristin/projects/create/createProject.feature b/cristin-project/src/test/java/no/unit/nva/cristin/projects/create/createProject.feature index 509d6e83c..b883f131a 100644 --- a/cristin-project/src/test/java/no/unit/nva/cristin/projects/create/createProject.feature +++ b/cristin-project/src/test/java/no/unit/nva/cristin/projects/create/createProject.feature @@ -11,7 +11,6 @@ Feature: API tests for Cristin Project retrieve and search * def tokenGenerator = Java.type('no.unit.nva.cognito.CognitoUtil') * def token = tokenGenerator.loginUser(username, password, cognitoClientAppId) * def minimalCreateRequest = { type: 'Project', title: 'Test Project', language: 'http://lexvo.org/id/iso639-3/nob', startDate: '2010-06-29T01:33:17.518Z', endDate: '2030-06-29T01:33:17.518Z', coordinatingInstitution: {type: 'Organization',id: 'https://api.cristin-test.uio.no/v2/institutions/20202'},contributors: [{type: 'ProjectManager',identity: {type: 'Person',id: 'https://api.cristin-test.uio.no/v2/persons/515114'},affiliation: {type: 'Organization',id: 'https://api.cristin-test.uio.no/v2/institutions/20202'}}]} - * def minimalCreateRequestWithUnitIdentifiers = { type: 'Project', title: 'Test Project', language: 'http://lexvo.org/id/iso639-3/nob', startDate: '2010-06-29T01:33:17.518Z', endDate: '2030-06-29T01:33:17.518Z', coordinatingInstitution: {type: 'Organization',id: 'https://api.dev.nva.aws.unit.no/cristin/organization/20202.0.0.0'},contributors: [{type: 'ProjectManager',identity: {type: 'Person',id: 'https://api.dev.nva.aws.unit.no/cristin/person/515114'}}]} * def lessThanMinimalCreateRequest = { type: 'Project', startDate: '2010-06-29T01:33:17.518Z', endDate: '2030-06-29T01:33:17.518Z', coordinatingInstitution: {type: 'Organization',id: 'https://api.cristin-test.uio.no/v2/institutions/20202'},contributors: [{type: 'ProjectManager',identity: {type: 'Person',id: 'https://api.cristin-test.uio.no/v2/persons/515114'},affiliation: {type: 'Organization',id: 'https://api.cristin-test.uio.no/v2/institutions/20202'}}]} * def requestWithIllegalValues = { type: 'Project', title: 'Test Project', startDate: '2010-06-29T01:33:17.518Z', endDate: 'IllegalValue', coordinatingInstitution: {type: 'Organization',id: 'https://api.cristin-test.uio.no/v2/institutions/20202'},contributors: [{type: 'IllegalValue',identity: {type: 'Person',id: 'https://api.cristin-test.uio.no/v2/persons/515114'},affiliation: {type: 'Organization',id: 'https://api.cristin-test.uio.no/v2/institutions/20202'}}]} * def requestWithId = { id: 'https://api.dev.nva.aws.unit.no/cristin/project/2121331275', type: 'Project', title: 'Test Project', language: 'http://lexvo.org/id/iso639-3/nob', startDate: '2010-06-29T01:33:17.518Z', endDate: '2030-06-29T01:33:17.518Z', coordinatingInstitution: {type: 'Organization',id: 'https://api.cristin-test.uio.no/v2/institutions/20202'},contributors: [{type: 'ProjectManager',identity: {type: 'Person',id: 'https://api.cristin-test.uio.no/v2/persons/515114'},affiliation: {type: 'Organization',id: 'https://api.cristin-test.uio.no/v2/institutions/20202'}}]} @@ -76,18 +75,3 @@ Feature: API tests for Cristin Project retrieve and search And match response.status == 400 And print response.detail - Scenario: Create returns status 201 Created when input is valid and persisted in crisin - Given path '/project' - * header Authorization = 'Bearer ' + token - And request minimalCreateRequest - When method POST - Then status 201 - And print response - - Scenario: Create returns status 201 Created when input is valid with unit identifiers and persisted in cristin - Given path '/project' - * header Authorization = 'Bearer ' + token - And request minimalCreateRequestWithUnitIdentifiers - When method POST - Then status 201 - And print response diff --git a/cristin-project/src/test/java/no/unit/nva/cristin/projects/create/createSampleProject.feature b/cristin-project/src/test/java/no/unit/nva/cristin/projects/create/createSampleProject.feature index 1e5843a51..9a6aca32b 100644 --- a/cristin-project/src/test/java/no/unit/nva/cristin/projects/create/createSampleProject.feature +++ b/cristin-project/src/test/java/no/unit/nva/cristin/projects/create/createSampleProject.feature @@ -1,4 +1,4 @@ -Feature: API tests for Cristin Project retrieve and search +Feature: API tests for creating sample Cristin Projects Background: * def domainName = java.lang.System.getenv('DOMAIN_NAME')