title: How to test remote android aidl service
body: <p>I have a small app that interacts with a remote <code>android</code> service. I would like to mock that service in unit tests. I use <a href="http://robolectric.org/">Robolectric</a> and <code>JUnit</code> for other test cases and shadows but I could not figure how to deal with remote services. </p>
  
  <p>Is it sufficient to create and start a test service using the same package with the real service and export methods using same <code>aidl</code>? </p>
  
  <p>Since I don't have the code for that service, I assume that I can not use <code>Robolectric</code>'s <a href="http://robolectric.org/javadoc/3.0/org/robolectric/shadows/ShadowService.html">ShadowService</a> which requires actual class to be there.</p>
  
  <p>Thanks a lot.</p>