summaryrefslogtreecommitdiff
path: root/app/src/test/java/se/leap/bitmaskclient/base/utils/DateHelperTest.java
blob: 3d38cb8a0e516169e13c8c30f22aa9e866fb805e (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 11: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());
    }
}