Skip to content

Commit

Permalink
🎨 improve format of the code
Browse files Browse the repository at this point in the history
  • Loading branch information
noyshabtay committed Nov 26, 2023
1 parent cacfe9f commit 3e8c4de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private void addDepTreeNodes(Map<String, DepTreeNode> nodes, JsonNode jsonDep, D
private boolean isDirectDependency(String rawDependency) {
rawDependency = StringUtils.lowerCase(rawDependency); // The word specified can be in upper or lower case
// If rawDependency contains "specified in" or "workspace-aggregator-" it is a direct dependency
return StringUtils.contains(rawDependency, "specified in") || StringUtils.contains(rawDependency, "workspace-aggregator-");
return StringUtils.containsAny(rawDependency, "specified in", "workspace-aggregator-");
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/jfrog/ide/common/yarn/YarnDriverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
import static org.testng.Assert.*;

/**
* Test the 'why' functionality in YarnDriver.
* Test functionalities of YarnDriver.
*/
public class YarnDriverTest {
private static final Path YARN_ROOT = Paths.get(".").toAbsolutePath().normalize().resolve(Paths.get("src", "test", "resources", "yarn"));

enum Project {
public enum Project {

EMPTY("empty"),
DEPENDENCY("dependency");
Expand Down
12 changes: 5 additions & 7 deletions src/test/java/com/jfrog/ide/common/yarn/YarnTreeBuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class YarnTreeBuilderTest {
private static final Path YARN_ROOT = Paths.get(".").toAbsolutePath().normalize().resolve(Paths.get("src", "test", "resources", "yarn"));

enum Project {
public enum Project {
EMPTY("package-name1", "empty"),
DEPENDENCY("package-name2", "dependency"),
EXAMPLE("example-yarn-package", "exampleYarnPackage");
Expand Down Expand Up @@ -144,15 +144,13 @@ public void extractMultiplePathsTest() {
List.of(projectRootId, packageFullName)
);
YarnTreeBuilder yarnTreeBuilder = new YarnTreeBuilder(Paths.get(""), "", null, new NullLog());
List<List<String>> paths = yarnTreeBuilder.extractMultiplePaths(projectRootId, packageFullName, rawDependencyPaths);
List<List<String>> actualPaths = yarnTreeBuilder.extractMultiplePaths(projectRootId, packageFullName, rawDependencyPaths);

assertNotNull(paths);
assertEquals(paths.size(), expectedPaths.size());
for (List<String> path : paths) {
assertNotNull(actualPaths);
assertEquals(actualPaths.size(), expectedPaths.size());
for (List<String> path : actualPaths) {
assertTrue(expectedPaths.contains(path));
}


}

@DataProvider
Expand Down

0 comments on commit 3e8c4de

Please sign in to comment.