summaryrefslogtreecommitdiff
path: root/eaaf_core/src/test/java
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2020-01-31 20:41:54 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2020-01-31 20:41:54 +0100
commitd41afe91ee59daf6b5f5037cecac52900fe2ccb2 (patch)
tree3a19e1818d276d701574758ce6166b2f3a7e2030 /eaaf_core/src/test/java
parent0cf9926282ba4aa46bad3f4e8020cec72683492f (diff)
downloadEAAF-Components-d41afe91ee59daf6b5f5037cecac52900fe2ccb2.tar.gz
EAAF-Components-d41afe91ee59daf6b5f5037cecac52900fe2ccb2.tar.bz2
EAAF-Components-d41afe91ee59daf6b5f5037cecac52900fe2ccb2.zip
a lot of more OpenSAML3 refactoring staff
This version is also NOT stable!
Diffstat (limited to 'eaaf_core/src/test/java')
-rw-r--r--eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiBuilderConfigurationFactory.java36
-rw-r--r--eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyVelocityGuiFormBuilder.java36
-rw-r--r--eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyAuthConfig.java72
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;
+ }
+
+
+
+}