aboutsummaryrefslogtreecommitdiff
path: root/modules/eidas_proxy-sevice
diff options
context:
space:
mode:
authorThomas <>2022-06-08 14:56:42 +0200
committerThomas <>2022-06-08 14:56:42 +0200
commitcab2ab4ddb85b305d77798073b868cf42a7e0111 (patch)
tree9048aa08a09fb204b0ce079a62f351f408eaec92 /modules/eidas_proxy-sevice
parent2d3c6f1003a2c8cb6f5fc5f7573f7d041e88a453 (diff)
downloadNational_eIDAS_Gateway-cab2ab4ddb85b305d77798073b868cf42a7e0111.tar.gz
National_eIDAS_Gateway-cab2ab4ddb85b305d77798073b868cf42a7e0111.tar.bz2
National_eIDAS_Gateway-cab2ab4ddb85b305d77798073b868cf42a7e0111.zip
chore(core): minory style, test and validation fixes
Diffstat (limited to 'modules/eidas_proxy-sevice')
-rw-r--r--modules/eidas_proxy-sevice/checks/spotbugs-exclude.xml11
-rw-r--r--modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/dto/attributes/Type.java11
-rw-r--r--modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/msproxyservice/test/protocol/EidasProxyServiceControllerTest.java2
3 files changed, 20 insertions, 4 deletions
diff --git a/modules/eidas_proxy-sevice/checks/spotbugs-exclude.xml b/modules/eidas_proxy-sevice/checks/spotbugs-exclude.xml
index cdc9fa95..22dbaa13 100644
--- a/modules/eidas_proxy-sevice/checks/spotbugs-exclude.xml
+++ b/modules/eidas_proxy-sevice/checks/spotbugs-exclude.xml
@@ -16,5 +16,16 @@
<OR>
<Bug pattern="UNVALIDATED_REDIRECT" />
</OR>
+ </Match>
+ <Match>
+ <!-- That elements are accessible by design -->
+ <OR>
+ <Class name="at.asitplus.eidas.specific.modules.msproxyservice.dto.attributes.AttrMappingElement" />
+ <Class name="at.asitplus.eidas.specific.modules.msproxyservice.service.ProxyEidasAttributeRegistry" />
+ </OR>
+ <OR>
+ <Bug pattern="EI_EXPOSE_REP" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </OR>
</Match>
</FindBugsFilter>
diff --git a/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/dto/attributes/Type.java b/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/dto/attributes/Type.java
index f66bb799..6a06a5b5 100644
--- a/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/dto/attributes/Type.java
+++ b/modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/dto/attributes/Type.java
@@ -22,8 +22,7 @@ import lombok.Data;
public class Type {
/**
- * <code>true</code> if this attribute is part of MDS, otherwise
- * <code>false</code>
+ * <code>true</code> if this attribute is part of MDS, otherwise <code>false</code>.
*/
@JsonProperty("mds")
private Boolean mds;
@@ -50,7 +49,7 @@ public class Type {
NONE("none");
private final String value;
- private final static Map<String, Type.Mandator> CONSTANTS = new HashMap<>();
+ private static final Map<String, Type.Mandator> CONSTANTS = new HashMap<>();
static {
for (final Type.Mandator c : values()) {
@@ -72,6 +71,12 @@ public class Type {
return this.value;
}
+ /**
+ * Build {@link Mandator} from textual representation.
+ *
+ * @param value textual representation
+ * @return Type of the mandator
+ */
@JsonCreator
public static Type.Mandator fromValue(String value) {
final Type.Mandator constant = CONSTANTS.get(value);
diff --git a/modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/msproxyservice/test/protocol/EidasProxyServiceControllerTest.java b/modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/msproxyservice/test/protocol/EidasProxyServiceControllerTest.java
index ef1abbcd..b491c2bf 100644
--- a/modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/msproxyservice/test/protocol/EidasProxyServiceControllerTest.java
+++ b/modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/msproxyservice/test/protocol/EidasProxyServiceControllerTest.java
@@ -329,7 +329,7 @@ public class EidasProxyServiceControllerTest {
assertTrue("mandateprofiles not empty", spConfig.getMandateProfiles().isEmpty());
assertEquals("MandateMode", SpMandateModes.NONE, spConfig.getMandateMode());
- assertEquals("requested IDA attributes", 3, spConfig.getRequestedAttributes().size());
+ assertEquals("requested IDA attributes", 4, spConfig.getRequestedAttributes().size());
}