DefaultWorldpayMerchantStrategy implements WorldpayMerchantStrategy { @Override public WorldpayMerchantConfigData getMerchant() { final Map<String, WorldpayMerchantConfigData> merchantConfiguration = worldpayMerchantConfigDataService.getMerchantConfiguration(); if (isASMEnabled()) { return merchantConfiguration.get(ASM_MERCHANT); } else { return merchantConfiguration.get(WEB); } }  @Override WorldpayMerchantConfigData getMerchant(); @Override WorldpayMerchantConfigData getReplenishmentMerchant(); @Required void setWorldpayMerchantConfigDataService(final WorldpayMerchantConfigDataService worldpayMerchantConfigDataService); @Required void setAssistedServiceService(final AssistedServiceService assistedServiceService);  }
@Test public void shouldReturnWebMerchant() throws Exception { when(assistedServiceServiceMock.getAsmSession()).thenReturn(null); final WorldpayMerchantConfigData result = testObj.getMerchant(); assertEquals(websiteMerchantConfigDataMock, result); }
@Test public void shouldReturnAsmMerchant() throws Exception { when(assistedServiceServiceMock.getAsmSession()).thenReturn(asmSessionMock); when(assistedServiceServiceMock.getAsmSession().getAgent()).thenReturn(userModelMock); final WorldpayMerchantConfigData result = testObj.getMerchant(); assertEquals(asmMerchantConfigDataMock, result); }