Skip to content

Commit

Permalink
Extract NewCheckerUsingClient() from NewChecker()
Browse files Browse the repository at this point in the history
Another prefactoring to support test.

[#4]

Signed-off-by: Jacques Chester <jchester@pivotal.io>
  • Loading branch information
jchester authored and jchesterpivotal committed Aug 19, 2018
1 parent 38fc5a9 commit baff7a1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,14 @@ func NewChecker(input *config.CheckRequest) Checker {
}
client := &http.Client{Transport: tr}
concourse := gc.NewClient(input.Source.ConcourseUrl, client, false)
team := concourse.Team(input.Source.Team)

return NewCheckerUsingClient(input, concourse)
}

func NewCheckerUsingClient(input *config.CheckRequest, client gc.Client) Checker {
return checker{
CheckRequest: input,
ConcourseClient: concourse,
ConcourseTeam:team,
ConcourseClient: client,
ConcourseTeam: client.Team(input.Source.Team),
}
}

0 comments on commit baff7a1

Please sign in to comment.