title: Android plain Junit with Dagger 2
body: <p>I used to work in MVP and I usually test my presenters using a plain Junit (Not the Instrumentation !) , since Presenters only have the business logic and no references to Android internals whatsoever.</p>
  
  <p>Now by switching to Dagger 2 , I understood that I have a problem setting up a "TestModule" for my app component.</p>
  
  <ol>
  <li>Creating a component will not work from within a test class (probably because "apt" is not running there)</li>
  <li>Didn't find any examples for using Dagger with a standard Junit testing. Every example I have found only relies on Instrumentation testing or Roboelectric (which basically mocks Activities and other Android related stuff) , but this is just a UI testing for me , and I don't need that.</li>
  </ol>
  
  <p>Just to make things clear , I am talking about the tests that are located at app->src->test folder not the app->src->androidTest !</p>
  
  <p>So do I do something wrong ? Or missing something ? Can anyone explain or give examples on how to use Dagger 2 in normal unit tests ?</p>