Skip to content

Injecting DAO service through constructor to allow easier mocking#23

Merged
sudiptosarkar merged 2 commits into
k0r0pt:masterfrom
sumitsarkar:master
Nov 2, 2018
Merged

Injecting DAO service through constructor to allow easier mocking#23
sudiptosarkar merged 2 commits into
k0r0pt:masterfrom
sumitsarkar:master

Conversation

@sumitsarkar

@sumitsarkar sumitsarkar commented Oct 24, 2018

Copy link
Copy Markdown
Collaborator

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?

  • Constructor injections.
  • The new abstract class to separate the notion of scraper and one that "scrapes and saves the data" ( Not sure if this one is actually required. Might be an overkill )

@sumitsarkar sumitsarkar changed the title #22 Injecting DAO service through constructor to allow easier mock… Injecting DAO service through constructor to allow easier mocking Oct 24, 2018
@sumitsarkar sumitsarkar changed the title Injecting DAO service through constructor to allow easier mocking Fixes#22 Injecting DAO service through constructor to allow easier mocking Oct 24, 2018
@sumitsarkar sumitsarkar changed the title Fixes#22 Injecting DAO service through constructor to allow easier mocking Fixes #22 Injecting DAO service through constructor to allow easier mocking Oct 24, 2018
@sumitsarkar sumitsarkar changed the title Fixes #22 Injecting DAO service through constructor to allow easier mocking Injecting DAO service through constructor to allow easier mocking Oct 24, 2018
@codecov-io

codecov-io commented Oct 24, 2018

Copy link
Copy Markdown

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> (ø) ⬇️
.../tauro/cli/authtrial/threads/DefaultAuthTrial.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ro/cli/scraper/basicauth/NewIBallBatonScraper.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...s/tauro/cli/scraper/basicauth/DigiflipScraper.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ops/tauro/cli/scraper/AbstractScraperAndSaver.java 0% <0%> (ø) 0 <0> (?)
...uro/cli/scraper/basicauth/IBallWrx300NScraper.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ain/java/org/koreops/tauro/cli/dao/UpdaterDao.java 0% <0%> (ø) 0 <0> (ø) ⬇️
src/main/java/org/koreops/tauro/cli/TauroMain.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ops/tauro/cli/scraper/formauth/ActBeamScraper.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ops/tauro/cli/scraper/basicauth/TpLinkScraper.java 0% <0%> (ø) 0 <0> (ø) ⬇️
... 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

Copy link
Copy Markdown

A small suggestion here: #21 (comment)

Comment thread src/main/java/org/koreops/tauro/cli/scraper/AbstractScrapperAndSaver.java Outdated
@sudiptosarkar
sudiptosarkar merged commit 79df13b into k0r0pt:master Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants