WorldpayPaymentTransactionTypesAppender implements WorldpaySupportEmailAppender { @Override public String appendContent() { final StringBuilder processedPaymentTransactionTypes = new StringBuilder(); final WorldpayCronJobSupportInformationService worldpayCronJobSupportInformationService = getWorldpayCronJobSupportInformationService(); if (worldpayCronJobSupportInformationService != null) { final Set<PaymentTransactionType> paymentTransactionTypes = worldpayCronJobSupportInformationService.getPaymentTransactionType(); processedPaymentTransactionTypes.append(System.lineSeparator()).append("Payment Transaction Types: ").append(System.lineSeparator()); for (final PaymentTransactionType paymentTransactionType : paymentTransactionTypes) { processedPaymentTransactionTypes.append(ONE_TAB).append(paymentTransactionType.getCode()).append(System.lineSeparator()); } } return processedPaymentTransactionTypes.toString(); }  @Override String appendContent();  }
@Test public void testAppendContent() throws Exception { doReturn(worldpayCronJobSupportInformationServiceMock).when(testObj).getWorldpayCronJobSupportInformationService(); when(worldpayCronJobSupportInformationServiceMock.getPaymentTransactionType()).thenReturn(singleton(AUTHORIZATION)); final String result = testObj.appendContent(); assertTrue(result.contains("Payment Transaction Types:")); assertTrue(result.contains(AUTHORIZATION.getCode())); }