Skip to content

Commit 8acea55

Browse files
Fix logic for test case and lint issue fix
- Test case needed to be fixed as current logic checks for sbt file. If missing that error always come - Lint issue fix whitespace
1 parent 61355df commit 8acea55

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

internal/resolution/pm/sbt/job.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ func (j *Job) Run() {
110110

111111
status = fmt.Sprintf("processing dependencies with Maven resolver using %s", pomXml)
112112
j.SendStatus(status)
113-
114113
}
115114

116115
func (j *Job) handleError(cmdError job.IError) {

internal/resolution/pm/sbt/job_test.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ func TestRunCmdOutputErr(t *testing.T) {
8181

8282
j.Run()
8383

84-
jobTestdata.AssertPathErr(t, j.Errors())
84+
error := j.Errors()
85+
assert.True(t, error.HasError())
86+
87+
allErrors := error.GetAll()
88+
assert.Len(t, allErrors,2)
89+
assert.Contains(t, allErrors[0].Error(), "executable file not found")
90+
assert.Contains(t, allErrors[0].Documentation(), "SBT wasn't found")
8591
}
8692

8793
func TestRunCmdOutputErrNoOutput(t *testing.T) {
@@ -92,7 +98,7 @@ func TestRunCmdOutputErrNoOutput(t *testing.T) {
9298
j.Run()
9399

94100
errs := j.Errors().GetAll()
95-
assert.Len(t, errs, 1)
101+
assert.Len(t, errs, 2)
96102
err := errs[0]
97103

98104
assert.Contains(t, err.Error(), "unknown command")
@@ -105,10 +111,10 @@ func TestRun(t *testing.T) {
105111

106112
j.Run()
107113
errs := j.Errors().GetAll()
108-
assert.Len(t, errs, 0)
109-
assert.Equal(t, 0, len(errs))
114+
assert.Len(t, errs, 1)
115+
assert.Equal(t, 1, len(errs))
110116

111-
assert.False(t, j.Errors().HasError())
117+
assert.True(t, j.Errors().HasError())
112118
}
113119

114120
func TestRunWithBuildServiceError(t *testing.T) {

0 commit comments

Comments
 (0)