aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/test/java/at/gv/egovernment
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2020-08-31 16:30:08 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2020-08-31 16:30:08 +0200
commitefeae1c1b91823ea4a7d4c84f3c1721f0a06e628 (patch)
tree844dbb9e64e856e2ccdd7ff8aaa4976f66d8b1a4 /id/server/idserverlib/src/test/java/at/gv/egovernment
parent0e6a03ffbc11d07ee2d00abcd573239a971f89b5 (diff)
parent7d9e2026c557cab1b8b3c4bb6a91f054c7bed5f0 (diff)
downloadmoa-id-spss-efeae1c1b91823ea4a7d4c84f3c1721f0a06e628.tar.gz
moa-id-spss-efeae1c1b91823ea4a7d4c84f3c1721f0a06e628.tar.bz2
moa-id-spss-efeae1c1b91823ea4a7d4c84f3c1721f0a06e628.zip
Merge branch 'current_development' into development_preview
Diffstat (limited to 'id/server/idserverlib/src/test/java/at/gv/egovernment')
-rw-r--r--id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/config/auth/data/DummyAuthConfig.java78
1 files changed, 67 insertions, 11 deletions
diff --git a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/config/auth/data/DummyAuthConfig.java b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/config/auth/data/DummyAuthConfig.java
index 1ab54471c..b2f425a2c 100644
--- a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/config/auth/data/DummyAuthConfig.java
+++ b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/config/auth/data/DummyAuthConfig.java
@@ -2,7 +2,9 @@ package at.gv.egovernment.moa.id.config.auth.data;
import java.io.IOException;
import java.net.URI;
+import java.net.URISyntaxException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -20,16 +22,21 @@ import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
import at.gv.egovernment.moa.id.commons.api.IStorkConfig;
import at.gv.egovernment.moa.id.commons.api.data.ProtocolAllowed;
import at.gv.egovernment.moa.id.commons.api.exceptions.ConfigurationException;
+import at.gv.egovernment.moa.util.MiscUtil;
import at.gv.util.config.EgovUtilPropertiesConfiguration;
public class DummyAuthConfig implements AuthConfiguration {
private Boolean isIDLEscapingEnabled = null;
+ private Map<String, String> basicConfig = new HashMap<>();
+ private List<String> slRequestTemplates;
+ private String configRootDir;
+
@Override
public String getRootConfigFileDir() {
- // TODO Auto-generated method stub
- return null;
+ return configRootDir;
+
}
@Override
@@ -100,7 +107,10 @@ public class DummyAuthConfig implements AuthConfiguration {
} else if (UserRestrictionTask.CONFIG_PROPS_CSV_USER_SECTOR.equals(key)) {
return "urn:publicid:gv.at:cdid+ZP-MH";
- }
+ } else if (basicConfig.containsKey(key)) {
+ return basicConfig.get(key);
+
+ }
return null;
@@ -108,8 +118,13 @@ public class DummyAuthConfig implements AuthConfiguration {
@Override
public String getBasicConfiguration(String key, String defaultValue) {
- // TODO Auto-generated method stub
- return null;
+ if (basicConfig.containsKey(key)) {
+ return basicConfig.get(key);
+
+ } else {
+ return defaultValue;
+
+ }
}
@Override
@@ -235,8 +250,8 @@ public class DummyAuthConfig implements AuthConfiguration {
@Override
public List<String> getSLRequestTemplates() throws ConfigurationException {
- // TODO Auto-generated method stub
- return null;
+ return new ArrayList<>(slRequestTemplates);
+
}
@Override
@@ -428,14 +443,30 @@ public class DummyAuthConfig implements AuthConfiguration {
}
+ if (basicConfig.containsKey(key)) {
+ return Boolean.parseBoolean(basicConfig.get(key));
+
+ } else {
+ return defaultValue;
+
+ }
- return false;
}
@Override
public URI getConfigurationRootDirectory() {
- // TODO Auto-generated method stub
- return null;
+ try {
+ if (MiscUtil.isNotEmpty(configRootDir)) {
+ return new URI(configRootDir);
+
+ }
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+
+ }
+
+ return null;
+
}
@Override
@@ -462,8 +493,33 @@ public class DummyAuthConfig implements AuthConfiguration {
@Override
public Boolean getBasicConfigurationBoolean(String key) {
- // TODO Auto-generated method stub
+ if (basicConfig.containsKey(key)) {
+ return Boolean.parseBoolean(basicConfig.get(key));
+
+ }
+
return null;
}
+ public void putIntoBasicConfig(String key, String value) {
+ basicConfig.put(key, value);
+
+ }
+
+ public void removeFromBasicConfig(String key) {
+ basicConfig.remove(key);
+
+ }
+
+ public void setSlRequestTemplateUrls(List<String> templates) {
+ slRequestTemplates = templates;
+
+ }
+
+ public void setConfigRootDir(String configRootDir) {
+ this.configRootDir = configRootDir;
+ }
+
+
+
}