DateTimeTools { public static String convertDateToString(Date convertDate) { return convertDateToString(convertDate, getDateFormatString()); } private  DateTimeTools(); static String getDateFormatString(); static String getDateFormatLongString(); static SimpleDateFormat getDateFormat(); static SimpleDateFormat getDateFormatLong(); static String convertDateToString(Date convertDate); static String convertDateToString(DateTime convertDate); static String convertDateToString(Date convertDate, final String dateFormat); static String convertDateToString(DateTime convertDate, final String dateFormat); static String formatDuration(int duration); static int processRuntime(final String runtime); static String parseDateToString(String dateToParse); static Date parseStringToDate(final String dateToParse); static int extractYear(String date);  }
@Test public void testConvertDateToString_Date() { LOG.info("convertDateToString"); Date convertDate = new Date(0); String result = DateTimeTools.convertDateToString(convertDate); assertEquals("1970-01-01", result); }
@Test public void testConvertDateToString_DateTime() { LOG.info("convertDateToString"); DateTime convertDate = new DateTime(0); String result = DateTimeTools.convertDateToString(convertDate); assertEquals("1970-01-01", result); }
@Test public void testConvertDateToString_Date_String() { LOG.info("convertDateToString"); Date convertDate = new Date(0); String dateFormat = "dd/MM/yyyy"; String expResult = "01/01/1970"; String result = DateTimeTools.convertDateToString(convertDate, dateFormat); assertEquals(expResult, result); }
@Test public void testConvertDateToString_DateTime_String() { LOG.info("convertDateToString"); DateTime convertDate = new DateTime(0); String dateFormat = "dd/MM/yyyy"; String expResult = "01/01/1970"; String result = DateTimeTools.convertDateToString(convertDate, dateFormat); assertEquals(expResult, result); }