1 package org.apache.maven.model.interpolation;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.Date;
23 import java.util.HashMap;
24 import java.util.Map;
25 import java.util.Properties;
26
27 import org.junit.jupiter.api.Test;
28
29 import static org.junit.jupiter.api.Assertions.assertTrue;
30
31 public class MavenBuildTimestampTest
32 {
33 @Test
34 public void testMavenBuildTimestampUsesUTC()
35 {
36 Map<String, String> interpolationProperties = new HashMap<>();
37 interpolationProperties.put( "maven.build.timestamp.format", "yyyyMMdd'T'HHmm'Z'" );
38 MavenBuildTimestamp timestamp = new MavenBuildTimestamp( new Date(), interpolationProperties );
39 String formattedTimestamp = timestamp.formattedTimestamp();
40 assertTrue( formattedTimestamp.endsWith( "Z" ), "We expect the UTC marker at the end of the timestamp." );
41 }
42 }