-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...r/shibboleth/admin/ui/domain/resolvers/OpenSamlFileBackedHTTPMetadataResolverTests.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.domain.resolvers | ||
|
||
import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.opensaml.OpenSamlFileBackedHTTPMetadataResolver | ||
import edu.internet2.tier.shibboleth.admin.ui.opensaml.OpenSamlObjects | ||
import edu.internet2.tier.shibboleth.admin.ui.service.TokenPlaceholderValueResolvingService | ||
import edu.internet2.tier.shibboleth.admin.util.TokenPlaceholderResolvers | ||
import org.springframework.core.env.MutablePropertySources | ||
import spock.lang.Specification | ||
|
||
class OpenSamlFileBackedHTTPMetadataResolverTests extends Specification { | ||
def openSamlObjects = new OpenSamlObjects().with { | ||
init() | ||
it | ||
} | ||
|
||
def "test refresh"() { | ||
when: | ||
new TokenPlaceholderResolvers(TokenPlaceholderValueResolvingService.shibbolethPlaceholderPrefixAware(new MutablePropertySources())) | ||
def fbhmr = new FileBackedHttpMetadataResolver(name: 'test', xmlId: 'test', metadataURL: 'http://testme', backingFile: 'metadata/testme.xml') | ||
|
||
def x = new OpenSamlFileBackedHTTPMetadataResolver(openSamlObjects.parserPool, null, fbhmr) | ||
x.refilter() | ||
|
||
then: | ||
noExceptionThrown() | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
.../tier/shibboleth/admin/ui/domain/resolvers/OpenSamlFilesystemMetadataResolverTests.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.domain.resolvers | ||
|
||
import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.opensaml.OpenSamlFilesystemMetadataResolver | ||
import edu.internet2.tier.shibboleth.admin.ui.opensaml.OpenSamlObjects | ||
import spock.lang.Specification | ||
|
||
class OpenSamlFilesystemMetadataResolverTests extends Specification { | ||
def openSamlObjects = new OpenSamlObjects().with { | ||
init() | ||
it | ||
} | ||
|
||
def "test refresh"() { | ||
when: | ||
def fsmr = new FilesystemMetadataResolver(name: 'test', xmlId: 'test', metadataFile: 'metadata/metadata.xml') | ||
def x = new OpenSamlFilesystemMetadataResolver(openSamlObjects.parserPool, null, fsmr, new File(fsmr.metadataFile)) | ||
x.refilter() | ||
|
||
then: | ||
noExceptionThrown() | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...r/shibboleth/admin/ui/domain/resolvers/OpenSamlResourceBackedMetadataResolverTests.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.domain.resolvers | ||
|
||
import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.opensaml.OpenSamlResourceBackedMetadataResolver | ||
import edu.internet2.tier.shibboleth.admin.ui.opensaml.OpenSamlObjects | ||
import net.shibboleth.ext.spring.resource.ResourceHelper | ||
import org.springframework.core.io.ClassPathResource | ||
import spock.lang.Specification | ||
|
||
class OpenSamlResourceBackedMetadataResolverTests extends Specification { | ||
def openSamlObjects = new OpenSamlObjects().with { | ||
init() | ||
it | ||
} | ||
|
||
def 'test refresh'() { | ||
when: | ||
def rbmr = new ResourceBackedMetadataResolver(name: 'test', xmlId: 'test', classpathMetadataResource: new ClasspathMetadataResource('metadata/metadata.xml')) | ||
def x = new OpenSamlResourceBackedMetadataResolver(openSamlObjects.parserPool, null, rbmr, ResourceHelper.of(new ClassPathResource(rbmr.classpathMetadataResource.file))) | ||
x.refilter() | ||
|
||
then: | ||
noExceptionThrown() | ||
} | ||
} |