k0r0pt / Project-Tauro

A Router WiFi key recovery/cracking tool with a twist.
GNU General Public License v3.0
89 stars 16 forks source link

Injecting DAO service through constructor to allow easier mocking #23

Closed sumitsarkar closed 6 years ago

sumitsarkar commented 6 years ago

What's this PR for?

Fixes #22

This PR is to enable constructor injection of the DB related dependencies. This will allow us to easily mock the injected dependency and then test the scraper implementation.

What to emphasize on when reviewing?

codecov-io commented 6 years ago

Codecov Report

Merging #23 into master will increase coverage by 0.01%. The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #23      +/-   ##
===========================================
+ Coverage       2.2%   2.21%   +0.01%     
  Complexity        7       7              
===========================================
  Files            19      20       +1     
  Lines          1771    1759      -12     
  Branches        389     389              
===========================================
  Hits             39      39              
+ Misses         1723    1711      -12     
  Partials          9       9
Impacted Files Coverage Δ Complexity Δ
...eops/tauro/cli/scraper/basicauth/DLinkScraper.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:
.../tauro/cli/authtrial/threads/DefaultAuthTrial.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:
...ro/cli/scraper/basicauth/NewIBallBatonScraper.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:
...s/tauro/cli/scraper/basicauth/DigiflipScraper.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:
...ops/tauro/cli/scraper/AbstractScraperAndSaver.java 0% <0%> (ø) 0 <0> (?)
...uro/cli/scraper/basicauth/IBallWrx300NScraper.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:
...ain/java/org/koreops/tauro/cli/dao/UpdaterDao.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:
src/main/java/org/koreops/tauro/cli/TauroMain.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:
...ops/tauro/cli/scraper/formauth/ActBeamScraper.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:
...ops/tauro/cli/scraper/basicauth/TpLinkScraper.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:
... and 6 more

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 5adce8c...6f470aa. Read the comment docs.

katsadim commented 6 years ago

A small suggestion here: https://github.com/k0r0pt/Project-Tauro/pull/21#issuecomment-433186765