@Test public void formatDate_should_return_empty_string_when_date_is_null() { final String formattedDate = cut.formatDate(null); assertThat(formattedDate).isEmpty(); }
String formatDate(Date date) { if (date == null) { return StringUtils.EMPTY; } return new SimpleDateFormat("MMM d, yyyy - HH:mm", Locale.US).format(date); }
QualityEmailService { String formatDate(Date date) { if (date == null) { return StringUtils.EMPTY; } return new SimpleDateFormat("MMM d, yyyy - HH:mm", Locale.US).format(date); } }
QualityEmailService { String formatDate(Date date) { if (date == null) { return StringUtils.EMPTY; } return new SimpleDateFormat("MMM d, yyyy - HH:mm", Locale.US).format(date); }  }
QualityEmailService { String formatDate(Date date) { if (date == null) { return StringUtils.EMPTY; } return new SimpleDateFormat("MMM d, yyyy - HH:mm", Locale.US).format(date); }  @Transactional(readOnly = true, noRollbackFor = Exception.class) void sendQualityEmail(long projectId, long executionId); }
QualityEmailService { String formatDate(Date date) { if (date == null) { return StringUtils.EMPTY; } return new SimpleDateFormat("MMM d, yyyy - HH:mm", Locale.US).format(date); }  @Transactional(readOnly = true, noRollbackFor = Exception.class) void sendQualityEmail(long projectId, long executionId);  }