Skip to content

Commit

Permalink
np-45284: removing unnecessary project creation.
Browse files Browse the repository at this point in the history
We already create two projects for each run
  • Loading branch information
torarnet committed Oct 20, 2023
1 parent 2d2fd78 commit 822c101
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'}}]}
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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')
Expand Down

0 comments on commit 822c101

Please sign in to comment.