Skip to content

Conversation

@dargmuesli
Copy link
Member

Builds upon #407, keeping the setter-only builder architecture.

Bruce Downs added 3 commits November 24, 2024 19:46
* add HttpClientConnectionManager to SpotifyHttpManager.builder
* add getConnectionManager to handle default
@codecov
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 46.15385% with 7 lines in your changes missing coverage. Please review.

Project coverage is 66.29%. Comparing base (0afe58b) to head (c514b65).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
...a/se/michaelthelin/spotify/SpotifyHttpManager.java 46.15% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #409      +/-   ##
============================================
- Coverage     66.33%   66.29%   -0.05%     
  Complexity      669      669              
============================================
  Files           184      184              
  Lines          7111     7117       +6     
  Branches       1146     1147       +1     
============================================
+ Hits           4717     4718       +1     
- Misses         1491     1495       +4     
- Partials        903      904       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}
}

public HttpClientConnectionManager getConnectionManager() {

Choose a reason for hiding this comment

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

getConnectionManager is no longer necessary

Copy link
Member Author

Choose a reason for hiding this comment

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

We have those getters for all class variables right now, like getProxy, ... which we don't use in our code base either, so I just added this as well.

Comment on lines 80 to 91
if (builder.connectionManager == null) {
BasicHttpClientConnectionManager basicHttpClientConnectionManager = new BasicHttpClientConnectionManager();
basicHttpClientConnectionManager.setConnectionConfig(ConnectionConfig
.custom()
.setConnectTimeout(connectTimeout != null ?
Timeout.ofMilliseconds(connectTimeout) :
ConnectionConfig.DEFAULT.getConnectTimeout())
.build());
this.connectionManager = basicHttpClientConnectionManager;
} else {
this.connectionManager = builder.connectionManager;
}

Choose a reason for hiding this comment

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

nitpick consider conditional consistency throughout the library.

either this:

    if (value == null) {
      // something
    } else {
      // something else
    }

or this:

    if (value != null) {
      // something
    } else {
      // something else
    }

Copy link
Member Author

Choose a reason for hiding this comment

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

Switched ✅

Copy link

@bruceadowns bruceadowns left a comment

Choose a reason for hiding this comment

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

lgtm, I like keeping the builder usage consistent.

@dargmuesli dargmuesli force-pushed the expose-connmgr-dargmuesli branch from 2836747 to c514b65 Compare December 3, 2024 22:53
@dargmuesli dargmuesli merged commit 330479a into master Dec 3, 2024
5 of 7 checks passed
@dargmuesli dargmuesli deleted the expose-connmgr-dargmuesli branch December 3, 2024 22:54
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.

3 participants