Class FileBackedHTTPMetadataResolverTest
- java.lang.Object
-
- org.opensaml.core.testing.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.testing.XMLObjectBaseTestCase
-
- org.opensaml.saml.metadata.resolver.impl.FileBackedHTTPMetadataResolverTest
-
public class FileBackedHTTPMetadataResolverTest extends XMLObjectBaseTestCase
Test case forFileBackedHTTPMetadataResolver.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classFileBackedHTTPMetadataResolverTest.MockContextTrackingFilter
-
Field Summary
Fields Modifier and Type Field Description private FilebackupFileprivate StringbackupFilePathprivate StringbadMDURLprivate CriteriaSetcriteriaSetprivate StringentityIDprivate HttpClientBuilderhttpClientBuilderprivate FileBackedHTTPMetadataResolvermetadataProviderprivate StringmetadataURLHttpprivate StringmetadataURLHttpsprivate StringrelativeMDResourceprivate StringrelativeMDResourceBadprivate StringrelativeMDResourceExpired-
Fields inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory
-
-
Constructor Summary
Constructors Constructor Description FileBackedHTTPMetadataResolverTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidsetUp()protected voidtearDown()voidtestFailFastBadBackupFile()Test fail-fast = true and bad backup filevoidtestFailFastBadURL()Test fail-fast = true with known bad metadata URL.voidtestGetEntityDescriptor()Tests the basic success case.voidtestHTTPSNoTrustEngine()voidtestHTTPSTrustEngineExplicitKey()voidtestHTTPSTrustEngineInvalidKey()voidtestHTTPSTrustEngineInvalidPKIX()voidtestHTTPSTrustEngineValidPKIX()voidtestHTTPSTrustEngineValidPKIXExplicitName()voidtestHTTPSTrustEngineValidPKIXInvalidName()voidtestHTTPSTrustEngineWrongSocketFactory()voidtestInitFromBackupFile()Tests initialization from backup file, followed shortly by real refresh via HTTP.voidtestInitFromBadBackupFileNonFailFast()Tests initialization from backup file, followed shortly by real refresh via HTTP, for the special case of a backup file that throws during processing when fail-fast=false.voidtestInitFromExpiredBackupFile()Tests initialization from backup file, followed shortly by real refresh via HTTP, for the special case of a backup file that is already expired.voidtestNoBackupFileLoadWhenMetadataCached()Tests that backup file is not loaded on a refresh when already have cached metadata.voidtestNoFailFastBadBackupFile()Test case of fail-fast = false and bad backup filevoidtestNoFailFastBadURL()Test fail-fast = false with known bad metadata URL.voidtestTrustEngineSocketFactoryNoHTTPSNoTrustEngine()voidtestTrustEngineSocketFactoryNoHTTPSWithTrustEngine()-
Methods inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElement
-
Methods inherited from class org.opensaml.core.testing.OpenSAMLInitBaseTestCase
initOpenSAML
-
-
-
-
Field Detail
-
httpClientBuilder
private HttpClientBuilder httpClientBuilder
-
metadataURLHttps
private String metadataURLHttps
-
metadataURLHttp
private String metadataURLHttp
-
relativeMDResource
private String relativeMDResource
-
relativeMDResourceExpired
private String relativeMDResourceExpired
-
relativeMDResourceBad
private String relativeMDResourceBad
-
badMDURL
private String badMDURL
-
backupFilePath
private String backupFilePath
-
backupFile
private File backupFile
-
metadataProvider
private FileBackedHTTPMetadataResolver metadataProvider
-
entityID
private String entityID
-
criteriaSet
private CriteriaSet criteriaSet
-
-
Method Detail
-
tearDown
@AfterMethod protected void tearDown() throws IOException- Throws:
IOException
-
testGetEntityDescriptor
public void testGetEntityDescriptor() throws ExceptionTests the basic success case.- Throws:
Exception- ...
-
testFailFastBadURL
public void testFailFastBadURL() throws ExceptionTest fail-fast = true with known bad metadata URL.- Throws:
Exception- if something goes wrong
-
testNoFailFastBadURL
public void testNoFailFastBadURL() throws ExceptionTest fail-fast = false with known bad metadata URL.- Throws:
Exception- if something goes wrong
-
testFailFastBadBackupFile
public void testFailFastBadBackupFile() throws ExceptionTest fail-fast = true and bad backup file- Throws:
Exception- if something goes wrong
-
testNoFailFastBadBackupFile
public void testNoFailFastBadBackupFile() throws ExceptionTest case of fail-fast = false and bad backup file- Throws:
Exception- if something goes wrong
-
testInitFromBackupFile
public void testInitFromBackupFile() throws ExceptionTests initialization from backup file, followed shortly by real refresh via HTTP.- Throws:
Exception- if something goes wrong
-
testInitFromExpiredBackupFile
public void testInitFromExpiredBackupFile() throws ExceptionTests initialization from backup file, followed shortly by real refresh via HTTP, for the special case of a backup file that is already expired. See OSJ-261. Issue there was the backupFileInitNextRefreshDelay wasn't being honored.- Throws:
Exception- if something goes wrong
-
testInitFromBadBackupFileNonFailFast
public void testInitFromBadBackupFileNonFailFast() throws ExceptionTests initialization from backup file, followed shortly by real refresh via HTTP, for the special case of a backup file that throws during processing when fail-fast=false. See OSJ-261. Issue there was the backupFileInitNextRefreshDelay wasn't being honored.- Throws:
Exception- if something goes wrong
-
testNoBackupFileLoadWhenMetadataCached
public void testNoBackupFileLoadWhenMetadataCached() throws ExceptionTests that backup file is not loaded on a refresh when already have cached metadata.- Throws:
Exception- if something goes wrong
-
testTrustEngineSocketFactoryNoHTTPSNoTrustEngine
public void testTrustEngineSocketFactoryNoHTTPSNoTrustEngine() throws Exception- Throws:
Exception
-
testTrustEngineSocketFactoryNoHTTPSWithTrustEngine
public void testTrustEngineSocketFactoryNoHTTPSWithTrustEngine() throws Exception- Throws:
Exception
-
testHTTPSTrustEngineExplicitKey
public void testHTTPSTrustEngineExplicitKey() throws Exception- Throws:
Exception
-
testHTTPSTrustEngineInvalidKey
public void testHTTPSTrustEngineInvalidKey() throws Exception- Throws:
Exception
-
testHTTPSTrustEngineValidPKIX
public void testHTTPSTrustEngineValidPKIX() throws Exception- Throws:
Exception
-
testHTTPSTrustEngineValidPKIXExplicitName
public void testHTTPSTrustEngineValidPKIXExplicitName() throws Exception- Throws:
Exception
-
testHTTPSTrustEngineInvalidPKIX
public void testHTTPSTrustEngineInvalidPKIX() throws Exception- Throws:
Exception
-
testHTTPSTrustEngineValidPKIXInvalidName
public void testHTTPSTrustEngineValidPKIXInvalidName() throws Exception- Throws:
Exception
-
-