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

#235 - Removed unused method #241

Merged

Conversation

VivianLopes
Copy link
Contributor

Removed unused isHttps() and removed BackendService constructor argument from StyxHttpClient.Builder

/**
* Create a new builder.
*
* @return a new builder
*/
public static Builder newHttpClientBuilder(BackendService backendService) {
return new Builder(backendService);
public static Builder newHttpClientBuilder(Id applicationId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should call the parameter backendServiceId for consistency.


public Builder(BackendService backendService) {
this.backendService = checkNotNull(backendService);
public Builder(Id applicationId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should call the parameter and field backendServiceId for consistency.

@VivianLopes VivianLopes force-pushed the issue_235_remove_unused_method branch from 4a64f5a to 9f58868 Compare August 23, 2018 15:53
public Builder(BackendService backendService) {
this.backendService = checkNotNull(backendService);
public Builder(Id backendServiceId) {
this.backendServiceId = checkNotNull(backendServiceId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Java 8's requireNonNull instead of Guava's checkNotNull. Same comment for stickySessionConfig(...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See ticket #243

@dvlato dvlato changed the base branch from styx-1.0-dev to master August 31, 2018 10:25
@VivianLopes VivianLopes force-pushed the issue_235_remove_unused_method branch from 62e5322 to 29a2156 Compare August 31, 2018 12:38
val client = newHttpClientBuilder(backendService.id)
.loadBalancer(stickySessionStrategy(activeOrigins(backendService)))
.stickySessionConfig(stickySessionConfig)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear how to do this properly/generally in our case, but we might want to test that the required 'Builder' methods (in this case, stickySessionConfig() ) have been invoked in our UnitTests instead of only during the EndToEndTests . Ideally, we would guarantee this at compile time or at the very least at runtime.
This is a clear short-coming of our usage of the builder pattern, we cannot guarantee that the object has been constructed with all the required parameters...

@VivianLopes VivianLopes merged commit b560c48 into ExpediaGroup:master Sep 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

Successfully merging this pull request may close these issues.

4 participants