Skip to content

Commit

Permalink
Merge branch 'develop' into feature/shibui-2116
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Smith committed Oct 1, 2021
2 parents de9c13a + 6ecc5be commit eadc657
Show file tree
Hide file tree
Showing 177 changed files with 15,111 additions and 13,345 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,7 @@ beacon/spring/out
*.project
*bin
/a.json
/testbed/authentication/.idea/workspace.xml

# macOS jenv
.java-version
1 change: 1 addition & 0 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ task integrationTest(type: Test) {
classpath = sourceSets.integrationTest.runtimeClasspath
systemProperties = System.properties
systemProperties['user.dir'] = workingDir
systemProperties['spring.profiles.include'] = 'very-dangerous'
}

task enversTest(type: Test) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
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 @@ -111,44 +100,9 @@ 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)
String 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()
}
// Moved to its own test in the main testing package
// def 'SHIBUI-1414'() {
// }

private getAllEntityDescriptorVersions(String resourceId, responseType) {
this.restTemplate.getForEntity(resourceUriFor(ALL_VERSIONS_URI, resourceId), responseType)
Expand All @@ -165,4 +119,4 @@ class EntityDescriptorControllerVersionEndpointsIntegrationTests extends Specifi
private static resourceUriFor(String uriTemplate, String resourceId) {
String.format(uriTemplate, resourceId)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@ class SeleniumSIDETest extends Specification {
cleanup:
runner.getWrappedDriver().quit()

// TODO: Uncomment the below commented tests once they've been updated to use the new configuration screen
where:
name | file
/* 'SHIBUI-1364: Compare FBHTTPMP with filters' | '/SHIBUI-1364-1.side'
'SHIBUI-1364: Compare FBHTTPMP with filters' | '/SHIBUI-1364-1.side'
'SHIBUI-1364: Compare FSMP with filters' | '/SHIBUI-1364-2.side'
'SHIBUI-1364: Compare LDMP with filters' | '/SHIBUI-1364-3.side'
'SHIBUI-1364: Compare DHTTPMP with filters' | '/SHIBUI-1364-4.side'
Expand All @@ -114,11 +113,10 @@ class SeleniumSIDETest extends Specification {
'SHIBUI-1334: Verify metadata source versioning' | '/SHIBUI-1334-1.side'
'SHIBUI-1334: Verify metadata provider versioning' | '/SHIBUI-1334-2.side'
'SHIBUI-1335: Verify File Backed HTTP Metadata Provider Filters' | '/SHIBUI-1335-1.side'
'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 Filesystem Metadata Provider Filters' | '/SHIBUI-1335-2.side' // adding filters to this resolver type was removed in the react update
'SHIBUI-1335: Verify Local Dynamic Metadata Provider Filters' | '/SHIBUI-1335-3.side' // adding filters to this resolver type was removed in the react update
'SHIBUI-1335: Verify Dynamic HTTP Metadata Provider Filters' | '/SHIBUI-1335-4.side'
'SHIBUI-1392: Verify provider with script filter is persistable' | '/SHIBUI-1392.side'
'SHIBUI-1361: Verify dates display in proper format' | '/SHIBUI-1361.side'
'SHIBUI-1361: Verify dates display in proper format' | '/SHIBUI-1361.side' // Note that this script WILL NOT PASS in the Selenium IDE. There is a bug in the IDE where it thinks there is a missing ')'.
'SHIBUI-1385: Restore a metadata source version' | '/SHIBUI-1385-1.side'
'SHIBUI-1385: Restore a metadata provider version' | '/SHIBUI-1385-2.side'
'SHIBUI-1391: Regex Validation' | '/SHIBUI-1391.side'
Expand All @@ -127,15 +125,18 @@ class SeleniumSIDETest extends Specification {
'SHIBUI-1503: Non-admin can create metadata source' | '/SHIBUI-1503-1.side'
'SHIBUI-1503: User can be deleted' | '/SHIBUI-1503-2.side'
'SHIBUI-1503: User can be enabled' | '/SHIBUI-1503-3.side'
'SHIBUI-2052: Logged in user & role appear on dashboard' | '/SHIBUI-2052.side'
'SHIBUI-1740: Group can be created, edited, deleted' | '/SHIBUI-1740-1.side'
'SHIBUI-1740: Verify dev profile group membership' | '/SHIBUI-1740-2.side'
'SHIBUI-1740: Verify admin-owned resource not visible to nonadmins' | '/SHIBUI-1740-3.side'
'SHIBUI-1740: Verify nonadmin-owned resource visibility' | '/SHIBUI-1740-4.side'
'SHIBUI-1742: Verify enabler role allows enabling' | '/SHIBUI-1742-1.side'
'SHIBUI-1742: Verify role CRUD operations' | '/SHIBUI-1742-2.side'*/
'SHIBUI-1742: Verify role CRUD operations' | '/SHIBUI-1742-2.side'
'SHIBUI-1743: Verify group regex CRUD operations' | '/SHIBUI-1743-1.side'
'SHIBUI-1743: Verify nonadmin group regex validation' | '/SHIBUI-1743-2.side'
'SHIBUI-1744: Verify attribute bundle CRUD operations' | '/SHIBUI-1744-1.side'
'SHIBUI-1744: Verify attribute bundles in metadata sources' | '/SHIBUI-1744-2.side'
'SHIBUI-1744: Verify attribute bundles in entity attribute filters' | '/SHIBUI-1744-3.side'
'SHIBUI-1392: Verify provider with script filter is persistable' | '/SHIBUI-1392.side' // Something about this test breaks all the other ones after it
}
}

Loading

0 comments on commit eadc657

Please sign in to comment.