X Tutup
Skip to content

Improves use of docker-java in unit tests#28

Merged
marcuslinke merged 4 commits intodocker-java:masterfrom
mfulgo:for-upstream
Jul 29, 2014
Merged

Improves use of docker-java in unit tests#28
marcuslinke merged 4 commits intodocker-java:masterfrom
mfulgo:for-upstream

Conversation

@mfulgo
Copy link
Copy Markdown
Contributor

@mfulgo mfulgo commented Jul 18, 2014

Starts to address Issue #25.

mfulgo added 4 commits July 18, 2014 15:27
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
@marcuslinke marcuslinke merged commit 1459ffb into docker-java:master Jul 29, 2014
@marcuslinke
Copy link
Copy Markdown
Contributor

@mfulgo Merged. Thank you!

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.

2 participants

X Tutup