From f9297a970bf78debe4638e59420d3fb9e336bdb3 Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Tue, 18 Feb 2025 09:49:31 +0200 Subject: [PATCH] Update triageGetStates method to return CustomState and remove test ignore --- src/main/java/com/checkmarx/ast/wrapper/CxWrapper.java | 3 +-- src/test/java/com/checkmarx/ast/PredicateTest.java | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/checkmarx/ast/wrapper/CxWrapper.java b/src/main/java/com/checkmarx/ast/wrapper/CxWrapper.java index d9c10fd4..38640d81 100644 --- a/src/main/java/com/checkmarx/ast/wrapper/CxWrapper.java +++ b/src/main/java/com/checkmarx/ast/wrapper/CxWrapper.java @@ -166,7 +166,7 @@ public List triageShow(@NonNull UUID projectId, String similarityId, return Execution.executeCommand(withConfigArguments(arguments), logger, Predicate::listFromLine, Predicate::validator); } - public List triageGetStates(boolean all) throws IOException, InterruptedException, CxException { + public List triageGetStates(boolean all) throws IOException, InterruptedException, CxException { this.logger.info("Executing 'triage get-states' command using the CLI."); List arguments = new ArrayList<>(); @@ -187,7 +187,6 @@ public void triageUpdate(@NonNull UUID projectId, String similarityId, String sc this.logger.info("Executing 'triage update' command using the CLI."); this.logger.info("Updating the similarityId {} with state {} with customStateId {} and severity {}.", similarityId, state, customStateId, severity); - boolean emptyState = state == null || state.isEmpty(); boolean emptyCustomStateId = customStateId == null || customStateId.isEmpty(); List arguments = new ArrayList<>(); diff --git a/src/test/java/com/checkmarx/ast/PredicateTest.java b/src/test/java/com/checkmarx/ast/PredicateTest.java index 55d6b268..7eb2f9c9 100644 --- a/src/test/java/com/checkmarx/ast/PredicateTest.java +++ b/src/test/java/com/checkmarx/ast/PredicateTest.java @@ -1,11 +1,11 @@ package com.checkmarx.ast; +import com.checkmarx.ast.predicate.CustomState; import com.checkmarx.ast.predicate.Predicate; import com.checkmarx.ast.results.Results; import com.checkmarx.ast.results.result.Result; import com.checkmarx.ast.scan.Scan; import com.checkmarx.ast.wrapper.CxConstants; -import org.junit.Ignore; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -48,9 +48,8 @@ void testTriage() throws Exception { } @Test - @Disabled("Ignore this tests until get states api will be in production") void testGetStates() throws Exception { - List states = wrapper.triageGetStates(false); + List states = wrapper.triageGetStates(false); Assertions.assertNotNull(states); } }