Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalk007 committed Sep 18, 2024
1 parent 33369e6 commit b37a752
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ String createComponentName(PsiElement element) {
List<KtValueArgument> argumentList = ((KtValueArgumentList) element).getArguments();
if (argumentList.size() == 1) {
// "commons-collections:commons-collections:3.2.2"
return extractArgument(argumentList.get(0));
String artifactId = extractArgument(argumentList.get(0));
return StringUtils.substringBeforeLast(artifactId, ":");
}
if (argumentList.size() >= 3) {
// "commons-collections", "commons-collections"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public class GradleGroovyInspectionTest extends InspectionsTestBase {
// files as groovy-script.
private static final String PACKAGE_DESCRIPTOR = "build.groovy";
private final InspectionTestDependency[] DEPENDENCIES = {
new InspectionTestDependency(96, "a", "b:c"),
new InspectionTestDependency(139, "d", "e:f"),
new InspectionTestDependency(180, "g", "h:i"),
new InspectionTestDependency(200, "j", "k:l"),
new InspectionTestDependency(225, "m", "n:o"),
new InspectionTestDependency(320, "net.lingala.zip4j", "zip4j:2.3.0"),
new InspectionTestDependency(390, "org.codehaus.groovy", "groovy-all:3.0.5"),
new InspectionTestDependency(96, "a", "b"),
new InspectionTestDependency(139, "d", "e"),
new InspectionTestDependency(180, "g", "h"),
new InspectionTestDependency(200, "j", "k"),
new InspectionTestDependency(225, "m", "n"),
new InspectionTestDependency(320, "net.lingala.zip4j", "zip4j"),
new InspectionTestDependency(390, "org.codehaus.groovy", "groovy-all"),
};

@SuppressWarnings("MethodDoesntCallSuperMethod")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static Collection<Object[]> data() {
return Arrays.asList(new Object[][]{
{"a:b:c", "a:b"},
{"a:b:c:d", "a:b"},
{"a:b", "a:b"},
{"a", "a"},
{"xyz", "xyz"}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class GradleKotlinInspectionTest extends InspectionsTestBase {
// files as groovy-script.
private static final String PACKAGE_DESCRIPTOR = "build.gradle.kts";
private final InspectionTestDependency[] DEPENDENCIES = {
new InspectionTestDependency(119, "a", "b:c"),
new InspectionTestDependency(144, "d", "e:f"),
new InspectionTestDependency(119, "a", "b"),
new InspectionTestDependency(144, "d", "e"),
};

private final int[] NON_DEPENDENCIES_POSITIONS = {273, 338};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ public class MavenInspectionTest extends InspectionsTestBase {

private static final String PACKAGE_DESCRIPTOR = "pom.xml";
private final InspectionTestDependency[] DEPENDENCIES = {
new InspectionTestDependency(550, "a", "b:c"),
new InspectionTestDependency(788, "d", "e:f"),
new InspectionTestDependency(990, "g", "h:i"),
new InspectionTestDependency(550, "a", "b"),
new InspectionTestDependency(788, "d", "e"),
new InspectionTestDependency(990, "g", "h"),
};

private final int[] NON_DEPENDENCIES_POSITIONS = {397, 1197, 1258};
Expand Down

0 comments on commit b37a752

Please sign in to comment.