Skip to content

Commit

Permalink
GoTreeBuilder constructor changed
Browse files Browse the repository at this point in the history
  • Loading branch information
noyshabtay committed Dec 5, 2023
1 parent 947c89c commit a6943b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/main/java/com/jfrog/ide/common/go/GoTreeBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ public class GoTreeBuilder {
private static final String GO_SOURCE_CODE_PREFIX = "github.com/golang/go:";
static final Version MIN_GO_VERSION = new Version("1.16");
private final Map<String, String> env;
private final String executablePath;
private final Path projectDir;
private final String descriptorFilePath;
private final Log logger;

public GoTreeBuilder(String executablePath, Path projectDir, String descriptorFilePath, Map<String, String> env, Log logger) {
this.executablePath = executablePath;
public GoTreeBuilder(Path projectDir, String descriptorFilePath, Map<String, String> env, Log logger) {
this.projectDir = projectDir;
this.descriptorFilePath = descriptorFilePath;
this.logger = logger;
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/com/jfrog/ide/common/go/GoTreeBuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void testCreateDependencyTree1() {

try {
Path projectDir = GO_ROOT.resolve("project1");
GoTreeBuilder treeBuilder = new GoTreeBuilder(null, projectDir, projectDir.resolve("go.mod").toString(), null, log);
GoTreeBuilder treeBuilder = new GoTreeBuilder(projectDir, projectDir.resolve("go.mod").toString(), null, log);
DepTree dt = treeBuilder.buildTree();
validateDependencyTreeResults(expected, dt);
} catch (IOException ex) {
Expand All @@ -60,7 +60,7 @@ public void testCreateDependencyTree2() {
}};
try {
Path projectDir = GO_ROOT.resolve("project2");
GoTreeBuilder treeBuilder = new GoTreeBuilder(null, projectDir, projectDir.resolve("go.mod").toString(), null, log);
GoTreeBuilder treeBuilder = new GoTreeBuilder(projectDir, projectDir.resolve("go.mod").toString(), null, log);
DepTree dt = treeBuilder.buildTree();
validateDependencyTreeResults(expected, dt);
} catch (IOException ex) {
Expand All @@ -79,7 +79,7 @@ public void testCreateDependencyTree3() {
}};
try {
Path projectDir = GO_ROOT.resolve("project3");
GoTreeBuilder treeBuilder = new GoTreeBuilder(null, projectDir, projectDir.resolve("go.mod").toString(), null, log);
GoTreeBuilder treeBuilder = new GoTreeBuilder(projectDir, projectDir.resolve("go.mod").toString(), null, log);
DepTree dt = treeBuilder.buildTree();
validateDependencyTreeResults(expected, dt);
} catch (IOException ex) {
Expand All @@ -98,7 +98,7 @@ public void testCreateDependencyTree4() {
}};
try {
Path projectDir = GO_ROOT.resolve("project4");
GoTreeBuilder treeBuilder = new GoTreeBuilder(null, projectDir, projectDir.resolve("go.mod").toString(), null, log);
GoTreeBuilder treeBuilder = new GoTreeBuilder(projectDir, projectDir.resolve("go.mod").toString(), null, log);
DepTree dt = treeBuilder.buildTree();
validateDependencyTreeResults(expected, dt);
} catch (IOException ex) {
Expand All @@ -114,7 +114,7 @@ public void testCreateDependencyTree5() {
Map<String, Integer> expected = new HashMap<>();
try {
Path projectDir = GO_ROOT.resolve("project5");
GoTreeBuilder treeBuilder = new GoTreeBuilder(null, projectDir, projectDir.resolve("go.mod").toString(), null, log);
GoTreeBuilder treeBuilder = new GoTreeBuilder(projectDir, projectDir.resolve("go.mod").toString(), null, log);
DepTree dt = treeBuilder.buildTree();
validateDependencyTreeResults(expected, dt);
} catch (IOException ex) {
Expand All @@ -128,7 +128,7 @@ public void testCreateDependencyTree5() {
@Test
public void testCreateDependencyTree6() {
Path projectDir = GO_ROOT.resolve("project6");
GoTreeBuilder treeBuilder = new GoTreeBuilder(null, projectDir, projectDir.resolve("go.mod").toString(), null, log);
GoTreeBuilder treeBuilder = new GoTreeBuilder(projectDir, projectDir.resolve("go.mod").toString(), null, log);
assertThrows(IOException.class, treeBuilder::buildTree);
}

Expand All @@ -139,7 +139,7 @@ public void testCreateDependencyTreeEmbedProject() throws IOException {
put("github.com/jfrog/jfrog-client-go:0.26.1", 8);
}};
Path projectDir = GO_ROOT.resolve("embedProject");
GoTreeBuilder treeBuilder = new GoTreeBuilder(null, projectDir, projectDir.resolve("go.mod").toString(), null, log);
GoTreeBuilder treeBuilder = new GoTreeBuilder(projectDir, projectDir.resolve("go.mod").toString(), null, log);
DepTree depTree = treeBuilder.buildTree();
validateDependencyTreeResults(expected, depTree);
}
Expand Down

0 comments on commit a6943b1

Please sign in to comment.