@Test
public void test() throws UnparsableDateFormatException {

    assertEquals(new Long(1483228800000L), DateUtils.parseDateAsTimestamp("2017-01-01"));
    assertEquals(new Long(1483228800000L), DateUtils.parseDateAsTimestamp("2017-01-01 00:00"));
    assertEquals(new Long(1483228800000L), DateUtils.parseDateAsTimestamp("01/01/2017"));
    assertEquals(new Long(1483228800000L), DateUtils.parseDateAsTimestamp("01/01/2017 00:00"));
    assertEquals(new Long(1483228800000L), DateUtils.parseDateAsTimestamp("1483228800000"));
    boolean exception = false;
    try {
        assertEquals(new Long(1483228800000L), DateUtils.parseDateAsTimestamp("mouaiccool"));
    } catch (UnparsableDateFormatException e) {
        exception = true;
    }
    assertTrue(exception);
    exception = false;
    try {
        assertEquals(new Long(1483228800000L), DateUtils.parseDateAsTimestamp(""));
    } catch (UnparsableDateFormatException e) {
        exception = true;
    }
    assertTrue(exception);
    exception = false;
    try {
        assertEquals(new Long(1483228800000L), DateUtils.parseDateAsTimestamp(null));
    } catch (UnparsableDateFormatException e) {
        exception = true;
    }
    assertTrue(exception);
}