diff --git a/plugins/command-manager/src/main/java/com/wazuh/commandmanager/index/CommandIndex.java b/plugins/command-manager/src/main/java/com/wazuh/commandmanager/index/CommandIndex.java index 79af85b..f4238a9 100644 --- a/plugins/command-manager/src/main/java/com/wazuh/commandmanager/index/CommandIndex.java +++ b/plugins/command-manager/src/main/java/com/wazuh/commandmanager/index/CommandIndex.java @@ -31,6 +31,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; +/** + * Class to manage the Command Manager index and index template. + */ public class CommandIndex implements IndexingOperationListener { private static final Logger logger = LogManager.getLogger(CommandIndex.class); @@ -53,7 +56,7 @@ public CommandIndex(Client client, ClusterService clusterService, ThreadPool thr } /** - * @param command: A Command model object + * @param command A Command model object * @return A CompletableFuture with the RestStatus response from the operation */ public CompletableFuture asyncCreate(Command command) { @@ -95,9 +98,10 @@ public CompletableFuture asyncCreate(Command command) { } /** + * Checks for the existence of the given index template in the cluster. * - * @param template_name - * @return + * @param template_name index template name within the resources folder + * @return whether the index template exists. */ public boolean indexTemplateExists(String template_name) { Map templates = this.clusterService diff --git a/plugins/command-manager/src/main/java/com/wazuh/commandmanager/utils/httpclient/HttpRestClientDemo.java b/plugins/command-manager/src/main/java/com/wazuh/commandmanager/utils/httpclient/HttpRestClientDemo.java index 5974a16..448ece4 100644 --- a/plugins/command-manager/src/main/java/com/wazuh/commandmanager/utils/httpclient/HttpRestClientDemo.java +++ b/plugins/command-manager/src/main/java/com/wazuh/commandmanager/utils/httpclient/HttpRestClientDemo.java @@ -17,10 +17,19 @@ import java.security.AccessController; import java.security.PrivilegedAction; +/** + * Demo class to test the {@link HttpRestClient} class. + */ public class HttpRestClientDemo { private static final Logger log = LogManager.getLogger(HttpRestClientDemo.class); + /** + * Demo method to test the {@link HttpRestClient} class. + * + * @param endpoint POST's requests endpoint as a well-formed URI + * @param body POST's request body as a JSON string. + */ public static void run(String endpoint, String body) { log.info("Executing POST request"); AccessController.doPrivileged( diff --git a/plugins/command-manager/src/test/java/com/wazuh/commandmanager/CommandManagerTests.java b/plugins/command-manager/src/test/java/com/wazuh/commandmanager/CommandManagerTests.java index f24d409..eacd0b1 100644 --- a/plugins/command-manager/src/test/java/com/wazuh/commandmanager/CommandManagerTests.java +++ b/plugins/command-manager/src/test/java/com/wazuh/commandmanager/CommandManagerTests.java @@ -10,7 +10,6 @@ import com.wazuh.commandmanager.utils.httpclient.HttpRestClient; import org.apache.hc.client5.http.async.methods.SimpleHttpResponse; import org.junit.Assert; -import org.junit.Test; import org.opensearch.test.OpenSearchTestCase; import java.net.URI; @@ -53,6 +52,9 @@ public void testPost_success() { } } - public void testPost_badUri() {} - public void testPost_badPayload() {} + public void testPost_badUri() { + } + + public void testPost_badPayload() { + } }