File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/test/java/org/apache/maven/archiver Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1436,4 +1436,24 @@ void testThrownParseOutputTimestampInstant(String outputTimestamp) {
14361436 void testShortOffset (String value , long expected ) {
14371437 assertThat (parseBuildOutputTimestamp (value )).contains (Instant .ofEpochSecond (expected ));
14381438 }
1439+
1440+ private void testJar (String name , String timestamp ) throws Exception {
1441+ File jarFile = new File ("target/test/dummy-" + name + ".jar" );
1442+ JarArchiver jarArchiver = getCleanJarArchiver (jarFile );
1443+
1444+ MavenArchiver archiver = getMavenArchiver (jarArchiver );
1445+ archiver .configureReproducibleBuild (timestamp );
1446+
1447+ MavenSession session = getDummySession ();
1448+ MavenProject project = getDummyProject ();
1449+
1450+ archiver .createArchive (session , project , new MavenArchiveConfiguration ());
1451+ assertThat (jarFile ).exists ();
1452+ }
1453+
1454+ @ Test
1455+ void testJar () throws Exception {
1456+ testJar ("1970" , "10" );
1457+ testJar ("2000" , "2000-01-01T00:00:00Z" );
1458+ }
14391459}
You can’t perform that action at this time.
0 commit comments