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

Couchbase Container defaults to standard alpine image when using non default credentials. #784

Closed
klara-l opened this issue Jul 15, 2018 · 1 comment

Comments

@klara-l
Copy link
Contributor

klara-l commented Jul 15, 2018

When building a couchbase container like this

        CouchbaseContainer couchbaseContainer = new CouchbaseContainer()
                .withClusterUsername("admin")
                .withClusterPassword("foobar")
        couchbaseContainer.start();

The the with methods (generated with @Wither) return a copy of the original CouchbaseContainer.
The problem now is, that the generated constructor for that does not call the this() constructor but instead implicitly the super() constructor, which then defaults to alpine:3.5.

I have two ideas how to fix that:

  1. My suggestion is to use the more common style used across the project.
    public SELF withClusterUsername(String clusterUsername) {
        this.clusterUsername = clusterUsername;
        return self();
    }
  1. Those with methods feel a lot like a chained setter from lombok. We could also use a lombok.config with
##
## Key : lombok.accessors.chain
## Type: boolean
##
## Generate setters that return 'this' instead of 'void' (default: false).
##
## Examples:
#
# clear lombok.accessors.chain
# lombok.accessors.chain = [false | true]
#
lombok.accessors.chain = true

and be done with it, but this unfortunately is an api change. For that we could write simple delegate methods.

What do you think?

Btw. @Wither is used 12 times in the CouchbaseContainer an one time in the OkHttpWebTarget. (this does not hurt as it does not have a superclass)

@klara-l
Copy link
Contributor Author

klara-l commented Aug 3, 2018

fixed with #810

@klara-l klara-l closed this as completed Aug 3, 2018
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

No branches or pull requests

1 participant