DefaultWorldpayDDCFacade implements WorldpayDDCFacade { @Override public String createJsonWebTokenForDDC() { final WorldpayMerchantConfigData merchantConfigData = worldpayMerchantConfigDataFacade.getCurrentSiteMerchantConfigData(); return worldpayJsonWebTokenService.createJsonWebTokenForDDC(merchantConfigData); } DefaultWorldpayDDCFacade(final WorldpayJsonWebTokenService worldpayJsonWebTokenService, final WorldpayMerchantConfigDataFacade worldpayMerchantConfigDataFacade); @Override String createJsonWebTokenForDDC(); @Override String getEventOriginDomainForDDC();  }
@Test public void createJsonWebTokenForDDC_ShouldReturnAValidJsonWebToken() { when(worldpayMerchantConfigDataFacadeMock.getCurrentSiteMerchantConfigData()).thenReturn(merchantConfigDataMock); when(worldpayJsonWebTokenServiceMock.createJsonWebTokenForDDC(merchantConfigDataMock)).thenReturn(JWT_VALUE); final String result = testObj.createJsonWebTokenForDDC(); assertThat(result).isEqualTo(JWT_VALUE); }