unit and integration test
<p>I have already some integration tests for java code, I'm wondering if there is any way to detect the source and the target of each integration test, for example if we have two components A and B, when component A calls component B we should have an integration test to test these two components together, and when component B calls component A we should have another integration test, my question is from the test cases code can we decide which component is the caller and which was the callee automatically, by using tool or specific libraries.</p>

<pre><code>public void GetPatientInfo() //testGetPatientInfo() 
{
    ArrayList&lt;PatientInfo&gt; patients = new ArrayList&lt;PatientInfo&gt;(); 
    String pid = "10"; 
    EMRService instance = new EMRService();
    instance.setPatients(patients); 
    PatientInfo p=new PatientInfo( "10", "ali", 120, 200);
    patients.add(p); 
    PatientInfo expResult = p; 
    PatientInfo result = instance.getPatientInfo(pid); 
    assertEquals(expResult, result); 
}
</code></pre>
