blob: 2651a64d058834a20860f6ad32326a66e8ca764f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package se.leap.bitmaskclient.base.utils;
import static org.junit.Assert.*;
import org.junit.Test;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class DateHelperTest {
@Test
public void getFormattedDateWithTimezone() {
Pattern datePattern = Pattern.compile("^10 Nov 22 [1]?[0-9]:26 [+-][0-9]{4}$");
String formattedDate = DateHelper.getFormattedDateWithTimezone(1668075969744L);
Matcher matcher = datePattern.matcher(formattedDate);
System.out.println(formattedDate);
assertTrue("date should be formatted similar to 10 Nov 22 11:26 +0100", matcher.find());
}
}
|