diff options
author | Javier García Orduña <javier.garcia@sonarsource.com> | 2025-02-10 09:11:22 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2025-02-19 20:03:12 +0000 |
commit | c57cc761d6997f839407fcb98db91b24bf83eb13 (patch) | |
tree | 24119f5e967332f5fccbd2cb90059e9236f11dca /server/sonar-db-dao/src/test/java | |
parent | bb40b3b17279e64d21f757ba4295148fd0214b75 (diff) | |
download | sonarqube-c57cc761d6997f839407fcb98db91b24bf83eb13.tar.gz sonarqube-c57cc761d6997f839407fcb98db91b24bf83eb13.zip |
SQRP-188 Add filtering to "search" dependencies REST API
Diffstat (limited to 'server/sonar-db-dao/src/test/java')
-rw-r--r-- | server/sonar-db-dao/src/test/java/org/sonar/db/sca/ScaDependenciesQueryTest.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/sca/ScaDependenciesQueryTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/sca/ScaDependenciesQueryTest.java new file mode 100644 index 00000000000..0f310ff5ef4 --- /dev/null +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/sca/ScaDependenciesQueryTest.java @@ -0,0 +1,39 @@ +/* + * SonarQube + * Copyright (C) 2009-2025 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.db.sca; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class ScaDependenciesQueryTest { + + @Test + void testLikeQuery() { + ScaDependenciesQuery scaDependenciesQuery = new ScaDependenciesQuery("branchUuid", null, null, "QUERY"); + assertEquals("query%", scaDependenciesQuery.likeQuery()); + } + + @Test + void testLikeQueryWithNullQuery() { + ScaDependenciesQuery scaDependenciesQuery = new ScaDependenciesQuery("branchUuid", null, null, null); + assertNull(scaDependenciesQuery.likeQuery()); + } +} |