From 61416bd0cd67af3e6c2fbd2b4cc720f3ac32d0f5 Mon Sep 17 00:00:00 2001 From: anujachaitanya Date: Mon, 25 Nov 2024 13:13:49 +0530 Subject: [PATCH] [SP-4263 | Abhishek/Anuja] Fixed failing test --- .../main/java/org/opencadc/skaha/K8SUtil.java | 18 +++++++++++------- .../java/org/opencadc/skaha/SkahaAction.java | 4 ++-- .../opencadc/skaha/session/DeleteAction.java | 5 +---- .../org/opencadc/skaha/session/SessionDAO.java | 2 +- .../skaha/utils/CommandExecutioner.java | 2 +- .../opencadc/skaha/image/GetActionTest.java | 6 +----- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/skaha/src/main/java/org/opencadc/skaha/K8SUtil.java b/skaha/src/main/java/org/opencadc/skaha/K8SUtil.java index 5f936c25..618dd97d 100644 --- a/skaha/src/main/java/org/opencadc/skaha/K8SUtil.java +++ b/skaha/src/main/java/org/opencadc/skaha/K8SUtil.java @@ -82,7 +82,8 @@ public static String getHostName() { /** * Helps reduce string constants in many places. - * @return The Skaha namespace + * + * @return The Skaha namespace */ public static String getNamespace() { return "skaha-system"; @@ -94,11 +95,13 @@ public static String getWorkloadNamespace() { /** * Filter out anything not in the alphanumeric or hyphen character set. - * @see Kubernetes Object names - * @param sessionID The provided session ID. - * @param type The defined type (desktop, notebook, etc.) - * @param userID The running User's ID. - * @return String sanitized name. Never null. + * + * @param sessionID The provided session ID. + * @param type The defined type (desktop, notebook, etc.) + * @param userID The running User's ID. + * @return String sanitized name. Never null. + * @see Kubernetes Object + * names */ public static String getJobName(String sessionID, String type, String userID) { // Replace values that are NOT alphanumeric or a hyphen. @@ -133,7 +136,8 @@ public static String getSessionExpiry() { /** * Obtain the configured default quota size in Gigabytes. - * @return integer in GB. + * + * @return integer in GB. */ public static String getDefaultQuota() { return System.getenv(K8SUtil.ARC_USER_QUOTA_IN_GB_NAME); diff --git a/skaha/src/main/java/org/opencadc/skaha/SkahaAction.java b/skaha/src/main/java/org/opencadc/skaha/SkahaAction.java index cac45fac..bc5342d5 100644 --- a/skaha/src/main/java/org/opencadc/skaha/SkahaAction.java +++ b/skaha/src/main/java/org/opencadc/skaha/SkahaAction.java @@ -397,8 +397,8 @@ public Image getPublicImage(String imageID) { } /** - * It's important to use the correct constructor for the PosixMapperClient, this class will wrap the logic - * based on how the Resource ID of the POSIX mapper was set (URI or URL). + * It's important to use the correct constructor for the PosixMapperClient, this class will wrap the logic based on + * how the Resource ID of the POSIX mapper was set (URI or URL). */ protected static class PosixMapperConfiguration { final URI resourceID; diff --git a/skaha/src/main/java/org/opencadc/skaha/session/DeleteAction.java b/skaha/src/main/java/org/opencadc/skaha/session/DeleteAction.java index 3175a4a0..99421e5c 100644 --- a/skaha/src/main/java/org/opencadc/skaha/session/DeleteAction.java +++ b/skaha/src/main/java/org/opencadc/skaha/session/DeleteAction.java @@ -76,10 +76,7 @@ import org.opencadc.skaha.utils.CommandExecutioner; import org.opencadc.skaha.utils.KubectlCommandBuilder; -/** - * - * @author majorb - */ +/** @author majorb */ public class DeleteAction extends SessionAction { private static final Logger log = Logger.getLogger(DeleteAction.class); diff --git a/skaha/src/main/java/org/opencadc/skaha/session/SessionDAO.java b/skaha/src/main/java/org/opencadc/skaha/session/SessionDAO.java index ae98c7e6..5a966c54 100644 --- a/skaha/src/main/java/org/opencadc/skaha/session/SessionDAO.java +++ b/skaha/src/main/java/org/opencadc/skaha/session/SessionDAO.java @@ -395,7 +395,7 @@ static Session constructSession(String k8sOutput, final String topLevelDirectory } /** - * Example input is [4444 5555 6666]. Convert to an actual integer array. + * Example input is [4444 5555 6666]. Convert to an actual integer array. * * @param inputArray Kubernetes output of an array of integers. * @return integer array, never null. diff --git a/skaha/src/main/java/org/opencadc/skaha/utils/CommandExecutioner.java b/skaha/src/main/java/org/opencadc/skaha/utils/CommandExecutioner.java index 10bb2d63..d74bf439 100644 --- a/skaha/src/main/java/org/opencadc/skaha/utils/CommandExecutioner.java +++ b/skaha/src/main/java/org/opencadc/skaha/utils/CommandExecutioner.java @@ -89,7 +89,7 @@ public static void execute(final String[] command, final OutputStream standardOu * Delete, if necessary, and recreate the image pull secret for the given registry. * * @param registryAuth The registry credentials. - * @param secretName The name of the secret to create. + * @param secretName The name of the secret to create. * @throws Exception If there is an error creating the secret. */ public static void ensureRegistrySecret(final ImageRepositoryAuth registryAuth, final String secretName) diff --git a/skaha/src/test/java/org/opencadc/skaha/image/GetActionTest.java b/skaha/src/test/java/org/opencadc/skaha/image/GetActionTest.java index d65df7b6..06039e5a 100644 --- a/skaha/src/test/java/org/opencadc/skaha/image/GetActionTest.java +++ b/skaha/src/test/java/org/opencadc/skaha/image/GetActionTest.java @@ -70,7 +70,6 @@ import static org.junit.Assert.assertThrows; import static org.mockito.Mockito.when; import static org.opencadc.skaha.utils.TestUtils.set; -import static org.opencadc.skaha.utils.TestUtils.setEnv; import java.util.List; import java.util.Set; @@ -83,10 +82,7 @@ import org.opencadc.skaha.SkahaAction; import org.opencadc.skaha.utils.RedisCache; -/** - * @author majorb - * - */ +/** @author majorb */ @RunWith(MockitoJUnitRunner.class) public class GetActionTest {