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

Fix issue of connecting to influxdb without username/password on okhttp 4.x.x #644

Merged
merged 5 commits into from
Dec 22, 2019
Merged

Conversation

vinh0604
Copy link
Contributor

This pull request is to fix the bug mentioned in #643 by only add BasicAuthInterceptor to OkHttpClient.Builder when both username and password are not null.

…p 4+

Add BasicAuthInterceptor to OkHttpClient.Builder only when username and password are not nul
@majst01
Copy link
Collaborator

majst01 commented Dec 21, 2019

Hi @vinh0604

thanks for this fix, i was experiencing the same when i tried to upgrade okhttp as part of my regular dependency updates. But i was to lazy to look into the root cause. So welcome !

actually all test are falling with:

[ERROR] /usr/src/mymaven/src/main/java/org/influxdb/impl/InfluxDBImpl.java:47: Using the '.*' form of import should be avoided - java.util.*. [AvoidStarImport]

this must be addressed first. I also have some small nits on the MR.

@vinh0604
Copy link
Contributor Author

Sorry, I didn't run stylecheck before pushing. Those issues were resolved now.
Please check.

@codecov-io
Copy link

codecov-io commented Dec 22, 2019

Codecov Report

Merging #644 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #644      +/-   ##
============================================
- Coverage     88.09%   88.06%   -0.03%     
  Complexity      718      718              
============================================
  Files            69       69              
  Lines          2477     2480       +3     
  Branches        262      261       -1     
============================================
+ Hits           2182     2184       +2     
  Misses          207      207              
- Partials         88       89       +1
Impacted Files Coverage Δ Complexity Δ
...rc/main/java/org/influxdb/impl/BatchProcessor.java 98.52% <100%> (ø) 19 <0> (ø) ⬇️
src/main/java/org/influxdb/impl/InfluxDBImpl.java 82.29% <100%> (+0.12%) 82 <0> (ø) ⬇️
src/main/java/org/influxdb/dto/Query.java 65% <0%> (-2.5%) 13% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8090798...5f050c4. Read the comment docs.

@majst01
Copy link
Collaborator

majst01 commented Dec 22, 2019

Now all checks have passed, great. May i asked you to add a additional unit test case to ensure that the extra if statement is covered. I really appreciate your contribution !

@vinh0604
Copy link
Contributor Author

Now all checks have passed, great. May i asked you to add a additional unit test case to ensure that the extra if statement is covered. I really appreciate your contribution !

Thanks, I added one more test case in InfluxDBFactoryTest as well as removing the if condition in the internal construct of InfluxDBImpl that is only used in test.

@majst01 majst01 merged commit d944e96 into influxdata:master Dec 22, 2019
@majst01
Copy link
Collaborator

majst01 commented Dec 22, 2019

Thanks for contributing.

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