Skip to content

Commit

Permalink
Drop public from junit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
slachiewicz committed Jun 11, 2023
1 parent cabb87f commit 6429741
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,30 @@ class ManifestConfigurationTest {
private ManifestConfiguration manifestConfiguration;

@BeforeEach
public void before() {
void before() {
this.manifestConfiguration = new ManifestConfiguration();
}

@Test
public void XXX() {
void XXX() {
assertThat(manifestConfiguration.getClasspathLayoutType())
.isEqualTo(ManifestConfiguration.CLASSPATH_LAYOUT_TYPE_SIMPLE);
}

@Test
public void getClasspathPrefixShouldReturnPrefixWithSlashesInsteadOfBackSlashes() {
void getClasspathPrefixShouldReturnPrefixWithSlashesInsteadOfBackSlashes() {
manifestConfiguration.setClasspathPrefix("\\lib\\const\\");
assertThat(manifestConfiguration.getClasspathPrefix()).isEqualTo("/lib/const/");
}

@Test
public void getClasspathPrefixShouldReturnPrefixWithTraingSlash() {
void getClasspathPrefixShouldReturnPrefixWithTraingSlash() {
manifestConfiguration.setClasspathPrefix("const");
assertThat(manifestConfiguration.getClasspathPrefix()).isEqualTo("const/");
}

@Test
public void getClasspathPrefixShouldReturnTheTrailingSlash() {
void getClasspathPrefixShouldReturnTheTrailingSlash() {
manifestConfiguration.setClasspathPrefix("const/");
assertThat(manifestConfiguration.getClasspathPrefix()).isEqualTo("const/");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MavenArchiveConfigurationTest {
private MavenArchiveConfiguration archive;

@BeforeEach
public void before() {
void before() {
archive = new MavenArchiveConfiguration();
archive.setManifest(new ManifestConfiguration());
archive.setForced(false);
Expand Down
58 changes: 29 additions & 29 deletions src/test/java/org/apache/maven/archiver/MavenArchiverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private MavenArchiver getMavenArchiver(JarArchiver jarArchiver) {
}

@Test
public void testDashesInClassPath_MSHARED_134()
void testDashesInClassPath_MSHARED_134()
throws IOException, ManifestException, DependencyResolutionRequiredException {
File jarFile = new File("target/test/dummyWithDashes.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
Expand Down Expand Up @@ -346,7 +346,7 @@ public void testDashesInClassPath_MSHARED_134()
}

@Test
public void testDashesInClassPath_MSHARED_182()
void testDashesInClassPath_MSHARED_182()
throws IOException, ManifestException, DependencyResolutionRequiredException {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
Expand Down Expand Up @@ -379,7 +379,7 @@ public void testDashesInClassPath_MSHARED_182()
}

@Test
public void testCarriageReturnInManifestEntry() throws Exception {
void testCarriageReturnInManifestEntry() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand Down Expand Up @@ -409,7 +409,7 @@ public void testCarriageReturnInManifestEntry() throws Exception {
}

@Test
public void testDeprecatedCreateArchiveAPI() throws Exception {
void testDeprecatedCreateArchiveAPI() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand Down Expand Up @@ -439,7 +439,7 @@ public void testDeprecatedCreateArchiveAPI() throws Exception {
}

@Test
public void testMinimalManifestEntries() throws Exception {
void testMinimalManifestEntries() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand All @@ -462,7 +462,7 @@ public void testMinimalManifestEntries() throws Exception {
}

@Test
public void testManifestEntries() throws Exception {
void testManifestEntries() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand Down Expand Up @@ -537,7 +537,7 @@ public void testManifestEntries() throws Exception {
}

@Test
public void testManifestWithInvalidAutomaticModuleNameThrowsOnCreateArchive() throws Exception {
void testManifestWithInvalidAutomaticModuleNameThrowsOnCreateArchive() throws Exception {
File jarFile = new File("target/test/dummy.jar");
JarArchiver jarArchiver = getCleanJarArchiver(jarFile);

Expand All @@ -562,7 +562,7 @@ public void testManifestWithInvalidAutomaticModuleNameThrowsOnCreateArchive() th
* Test to make sure that manifest sections are present in the manifest prior to the archive has been created.
*/
@Test
public void testManifestSections() throws Exception {
void testManifestSections() throws Exception {
MavenArchiver archiver = new MavenArchiver();

MavenSession session = getDummySession();
Expand Down Expand Up @@ -593,7 +593,7 @@ public void testManifestSections() throws Exception {
}

@Test
public void testDefaultClassPathValue() throws Exception {
void testDefaultClassPathValue() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProject();
File jarFile = new File("target/test/dummy.jar");
Expand Down Expand Up @@ -626,7 +626,7 @@ private void deleteAndAssertNotPresent(File jarFile) {
}

@Test
public void testDefaultClassPathValue_WithSnapshot() throws Exception {
void testDefaultClassPathValue_WithSnapshot() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProjectWithSnapshot();
File jarFile = new File("target/test/dummy.jar");
Expand Down Expand Up @@ -655,7 +655,7 @@ public void testDefaultClassPathValue_WithSnapshot() throws Exception {
}

@Test
public void testMavenRepoClassPathValue() throws Exception {
void testMavenRepoClassPathValue() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProject();
File jarFile = new File("target/test/dummy.jar");
Expand Down Expand Up @@ -692,7 +692,7 @@ public void testMavenRepoClassPathValue() throws Exception {
}

@Test
public void shouldCreateArchiveWithSimpleClassPathLayoutWhileSettingSimpleLayoutExplicit() throws Exception {
void shouldCreateArchiveWithSimpleClassPathLayoutWhileSettingSimpleLayoutExplicit() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProject();
File jarFile = new File("target/test/dummy-explicit-simple.jar");
Expand Down Expand Up @@ -724,7 +724,7 @@ public void shouldCreateArchiveWithSimpleClassPathLayoutWhileSettingSimpleLayout
}

@Test
public void shouldCreateArchiveCustomerLayoutSimple() throws Exception {
void shouldCreateArchiveCustomerLayoutSimple() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProject();
File jarFile = new File("target/test/dummy-custom-layout-simple.jar");
Expand Down Expand Up @@ -757,7 +757,7 @@ public void shouldCreateArchiveCustomerLayoutSimple() throws Exception {
}

@Test
public void shouldCreateArchiveCustomLayoutSimpleNonUnique() throws Exception {
void shouldCreateArchiveCustomLayoutSimpleNonUnique() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProject();
File jarFile = new File("target/test/dummy-custom-layout-simple-non-unique.jar");
Expand Down Expand Up @@ -791,7 +791,7 @@ public void shouldCreateArchiveCustomLayoutSimpleNonUnique() throws Exception {
}

@Test
public void shouldCreateArchiveCustomLayoutRepository() throws Exception {
void shouldCreateArchiveCustomLayoutRepository() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProject();
File jarFile = new File("target/test/dummy-custom-layout-repo.jar");
Expand Down Expand Up @@ -831,7 +831,7 @@ public void shouldCreateArchiveCustomLayoutRepository() throws Exception {
}

@Test
public void shouldCreateArchiveCustomLayoutRepositoryNonUnique() throws Exception {
void shouldCreateArchiveCustomLayoutRepositoryNonUnique() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProject();
File jarFile = new File("target/test/dummy-custom-layout-repo-non-unique.jar");
Expand Down Expand Up @@ -871,7 +871,7 @@ public void shouldCreateArchiveCustomLayoutRepositoryNonUnique() throws Exceptio
}

@Test
public void shouldCreateArchiveWithSimpleClassPathLayoutUsingDefaults() throws Exception {
void shouldCreateArchiveWithSimpleClassPathLayoutUsingDefaults() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProject();
File jarFile = new File("target/test/dummy-defaults.jar");
Expand Down Expand Up @@ -901,7 +901,7 @@ public void shouldCreateArchiveWithSimpleClassPathLayoutUsingDefaults() throws E
}

@Test
public void testMavenRepoClassPathValue_WithSnapshot() throws Exception {
void testMavenRepoClassPathValue_WithSnapshot() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProjectWithSnapshot();
File jarFile = new File("target/test/dummy.jar");
Expand Down Expand Up @@ -938,7 +938,7 @@ public void testMavenRepoClassPathValue_WithSnapshot() throws Exception {
}

@Test
public void testCustomClassPathValue() throws Exception {
void testCustomClassPathValue() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProject();
File jarFile = new File("target/test/dummy.jar");
Expand Down Expand Up @@ -978,7 +978,7 @@ public void testCustomClassPathValue() throws Exception {
}

@Test
public void testCustomClassPathValue_WithSnapshotResolvedVersion() throws Exception {
void testCustomClassPathValue_WithSnapshotResolvedVersion() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProjectWithSnapshot();
File jarFile = new File("target/test/dummy.jar");
Expand Down Expand Up @@ -1017,7 +1017,7 @@ public void testCustomClassPathValue_WithSnapshotResolvedVersion() throws Except
}

@Test
public void testCustomClassPathValue_WithSnapshotForcingBaseVersion() throws Exception {
void testCustomClassPathValue_WithSnapshotForcingBaseVersion() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProjectWithSnapshot();
File jarFile = new File("target/test/dummy.jar");
Expand Down Expand Up @@ -1054,7 +1054,7 @@ public void testCustomClassPathValue_WithSnapshotForcingBaseVersion() throws Exc
}

@Test
public void testDefaultPomProperties() throws Exception {
void testDefaultPomProperties() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProject();
File jarFile = new File("target/test/dummy.jar");
Expand Down Expand Up @@ -1088,7 +1088,7 @@ public void testDefaultPomProperties() throws Exception {
}

@Test
public void testCustomPomProperties() throws Exception {
void testCustomPomProperties() throws Exception {
MavenSession session = getDummySession();
MavenProject project = getDummyProject();
File jarFile = new File("target/test/dummy.jar");
Expand Down Expand Up @@ -1356,7 +1356,7 @@ public Manifest getJarFileManifest(File jarFile) throws IOException {
}

@Test
public void testParseOutputTimestamp() {
void testParseOutputTimestamp() {
MavenArchiver archiver = new MavenArchiver();

assertThat(archiver.parseOutputTimestamp(null)).isNull();
Expand Down Expand Up @@ -1393,7 +1393,7 @@ public void testParseOutputTimestamp() {
@ParameterizedTest
@NullAndEmptySource
@ValueSource(strings = {".", " ", "_", "-", "T", "/", "!", "!", "*", "ñ"})
public void testEmptyParseOutputTimestampInstant(String value) {
void testEmptyParseOutputTimestampInstant(String value) {
// Empty optional if null or 1 char
assertThat(MavenArchiver.parseBuildOutputTimestamp(value)).isEmpty();
}
Expand All @@ -1413,7 +1413,7 @@ public void testEmptyParseOutputTimestampInstant(String value) {
"1980-01-01T00:00:02Z,315532802",
"2099-12-31T23:59:59Z,4102444799"
})
public void testParseOutputTimestampInstant(String value, long expected) {
void testParseOutputTimestampInstant(String value, long expected) {
assertThat(MavenArchiver.parseBuildOutputTimestamp(value)).contains(Instant.ofEpochSecond(expected));
}

Expand All @@ -1428,7 +1428,7 @@ public void testParseOutputTimestampInstant(String value, long expected) {
"Tue, 3 Jun 2008 11:05:30 GMT",
"2011-12-03T10:15:30+01:00[Europe/Paris]"
})
public void testThrownParseOutputTimestampInstant(String outputTimestamp) {
void testThrownParseOutputTimestampInstant(String outputTimestamp) {
// Invalid parsing
assertThatExceptionOfType(IllegalArgumentException.class)
.isThrownBy(() -> MavenArchiver.parseBuildOutputTimestamp(outputTimestamp))
Expand All @@ -1445,7 +1445,7 @@ public void testThrownParseOutputTimestampInstant(String outputTimestamp) {
"1980-01-01T00:15:35+01:00",
"1980-01-01T10:15:35+14:00"
})
public void testThrownParseOutputTimestampInvalidRange(String outputTimestamp) {
void testThrownParseOutputTimestampInvalidRange(String outputTimestamp) {
// date is not within the valid range 1980-01-01T00:00:02Z to 2099-12-31T23:59:59Z
assertThatExceptionOfType(IllegalArgumentException.class)
.isThrownBy(() -> MavenArchiver.parseBuildOutputTimestamp(outputTimestamp))
Expand All @@ -1460,7 +1460,7 @@ public void testThrownParseOutputTimestampInvalidRange(String outputTimestamp) {
"1988-02-22T20:37:42+06,572539062"
})
@EnabledForJreRange(min = JRE.JAVA_9)
public void testShortOffset(String value, long expected) {
void testShortOffset(String value, long expected) {
assertThat(MavenArchiver.parseBuildOutputTimestamp(value)).contains(Instant.ofEpochSecond(expected));
}
}

0 comments on commit 6429741

Please sign in to comment.