title: How do I mock external method call with Mockito
body: <p>paymentBusinessService class is avaiable in BusinessService class dependency injection. The Application sc = Applicaition.applicationValidation(this.deal); suppose to be<br>
  Application sc = BusinessService.applicationValidation(this.deal); </p>
  
  <pre><code>package com.core.business.service.dp.fulfillment;
  import com.core.business.service.dp.payment.PaymentBusinessService;
  
  public class BusinessServiceImpl implements BusinessService { // Actual Impl Class
  
  private PaymentBusinessService paymentBusinessService = PluginSystem.INSTANCE.getPluginInjector().getInstance(PaymentBusinessService.class);  
  
  @Transactional( rollbackOn = Throwable.class)
  public Application  applicationValidation (final Deal deal) throws BasePersistenceException {
      Application application = (Application) ApplicationDTOFactory.eINSTANCE.createApplication();
      //External Call we want to Mock
      String report = paymentBusinessService.checkForCreditCardReport(deal.getId());  
      if (report != null) {          
          application.settingSomething(true);
      }
      return application;
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>@Test(enabled = true)// Test Class
  public void testReCalculatePrepaids() throws Exception {
  PaymentBusinessService paymentBusinessService = mock(PaymentBusinessService.class);
  //Mocking External Call
  when(paymentBusinessService.checkForCreditCardReport(this.deal.getId())).thenReturn(new String("Decline by only Me"));
  String report = paymentBusinessService.checkForCreditCardReport(this.deal.getId());
  //Calling Impl Class whose one external call is mocked
  Application sc = BusinessService.applicationValidation(this.deal);  
  </code></pre>
  
  <p>}</p>