Skip to content

StashRepository: Change constructor to get needed objects directly#90

Closed
proski wants to merge 1 commit intojenkinsci:masterfrom
proski:direct-arguments
Closed

StashRepository: Change constructor to get needed objects directly#90
proski wants to merge 1 commit intojenkinsci:masterfrom
proski:direct-arguments

Conversation

@proski
Copy link

@proski proski commented Apr 24, 2019

*  StashRepository: Change constructor to get needed objects directly
   
   The StashPullRequestsBuilder object is not needed, but the project and
   the trigger are used a lot, so pass them to the constructor. Annotate the
   constructor arguments with @Nonnull.
   
   No need to defer setting trigger until the init() call, it is not going
   to change.
   
   Passing the needed objects directly simplifies mock object injection in
   unit tests.

Both #81 and #86 need to make changes to this code. This is the common foundation for both.

The StashPullRequestsBuilder object is not needed, but the project and
the trigger are used a lot, so pass them to the constructor. Annotate the
constructor arguments with @nonnull.

No need to defer setting trigger until the init() call, it is not going
to change.

Passing the needed objects directly simplifies mock object injection in
unit tests.
@proski proski mentioned this pull request Apr 25, 2019
@proski
Copy link
Author

proski commented May 6, 2019

Merged as part of #81, closing

@proski proski closed this May 6, 2019
@proski proski deleted the direct-arguments branch May 6, 2019 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant