### Question:
BuildResource extends AuthenticatedResource { protected void validateDates(String bundleStartDateString, String bundleEndDateString) throws DateValidationException { if(StringUtils.isBlank(bundleStartDateString)) { throw new DateValidationException(bundleStartDateString, bundleEndDateString); } if(StringUtils.isBlank(bundleEndDateString)) { throw new DateValidationException(bundleStartDateString, bundleEndDateString); } DateTime startDate = ISODateTimeFormat.date().parseDateTime(bundleStartDateString); DateTime endDate = ISODateTimeFormat.date().parseDateTime(bundleEndDateString); if(startDate.isAfter(endDate)) { throw new DateValidationException(bundleStartDateString, bundleEndDateString); } }  @Path("/{bundleDirectory}/{bundleName}/{email}/{bundleStartDate}/{bundleEndDate}/{predate}/create") @GET @Produces("application/json") Response build(@PathParam("bundleDirectory") String bundleDirectory,
			@PathParam("bundleName") String bundleName,
			@PathParam("email") String email,
			@PathParam("bundleStartDate") String bundleStartDate,
			@PathParam("bundleEndDate") String bundleEndDate,
			@PathParam("predate") String predate); @Path("/{bundleDirectory}/{bundleName}/{email}/{bundleStartDate}/{bundleEndDate}/create") @GET @Produces("application/json") Response build(@PathParam("bundleDirectory") String bundleDirectory,
						  @PathParam("bundleName") String bundleName,
						  @PathParam("email") String email,
						  @PathParam("bundleStartDate") String bundleStartDate,
						  @PathParam("bundleEndDate") String bundleEndDate); @Path("/{id}/list") @GET @Produces("application/json") Response list(@PathParam("id") String id); @Path("/{id}/url") @GET @Produces("application/json") Response url(@PathParam("id") String id); @Autowired void setLoggingService(LoggingService loggingService);  }### Answer:
@Test public void testInvalidDates() { try { buildResource.validateDates("2012-06-26", "2012-06-21"); } catch(DateValidationException e) { assertEquals("Start date: " + "2012-06-26" + " should be before End date: " + "2012-06-21", e.getMessage()); } }
@Test public void testEmptyDates() { try { buildResource.validateDates("2012-06-26", " "); } catch(DateValidationException e) { assertEquals("End date cannot be empty", e.getMessage()); } try { buildResource.validateDates(" ", "2012-06-25"); } catch(DateValidationException e) { assertEquals("Start date cannot be empty", e.getMessage()); } }
@Test public void testValidDates() { try { buildResource.validateDates("2012-06-21", "2012-06-26"); } catch(DateValidationException e) { e.printStackTrace(); } }