title: Mock JmsTemplate for integration testing
body: <p>Need to mock JmsTemplate for integration testing in my application.</p>
  
  <p>In my appcontext.xml</p>
  
  <pre><code>&lt;bean id="core_connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
          &lt;property name="jndiTemplate"&gt;
              &lt;ref bean="core_jndiTemplate" /&gt;
          &lt;/property&gt;
          &lt;property name="jndiName"&gt;
              &lt;value&gt;ConnectionFactory&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="core_jmsTemplate" class="org.springframework.jms.core.JmsTemplate"&gt;
          &lt;property name="connectionFactory" ref="core_connectionFactory" /&gt;
          &lt;property name="defaultDestination" ref="core_destination" /&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="core_destination" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
          &lt;property name="jndiTemplate"&gt;
              &lt;ref bean="core_jndiTemplate" /&gt;
          &lt;/property&gt;
          &lt;property name="jndiName"&gt;
              &lt;value&gt;queue/CoreQueue&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>need to mock the jmstemplete in my testcontext.xml.
  Thanks in advance.</p>