Improves use of docker-java in unit tests#28
Merged
marcuslinke merged 4 commits intodocker-java:masterfrom Jul 29, 2014
Merged
Conversation
The field is never used in these tests. It should make it easier to separate tests that require a docker.io account from those that do not.
Just doing a little refactoring of the constructor to make it easier to read.
In order to improve the usability of DockerClient in tests, this introduces a CommandFactory interface (and default implementation). The interface can be injected into the DockerClient at construction, allowing the use of a CommandFactory that returns mock or stub commands for later test assertions. I envision that the methods that create the commands from the DockerClient itself could be deprecated: users of the library could create the commands from the CommandFactory directly and simply pass them into the DockerClient#execute method where teh baseResource and (if appropriate) authConfig would be set on the command before it's executed. Issue docker-java#25
This only adds getters for fields that are of immutable types (Strings, booleans, ints). For objects that take in Config objects, I'll look at adding getters in a future commit. Ideally all of these things would be immutable. Issue docker-java#25
Contributor
|
@mfulgo Merged. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Starts to address Issue #25.