title: How to write Unit Test cases for mule custom transformer
body: <p>We were trying to write Junit test-cases for custom transformers in Mule.
  But we were not able to call the doTransform() method in test class.</p>
  
  <p>Later we realised seeing mule docs that Mule gives features for Unit test cases.
  And as per the document we have extended <code>AbstractTransformerTestCase</code> which has some methods to be implemented.</p>
  
  <p>they are :</p>
  
  <pre><code>@Override
      public Transformer getTransformer() throws Exception {
          // TODO Auto-generated method stub
          return null;
      }
  
      @Override
      public Transformer getRoundTripTransformer() throws Exception {
          // TODO Auto-generated method stub
          return null;
      }
  
      @Override
      public Object getTestData() {
          // TODO Auto-generated method stub
          return null;
      }
  
      @Override
      public Object getResultData() {
          // TODO Auto-generated method stub
          return null;
      }
  </code></pre>
  
  <p>We are now confused about following things:</p>
  
  <ol>
  <li>Where to write our testing logic?</li>
  <li>Where &amp; how to Send the input to the Transformer?</li>
  <li>What are we returning from the transformer ? </li>
  <li>What if we are not returning anything from the transformer (transformer being the last end point in the flow) ?</li>
  <li>How to "Invoke" the Test cases?</li>
  <li>How to write test cases where a custom Exception is expected ?</li>
  <li>In Junit testing inside eclipse we used to declare it as  <code>@Test(expected = RuntimeException.class)</code> but how to do it here in mule unit test cases?</li>
  <li>How can we use existing 'to be overridden methods' inside <code>AbstractTransformerTestCase</code> ??</li>
  </ol>
  
  <p>Please help us out. We are not understanding anything since 2 weeks what to do.</p>