Skip to content

Commit

Permalink
SHIBUI-1992
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
chasegawa committed Jul 30, 2021
1 parent 1f32b95 commit 67777a0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private static URI getResourceUriFor(MetadataResolver resolver) {

private void doResolverInitialization(MetadataResolver persistedResolver) throws
ComponentInitializationException, ResolverException, IOException {
if (persistedResolver.getDoInitialization()) {
if (persistedResolver.getDoInitialization() != null && persistedResolver.getDoInitialization()) {
org.opensaml.saml.metadata.resolver.MetadataResolver openSamlRepresentation = null;
try {
openSamlRepresentation = metadataResolverConverterService.convertToOpenSamlRepresentation(persistedResolver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,25 @@ class MetadataResolversControllerIntegrationTests extends Specification {
'ResourceBacked' | _
'Filesystem' | _
}

@DirtiesContext
def "SHIBUI-1992 - error creating FileBackedHTTPMetadata"() {
def resolver = new FileBackedHttpMetadataResolver().with {
it.name = 'FBHMR'
it.xmlId = '1'
it.backingFile = 'tmp/foo'
it.metadataURL = 'https://nexus.microsoftonline-p.com/federationmetadata/saml20/federationmetadata.xml'
it.backupFileInitNextRefreshDelay = 'PT4H'
it.enabled = Boolean.FALSE
it
}

when:
def result = this.restTemplate.postForEntity(BASE_URI, createRequestHttpEntityFor { mapper.writeValueAsString(resolver) }, String)

then:
result.statusCodeValue == 201
}

@Unroll
def "PUT concrete MetadataResolver of type #resolverType with updated changes -> /api/MetadataResolvers/{resourceId}"(String resolverType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ class TestObjectGenerator {
it.name = 'FilesystemMetadata'
it.xmlId = 'FilesystemMetadata'
it.metadataFile = 'metadata/metadata.xml'
it.doInitialization = Boolean.FALSE // Removed the default setting, added back to keep tests the same.

it.reloadableMetadataResolverAttributes = new ReloadableMetadataResolverAttributes().with {
it
Expand Down

0 comments on commit 67777a0

Please sign in to comment.