Skip to content

Commit

Permalink
API Consumer fetches a single Gluu attribute by inum #33 #43 #44 #27 #35
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrydy committed Aug 8, 2020
1 parent 3991a75 commit d18b9d9
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
27 changes: 27 additions & 0 deletions src/test/resources/attribute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"adminCanAccess": true,
"adminCanEdit": true,
"adminCanView": true,
"custom": false,
"dataType": "STRING",
"description": "QAAdded Attribute",
"displayName": "QAAdded Attribute",
"editType": [
"ADMIN",
"USER"
],
"name": "qaattribute",
"origin": "gluuPerson",
"oxMultiValuedAttribute": false,
"requred": false,
"status": "ACTIVE",
"urn": "urn:mace:dir:attribute-def:qaattribute",
"userCanAccess": true,
"userCanEdit": true,
"userCanView": true,
"viewType": [
"ADMIN",
"USER"
],
"whitePagesCanView": false
}
Empty file.
46 changes: 46 additions & 0 deletions src/test/resources/feature/attribute/attributes.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Feature: Attributes

@CreateUpdateDelete
Scenario: Create new attribute
Given url attributes_url
And header Authorization = 'Bearer ' + accessToken
And request read('classpath:attribute.json')
When method POST
Then status 201
Then def result = response
Then set result.displayName = 'UpdatedQAAddedAttribute'
Then def inum_before = result.inum
Given url attributes_url
And header Authorization = 'Bearer ' + accessToken
And request result
When method PUT
Then status 200
And assert response.displayName == 'UpdatedQAAddedAttribute'
And assert response.inum == inum_before
Given url attributes_url + '/' +response.inum
And header Authorization = 'Bearer ' + accessToken
When method DELETE
Then status 204

Scenario: Delete a non-existion attribute by inum
Given url attributes_url + '/1402.66633-8675-473e-a749'
And header Authorization = 'Bearer ' + accessToken
When method GET
Then status 404


Scenario: Get an attribute by inum(unexisting attribute)
Given url attributes_url + '/53553532727272772'
And header Authorization = 'Bearer ' + accessToken
When method GET
Then status 404

Scenario: Get an attribute by inum
Given url attributes_url
And header Authorization = 'Bearer ' + accessToken
When method GET
Then status 200
Given url attributes_url + '/' +response[0].inum
And header Authorization = 'Bearer ' + accessToken
When method GET
Then status 200
5 changes: 4 additions & 1 deletion src/test/resources/karate-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ function() {
// Uma scopes
umascopes_url: baseUrl + ':' + port + '/api/v1/oxauth/uma/scopes',

// Uma resources
// Uma resources
umaresources_url: baseUrl + ':' + port + '/api/v1/oxauth/uma/resources',

// Uma resources
attributes_url: baseUrl + ':' + port + '/api/v1/oxauth/attributes',

};


Expand Down

0 comments on commit d18b9d9

Please sign in to comment.