Skip to content

Commit

Permalink
Resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Aug 29, 2019
2 parents e85b71c + 483a446 commit feac516
Show file tree
Hide file tree
Showing 21 changed files with 625 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
package edu.internet2.tier.shibboleth.admin.ui.controller

import edu.internet2.tier.shibboleth.admin.ui.domain.EntityDescriptor
import edu.internet2.tier.shibboleth.admin.ui.domain.Organization
import edu.internet2.tier.shibboleth.admin.ui.domain.OrganizationDisplayName
import edu.internet2.tier.shibboleth.admin.ui.domain.OrganizationName
import edu.internet2.tier.shibboleth.admin.ui.domain.OrganizationURL
import edu.internet2.tier.shibboleth.admin.ui.domain.frontend.EntityDescriptorRepresentation
import edu.internet2.tier.shibboleth.admin.ui.repository.EntityDescriptorRepository
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.web.client.TestRestTemplate
import org.springframework.http.HttpEntity
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.MediaType
import org.springframework.test.annotation.DirtiesContext
import org.springframework.test.context.ActiveProfiles
import spock.lang.Specification

Expand Down Expand Up @@ -100,6 +111,46 @@ class EntityDescriptorControllerVersionEndpointsIntegrationTests extends Specifi
edv2.body.serviceProviderName == 'SP2'
}

@DirtiesContext(methodMode = DirtiesContext.MethodMode.AFTER_METHOD)
def 'SHIBUI-1414'() {
given:
def ed = new EntityDescriptor(entityID: 'testme', serviceProviderName: 'testme').with {
entityDescriptorRepository.save(it)
}.with {
it.setOrganization(new Organization().with {
it.organizationNames = [new OrganizationName(value: 'testme', XMLLang: 'en')]
it.organizationDisplayNames = [new OrganizationDisplayName(value: 'testme', XMLLang: 'en')]
it.organizationURLs = [new OrganizationURL(value: 'http://testme.org', XMLLang: 'en')]
it
})
entityDescriptorRepository.save(it)
}

when:
def headers = new HttpHeaders().with {
it.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
it
}

def allVersions = getAllEntityDescriptorVersions(ed.resourceId, List)
def edv1 = getEntityDescriptorForVersion(ed.resourceId, allVersions.body[0].id, String).body
def tedv2 = getEntityDescriptorForVersion(ed.resourceId, allVersions.body[1].id, EntityDescriptorRepresentation).body

def aedv1 = new JsonSlurper().parseText(edv1).with {
it.put('version', tedv2.version)
it
}.with {
JsonOutput.toJson(it)
}

def request = new HttpEntity(aedv1, headers)
def response = this.restTemplate.exchange("/api/EntityDescriptor/${ed.resourceId}", HttpMethod.PUT, request, String)

then:
response.statusCodeValue != 400
noExceptionThrown()
}

private getAllEntityDescriptorVersions(String resourceId, responseType) {
this.restTemplate.getForEntity(resourceUriFor(ALL_VERSIONS_URI, resourceId), responseType)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class SeleniumSIDETest extends Specification {
'SHIBUI-1335: Verify Filesystem Metadata Provider Filters' | '/SHIBUI-1335-2.side'
'SHIBUI-1335: Verify Local Dynamic Metadata Provider Filters' | '/SHIBUI-1335-3.side'
'SHIBUI-1335: Verify Dynamic HTTP Metadata Provider Filters' | '/SHIBUI-1335-4.side'
'SHIBUI-1392: Verify provider with script filter is persistable' | '/SHIBUI-1392.side'
}
}

33 changes: 25 additions & 8 deletions backend/src/integration/resources/SHIBUI-1335-1.side
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@
["xpath=//li[2]/button", "xpath:position"]
],
"value": ""
}, {
"id": "352f066f-c2af-4735-81b1-5440ba7a3432",
"comment": "",
"command": "waitForElementVisible",
"target": "id=/xmlId",
"targets": [],
"value": "10000"
}, {
"id": "e7462621-f4e4-4512-b200-20afa5685fc6",
"comment": "",
Expand Down Expand Up @@ -1352,14 +1359,10 @@
}, {
"id": "c28d683a-552d-4752-aa89-465e33d60887",
"comment": "",
"command": "waitForElementVisible",
"target": "css=tr:nth-child(2) > .td-lg:nth-child(4)",
"targets": [
["css=tr:nth-child(2) > .td-lg:nth-child(4)", "css:finder"],
["xpath=//tr[2]/td[4]", "xpath:position"],
["xpath=//td[contains(.,'NameIDFormat')]", "xpath:innerText"]
],
"value": "10000"
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "100902ee-6d6e-4148-a69b-b37746a4ad6e",
"comment": "",
Expand All @@ -1381,6 +1384,13 @@
["xpath=//button[2]/i", "xpath:position"]
],
"value": ""
}, {
"id": "febfcea8-8f72-4a17-b1a8-b1e323c8cced",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "c9d498da-9f59-40ae-b5d4-cae397a13766",
"comment": "",
Expand All @@ -1402,6 +1412,13 @@
["xpath=//button[2]/i", "xpath:position"]
],
"value": ""
}, {
"id": "4fdc2334-0b93-4f4c-b44e-80656f808f6d",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "441608df-24a3-4a60-bfce-50a90ff0ee16",
"comment": "",
Expand Down
13 changes: 10 additions & 3 deletions backend/src/integration/resources/SHIBUI-1335-2.side
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,10 @@
}, {
"id": "eca1d3dd-9e47-49d2-b4a1-a45c2b6c8c3a",
"comment": "",
"command": "waitForElementVisible",
"target": "css=tr:nth-child(1) > .td-lg:nth-child(4)",
"command": "pause",
"target": "2000",
"targets": [],
"value": "10000"
"value": ""
}, {
"id": "d722902b-5c10-45dc-99df-d96f46e78313",
"comment": "",
Expand All @@ -716,6 +716,13 @@
["xpath=//button[2]/i", "xpath:position"]
],
"value": ""
}, {
"id": "d25400e1-127e-4b8c-b7e2-ade937cfd5a0",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "d7909094-96ce-4532-98b4-446cc013c9c8",
"comment": "",
Expand Down
13 changes: 10 additions & 3 deletions backend/src/integration/resources/SHIBUI-1335-3.side
Original file line number Diff line number Diff line change
Expand Up @@ -785,10 +785,10 @@
}, {
"id": "455e24c1-5093-4da3-a62d-457bbf0cd5db",
"comment": "",
"command": "waitForElementVisible",
"target": "css=tr:nth-child(2) > .td-lg:nth-child(4)",
"command": "pause",
"target": "2000",
"targets": [],
"value": "10000"
"value": ""
}, {
"id": "9f7e95cf-4dd5-415f-8577-a6f1bc54a85d",
"comment": "",
Expand All @@ -810,6 +810,13 @@
["xpath=//td[contains(.,'NameIDFormat')]", "xpath:innerText"]
],
"value": "NameIDFormat"
}, {
"id": "81970d9d-2892-4b42-ba56-ba1a14f453d2",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "63ac7307-0538-4c0d-8e98-2f05c767baaf",
"comment": "",
Expand Down
22 changes: 18 additions & 4 deletions backend/src/integration/resources/SHIBUI-1335-4.side
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@
"id": "77dfeb05-38e3-4ef8-9566-06e7597d464c",
"comment": "",
"command": "click",
"target": "css=.btn-primary > translate-i18n",
"target": "css=.btn-primary",
"targets": [
["css=.btn-primary > translate-i18n", "css:finder"],
["xpath=//div/button/translate-i18n", "xpath:position"],
Expand All @@ -924,10 +924,10 @@
}, {
"id": "f79371b5-0081-45a0-bfb3-c403db903043",
"comment": "",
"command": "waitForElementVisible",
"target": "css=tr:nth-child(1) > .td-lg:nth-child(4)",
"command": "pause",
"target": "2000",
"targets": [],
"value": "10000"
"value": ""
}, {
"id": "a8ed628c-53f7-4551-9ce8-fef976cc96ce",
"comment": "",
Expand All @@ -938,6 +938,13 @@
["xpath=//button[2]/i", "xpath:position"]
],
"value": ""
}, {
"id": "6b3ec8f1-8b9a-40f5-816f-3a1e415b9d8d",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "be805934-2692-4a1c-a28f-afb3cc4eb5f4",
"comment": "",
Expand All @@ -959,6 +966,13 @@
["xpath=//button[2]/i", "xpath:position"]
],
"value": ""
}, {
"id": "403570ff-e1f0-4db9-925f-f90c5994b60e",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "8f2da627-e8ad-473a-a71a-bec5dd1f0999",
"comment": "",
Expand Down
Loading

0 comments on commit feac516

Please sign in to comment.