diff options
Diffstat (limited to 'eaaf_core/src/test')
3 files changed, 144 insertions, 0 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiBuilderConfigurationFactory.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiBuilderConfigurationFactory.java new file mode 100644 index 00000000..be71a29c --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiBuilderConfigurationFactory.java @@ -0,0 +1,36 @@ +package at.gv.egiz.eaaf.core.impl.idp.module.gui; + +import java.net.MalformedURLException; +import java.net.URI; + +import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.gui.IGuiBuilderConfiguration; +import at.gv.egiz.eaaf.core.api.gui.IGuiBuilderConfigurationFactory; +import at.gv.egiz.eaaf.core.api.gui.IVelocityGuiBuilderConfiguration; + +public class DummyGuiBuilderConfigurationFactory implements IGuiBuilderConfigurationFactory { + + private IGuiBuilderConfiguration errorGuiConfig; + private IVelocityGuiBuilderConfiguration velocityBuilderConfig; + + @Override + public IGuiBuilderConfiguration getDefaultErrorGui(String authUrl) { + return errorGuiConfig; + } + + @Override + public IVelocityGuiBuilderConfiguration getSpSpecificSaml2PostConfiguration(IRequest pendingReq, + String viewName, URI configRootContextDir) throws MalformedURLException { + return velocityBuilderConfig; + } + + public void setErrorGuiConfig(IGuiBuilderConfiguration errorGuiConfig) { + this.errorGuiConfig = errorGuiConfig; + } + + public void setVelocityBuilderConfig(IVelocityGuiBuilderConfiguration velocityBuilderConfig) { + this.velocityBuilderConfig = velocityBuilderConfig; + } + + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyVelocityGuiFormBuilder.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyVelocityGuiFormBuilder.java new file mode 100644 index 00000000..e2cdd1ee --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyVelocityGuiFormBuilder.java @@ -0,0 +1,36 @@ +package at.gv.egiz.eaaf.core.impl.idp.module.gui; + +import java.io.InputStream; + +import at.gv.egiz.eaaf.core.api.gui.IVelocityGuiBuilderConfiguration; +import at.gv.egiz.eaaf.core.exceptions.GuiBuildException; +import at.gv.egiz.eaaf.core.impl.gui.AbstractVelocityGuiFormBuilderImpl; + +public class DummyVelocityGuiFormBuilder extends AbstractVelocityGuiFormBuilderImpl { + + private InputStream internalTemplate = null; + + public DummyVelocityGuiFormBuilder() throws GuiBuildException { + super(); + } + + @Override + protected InputStream getInternalTemplate(IVelocityGuiBuilderConfiguration config) + throws GuiBuildException { + return internalTemplate; + + } + + /** + * Set internal template that should be loaded by builder. + * + * @param internalTemplate Tempalte + */ + public void setInternalTemplate(InputStream internalTemplate) { + this.internalTemplate = internalTemplate; + } + + + + +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyAuthConfig.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyAuthConfig.java new file mode 100644 index 00000000..a6f24c6d --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyAuthConfig.java @@ -0,0 +1,72 @@ +package at.gv.egiz.eaaf.core.impl.idp.module.test; + +import java.net.URI; +import java.net.URL; + +import org.apache.commons.lang3.StringUtils; + +import at.gv.egiz.eaaf.core.api.idp.ISpConfiguration; +import at.gv.egiz.eaaf.core.exceptions.EaafConfigurationException; +import at.gv.egiz.eaaf.core.exceptions.EaafException; +import at.gv.egiz.eaaf.core.impl.idp.conf.AbstractSpringBootConfigurationImpl; + + +public class DummyAuthConfig extends AbstractSpringBootConfigurationImpl { + + private ISpConfiguration spconfig = null; + + private String configPropPrefix = StringUtils.EMPTY; + + public void setSpConfig(final ISpConfiguration spConfig) { + this.spconfig = spConfig; + + } + + + + @Override + public URI getConfigurationRootDirectory() { + return new java.io.File(".").toURI(); + } + + @Override + public ISpConfiguration getServiceProviderConfiguration(final String arg0) + throws EaafConfigurationException { + return spconfig; + } + + @SuppressWarnings("unchecked") + @Override + public <T> T getServiceProviderConfiguration(final String arg0, final Class<T> arg1) + throws EaafConfigurationException { + return (T) spconfig; + + } + + @Override + public String validateIdpUrl(final URL arg0) throws EaafException { + return arg0.toString(); + } + + + @Override + protected String getBackupConfigPath() { + return null; + } + + + @Override + public String getApplicationSpecificKeyPrefix() { + return configPropPrefix; + + } + + + + public void setConfigPropPrefix(final String configPropPrefix) { + this.configPropPrefix = configPropPrefix; + } + + + +} |