DefaultWorldpayMerchantInfoService implements WorldpayMerchantInfoService { @Override public MerchantInfo getMerchantInfoFromTransaction(final PaymentTransactionModel paymentTransactionModel) throws WorldpayConfigurationException { return getMerchantInfoByCode(paymentTransactionModel.getRequestToken()); }  @Override MerchantInfo getCurrentSiteMerchant(); @Override MerchantInfo getReplenishmentMerchant(); @Override MerchantInfo getMerchantInfoByCode(final String merchantCode); @Override MerchantInfo getMerchantInfoFromTransaction(final PaymentTransactionModel paymentTransactionModel); @Required void setWorldpayMerchantStrategy(final WorldpayMerchantStrategy worldpayMerchantStrategy); void setConfiguredMerchants(final List<WorldpayMerchantConfigData> configuredMerchants); List<WorldpayMerchantConfigData> getConfiguredMerchants();  }
@Test public void testGetMerchantInfoFromTransaction() throws WorldpayConfigurationException { when(paymentTransactionMock.getRequestToken()).thenReturn(MERCHANT_CODE); final MerchantInfo result = testObj.getMerchantInfoFromTransaction(paymentTransactionMock); assertEquals(MERCHANT_CODE, result.getMerchantCode()); }