Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getServicePort on DockerComposeContainer throws NullPointerException if service instance number in not used. #619

Merged
merged 1 commit into from Mar 26, 2018

Conversation

barrycommins
Copy link
Contributor

This is quite a minor one, but maybe worth fixing for consistency.

It is possible to expose a service in DockerComposeContainer without specifying the instance number:

new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
        .withExposedService("redis", 6379)

but when you then call getServicePort("redis", 6379), a NullPointerException is thrown.

It works ok with getServicePort("redis_1", 6379)

…ption if service instance number in not used.
@bsideup
Copy link
Member

bsideup commented Mar 23, 2018

@barrycommins nice! Was planning to do exactly that :D Thanks for contributing it :)

@kiview
Copy link
Member

kiview commented Mar 23, 2018

LGTM, I just deleted the corrupted Travis caches and restarted the build, should suceed now.

@rnorth
Copy link
Member

rnorth commented Mar 26, 2018

Great! Thanks for this.
I'll merge.

@rnorth rnorth merged commit 37456ae into testcontainers:master Mar 26, 2018
@barrycommins barrycommins deleted the 619 branch March 27, 2018 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants