From 5563f89aa611fa48526fe17666044ce06911f72b Mon Sep 17 00:00:00 2001 From: Enrico Vianello Date: Mon, 9 Dec 2024 18:15:16 +0100 Subject: [PATCH] Fix sonar issues --- .../storm/webdav/authz/vomap/MapfileVOMembershipSource.java | 5 +++-- .../storm/webdav/test/authz/vomap/VOMSMapTests.java | 2 +- src/test/resources/vomsmap/testers.map | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/italiangrid/storm/webdav/authz/vomap/MapfileVOMembershipSource.java b/src/main/java/org/italiangrid/storm/webdav/authz/vomap/MapfileVOMembershipSource.java index 071ed028..132eca24 100644 --- a/src/main/java/org/italiangrid/storm/webdav/authz/vomap/MapfileVOMembershipSource.java +++ b/src/main/java/org/italiangrid/storm/webdav/authz/vomap/MapfileVOMembershipSource.java @@ -22,7 +22,6 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; -import java.util.HashSet; import java.util.List; import java.util.Set; @@ -32,6 +31,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.common.collect.Sets; + import eu.emi.security.authn.x509.impl.OpensslNameUtils; public class MapfileVOMembershipSource implements VOMembershipSource { @@ -82,7 +83,7 @@ public Set getVOMembers() { long startTime = System.currentTimeMillis(); - Set subjects = new HashSet(); + Set subjects = Sets.newHashSet(); CSVParser parser = getParser(); diff --git a/src/test/java/org/italiangrid/storm/webdav/test/authz/vomap/VOMSMapTests.java b/src/test/java/org/italiangrid/storm/webdav/test/authz/vomap/VOMSMapTests.java index d9b0a976..e9f1d369 100644 --- a/src/test/java/org/italiangrid/storm/webdav/test/authz/vomap/VOMSMapTests.java +++ b/src/test/java/org/italiangrid/storm/webdav/test/authz/vomap/VOMSMapTests.java @@ -41,7 +41,7 @@ void VOMapParserTest() { Assert.assertEquals("testers", m.getVOName()); Assert.assertTrue(m.getVOMembers().contains(AC_SUBJECT)); - Assert.assertTrue(m.getVOMembers().contains(EV_SUBJECT)); + Assert.assertFalse(m.getVOMembers().contains(EV_SUBJECT)); Assert.assertFalse(m.getVOMembers().contains(COMMA_SUBJECT)); Assert.assertTrue(m.getVOMembers().contains(RM_SUBJECT)); Assert.assertFalse(m.getVOMembers().contains("CN=I am not Real, L=CNAF")); diff --git a/src/test/resources/vomsmap/testers.map b/src/test/resources/vomsmap/testers.map index 928a876e..b5f13a28 100644 --- a/src/test/resources/vomsmap/testers.map +++ b/src/test/resources/vomsmap/testers.map @@ -1,4 +1,4 @@ /C=IT/O=INFN/OU=Personal Certificate/L=CNAF/CN=Andrea Ceccanti,/C=IT/O=INFN/CN=INFN CA,andrea.ceccanti@cnaf.infn.it -/C=IT/O=INFN/OU=Personal Certificate/L=CNAF/CN=Enrico Vianello,/C=IT/O=INFN/CN=INFN CA,enrico.vianello@cnaf.infn.it +C=IT/O=INFN/OU=Personal Certificate/L=CNAF/CN=Enrico Vianello,/C=IT/O=INFN/CN=INFN CA,enrico.vianello@cnaf.infn.it /C=IT/O=INFN/OU=Personal Certificate/L=CNAF,Bologna/CN=Federica Agostini,/C=IT/O=INFN/CN=INFN CA,federica.agostini@cnaf.infn.it /C=IT/O=INFN/OU=Personal Certificate/L=CNAF/CN=Roberta Miccoli,/C=IT/O=INFN/CN=INFN CA,roberta.miccoli@cnaf.infn.it \ No newline at end of file