WorldpayCommand { protected MerchantInfo getMerchantInfo(final String worldpayOrderCode) throws WorldpayConfigurationException { final PaymentTransactionModel paymentTransactionModel = worldpayPaymentTransactionService.getPaymentTransactionFromCode(worldpayOrderCode); return worldpayMerchantInfoService.getMerchantInfoFromTransaction(paymentTransactionModel); } WorldpayCommand(final WorldpayMerchantInfoService worldpayMerchantInfoService, final WorldpayPaymentTransactionService worldpayPaymentTransactionService, final WorldpayOrderService worldpayOrderService, final WorldpayServiceGateway worldpayServiceGateway); WorldpayMerchantInfoService getWorldpayMerchantInfoService(); WorldpayPaymentTransactionService getWorldpayPaymentTransactionService(); WorldpayOrderService getWorldpayOrderService(); WorldpayServiceGateway getWorldpayServiceGateway();  }
@Test public void shouldReturnKnownMerchantInfo() throws WorldpayConfigurationException { when(worldpayPaymentTransactionServiceMock.getPaymentTransactionFromCode(ORDER_CODE)).thenReturn(paymentTransactionModelMock); when(worldpayMerchantInfoServiceMock.getMerchantInfoFromTransaction(paymentTransactionModelMock)).thenReturn(merchantInfoMock); final MerchantInfo result = testObj.getMerchantInfo(ORDER_CODE); assertEquals(merchantInfoMock, result); }