This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-assembly-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 6d39303e Cleanup tests (#1285)
6d39303e is described below
commit 6d39303e330009baf44c26f51e0fd8d2262f240e
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Sun Dec 21 17:30:43 2025 +0100
Cleanup tests (#1285)
Co-authored-by: Moderne <[email protected]>
---
pom.xml | 6 -
.../archive/DefaultAssemblyArchiverTest.java | 18 +--
.../archive/ManifestCreationFinalizerTest.java | 10 +-
.../archiver/AssemblyProxyArchiverTest.java | 36 ++---
.../phase/AssemblyArchiverPhaseComparatorTest.java | 4 +-
.../phase/DependencySetAssemblyPhaseTest.java | 15 +--
.../archive/phase/FileItemAssemblyPhaseTest.java | 14 +-
.../archive/phase/FileSetAssemblyPhaseTest.java | 8 +-
.../archive/phase/ModuleSetAssemblyPhaseTest.java | 53 ++++----
.../assembly/archive/task/AddArtifactTaskTest.java | 16 +--
.../archive/task/AddDependencySetsTaskTest.java | 28 ++--
.../archive/task/AddDirectoryTaskTest.java | 12 +-
.../assembly/archive/task/AddFileSetsTaskTest.java | 20 +--
.../artifact/DefaultDependencyResolverTest.java | 10 +-
.../artifact/ResolutionManagementInfoTest.java | 6 +-
.../ComponentsXmlArchiverFileFilterTest.java | 18 +--
.../assembly/format/ReaderFormatterTest.java | 31 +++--
.../AssemblyExpressionEvaluatorTest.java | 14 +-
.../interpolation/AssemblyInterpolatorTest.java | 28 ++--
.../assembly/io/DefaultAssemblyReaderTest.java | 49 ++++---
.../io/PrefixedClasspathLocatorStrategyTest.java | 10 +-
.../assembly/utils/AssemblyFormatUtilsTest.java | 148 ++++++++++-----------
.../plugins/assembly/utils/FilterUtilsTest.java | 91 ++++++-------
.../assembly/utils/LineEndingsUtilsTest.java | 50 +++----
.../utils/LinuxLineFeedInputStreamTest.java | 16 +--
.../plugins/assembly/utils/ProjectUtilsTest.java | 15 +--
.../assembly/utils/TypeConversionUtilsTest.java | 14 +-
.../utils/WindowsLineFeedInputStreamTest.java | 16 +--
28 files changed, 360 insertions(+), 396 deletions(-)
diff --git a/pom.xml b/pom.xml
index 6120864f..8ad076ff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -213,12 +213,6 @@ under the License.
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
</dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest</artifactId>
- <version>3.0</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/archive/DefaultAssemblyArchiverTest.java
b/src/test/java/org/apache/maven/plugins/assembly/archive/DefaultAssemblyArchiverTest.java
index 5dfdaaca..ee4c0da7 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/archive/DefaultAssemblyArchiverTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/archive/DefaultAssemblyArchiverTest.java
@@ -94,14 +94,14 @@ public class DefaultAssemblyArchiverTest {
}
@BeforeEach
- public void setup() throws PlexusContainerException {
+ void setup() throws PlexusContainerException {
this.archiverManager = mock(ArchiverManager.class);
this.container = new DefaultPlexusContainer();
this.configurator = new BasicComponentConfigurator();
}
@Test
- public void failWhenAssemblyIdIsNull() throws Exception {
+ void failWhenAssemblyIdIsNull() throws Exception {
assertThrows(InvalidAssemblerConfigurationException.class, () -> {
final DefaultAssemblyArchiver archiver =
createSubject(Collections.emptyList());
archiver.createArchive(new Assembly(), "full-name", "zip", null,
null);
@@ -109,7 +109,7 @@ public class DefaultAssemblyArchiverTest {
}
@Test
- public void testCreateArchive() throws Exception {
+ void createArchive() throws Exception {
Archiver archiver = mock(Archiver.class);
when(archiverManager.getArchiver("zip")).thenReturn(archiver);
@@ -165,7 +165,7 @@ public class DefaultAssemblyArchiverTest {
}
@Test
- public void testCreateArchiverShouldConfigureArchiver() throws Exception {
+ void createArchiverShouldConfigureArchiver() throws Exception {
final TestArchiverWithConfig archiver = new TestArchiverWithConfig();
when(archiverManager.getArchiver("dummy")).thenReturn(archiver);
@@ -201,7 +201,7 @@ public class DefaultAssemblyArchiverTest {
}
@Test
- public void testCreateArchiverShouldCreateTarArchiverWithNoCompression()
throws Exception {
+ void createArchiverShouldCreateTarArchiverWithNoCompression() throws
Exception {
final TestTarArchiver ttArchiver = new TestTarArchiver();
when(archiverManager.getArchiver("tar")).thenReturn(ttArchiver);
@@ -238,7 +238,7 @@ public class DefaultAssemblyArchiverTest {
}
@Test
- public void
testCreateArchiverShouldCreateWarArchiverWitExpectWebXmlSetToFalse() throws
Exception {
+ void createArchiverShouldCreateWarArchiverWitExpectWebXmlSetToFalse()
throws Exception {
final TestWarArchiver twArchiver = new TestWarArchiver();
when(archiverManager.getArchiver("war")).thenReturn(twArchiver);
@@ -278,7 +278,7 @@ public class DefaultAssemblyArchiverTest {
}
@Test
- public void testCreateArchiverShouldCreateZipArchiver() throws Exception {
+ void createArchiverShouldCreateZipArchiver() throws Exception {
final ZipArchiver archiver = new ZipArchiver();
when(archiverManager.getArchiver("zip")).thenReturn(archiver);
@@ -311,7 +311,7 @@ public class DefaultAssemblyArchiverTest {
}
@Test
- public void testCreateTarArchiverShouldNotInitializeCompression() throws
Exception {
+ void createTarArchiverShouldNotInitializeCompression() throws Exception {
final TestTarArchiver archiver = new TestTarArchiver();
when(archiverManager.getArchiver("tar")).thenReturn(archiver);
@@ -333,7 +333,7 @@ public class DefaultAssemblyArchiverTest {
}
@Test
- public void
testCreateTarArchiverInvalidFormatShouldFailWithInvalidCompression() throws
Exception {
+ void createTarArchiverInvalidFormatShouldFailWithInvalidCompression()
throws Exception {
when(archiverManager.getArchiver("tar.ZZZ")).thenThrow(new
NoSuchArchiverException("no archiver"));
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/archive/ManifestCreationFinalizerTest.java
b/src/test/java/org/apache/maven/plugins/assembly/archive/ManifestCreationFinalizerTest.java
index 09826c0a..70863014 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/archive/ManifestCreationFinalizerTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/archive/ManifestCreationFinalizerTest.java
@@ -45,18 +45,18 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class ManifestCreationFinalizerTest {
+class ManifestCreationFinalizerTest {
@TempDir
private File temporaryFolder;
@Test
- public void testShouldDoNothingWhenArchiveConfigIsNull() throws Exception {
+ void shouldDoNothingWhenArchiveConfigIsNull() throws Exception {
new ManifestCreationFinalizer(null, null,
null).finalizeArchiveCreation(null);
}
@Test
- public void testShouldDoNothingWhenArchiverIsNotJarArchiver() throws
Exception {
+ void shouldDoNothingWhenArchiverIsNotJarArchiver() throws Exception {
MavenProject project = new MavenProject(new Model());
MavenArchiveConfiguration config = new MavenArchiveConfiguration();
@@ -64,7 +64,7 @@ public class ManifestCreationFinalizerTest {
}
@Test
- public void testShouldAddManifestWhenArchiverIsJarArchiver() throws
Exception {
+ void shouldAddManifestWhenArchiverIsJarArchiver() throws Exception {
MavenProject project = new MavenProject(new Model());
MavenArchiveConfiguration config = new MavenArchiveConfiguration();
@@ -101,7 +101,7 @@ public class ManifestCreationFinalizerTest {
}
@Test
- public void testShouldAddManifestEntriesWhenArchiverIsJarArchiver() throws
Exception {
+ void shouldAddManifestEntriesWhenArchiverIsJarArchiver() throws Exception {
MavenProject project = new MavenProject(new Model());
MavenArchiveConfiguration config = new MavenArchiveConfiguration();
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/archive/archiver/AssemblyProxyArchiverTest.java
b/src/test/java/org/apache/maven/plugins/assembly/archive/archiver/AssemblyProxyArchiverTest.java
index 28b780a3..032e914e 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/archive/archiver/AssemblyProxyArchiverTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/archive/archiver/AssemblyProxyArchiverTest.java
@@ -28,7 +28,6 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import org.codehaus.plexus.archiver.Archiver;
-import org.codehaus.plexus.archiver.ArchiverException;
import org.codehaus.plexus.archiver.FileSet;
import org.codehaus.plexus.archiver.diags.TrackingArchiver;
import org.codehaus.plexus.archiver.jar.JarArchiver;
@@ -45,8 +44,6 @@ import org.mockito.junit.jupiter.MockitoExtension;
import org.mockito.junit.jupiter.MockitoSettings;
import org.mockito.quality.Strictness;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -56,13 +53,13 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class AssemblyProxyArchiverTest {
+class AssemblyProxyArchiverTest {
@TempDir
private File temporaryFolder;
@Test
@Timeout(value = 5000, unit = TimeUnit.MILLISECONDS)
- public void addFileSetSkipWhenSourceIsAssemblyWorkDir() throws
IOException, ArchiverException {
+ void addFileSetSkipWhenSourceIsAssemblyWorkDir() throws Exception {
final File sources = temporaryFolder;
final File workdir = new File(sources, "workdir");
@@ -82,7 +79,7 @@ public class AssemblyProxyArchiverTest {
@Test
@Timeout(value = 5000, unit = TimeUnit.MILLISECONDS)
- public void addFileSetAddExcludeWhenSourceContainsAssemblyWorkDir() throws
IOException, ArchiverException {
+ void addFileSetAddExcludeWhenSourceContainsAssemblyWorkDir() throws
Exception {
final File sources = temporaryFolder;
final File workdir = new File(sources, "workdir");
@@ -116,7 +113,7 @@ public class AssemblyProxyArchiverTest {
}
@Test
- public void addFileNoPermsCallAcceptFilesOnlyOnce() throws IOException,
ArchiverException {
+ void addFileNoPermsCallAcceptFilesOnlyOnce() throws Exception {
final Archiver delegate = mock(Archiver.class);
final CounterSelector counter = new CounterSelector(true);
@@ -137,7 +134,7 @@ public class AssemblyProxyArchiverTest {
@Test
@SuppressWarnings("deprecation")
- public void addDirectoryNoPermsCallAcceptFilesOnlyOnce() throws
IOException, ArchiverException {
+ void addDirectoryNoPermsCallAcceptFilesOnlyOnce() throws Exception {
final Archiver delegate = new JarArchiver();
final File output = File.createTempFile("junit", null,
temporaryFolder);
@@ -165,7 +162,7 @@ public class AssemblyProxyArchiverTest {
}
@Test
- public void assemblyWorkDir() {
+ void assemblyWorkDir() {
final Archiver delegate = mock(Archiver.class);
final List<FileSelector> selectors = new ArrayList<>();
@@ -181,13 +178,20 @@ public class AssemblyProxyArchiverTest {
ArgumentCaptor<FileSet> delFileSet =
ArgumentCaptor.forClass(FileSet.class);
verify(delegate).addFileSet(delFileSet.capture());
- assertThat(delFileSet.getValue().getDirectory(),
is(fileSet.getDirectory()));
- assertThat(delFileSet.getValue().getExcludes(), is(new String[]
{"module1"}));
- assertThat(delFileSet.getValue().getFileMappers(),
is(fileSet.getFileMappers()));
- assertThat(delFileSet.getValue().getFileSelectors(),
is(fileSet.getFileSelectors()));
- assertThat(delFileSet.getValue().getIncludes(), is(new String[0]));
- assertThat(delFileSet.getValue().getPrefix(), is("prefix/"));
- assertThat(delFileSet.getValue().getStreamTransformer(),
is(fileSet.getStreamTransformer()));
+ assertEquals(delFileSet.getValue().getDirectory(),
fileSet.getDirectory());
+
+ String[] excludes = delFileSet.getValue().getExcludes();
+ assertNotNull(excludes);
+ assertEquals("module1", excludes[0]);
+
+ assertEquals(delFileSet.getValue().getFileMappers(),
fileSet.getFileMappers());
+ assertEquals(delFileSet.getValue().getFileSelectors(),
fileSet.getFileSelectors());
+ String[] includes = delFileSet.getValue().getIncludes();
+ assertNotNull(includes);
+ assertEquals(0, includes.length);
+
+ assertEquals("prefix/", delFileSet.getValue().getPrefix());
+ assertEquals(delFileSet.getValue().getStreamTransformer(),
fileSet.getStreamTransformer());
}
private static final class CounterSelector implements FileSelector {
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/archive/phase/AssemblyArchiverPhaseComparatorTest.java
b/src/test/java/org/apache/maven/plugins/assembly/archive/phase/AssemblyArchiverPhaseComparatorTest.java
index 55cfeac1..8fd1762a 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/archive/phase/AssemblyArchiverPhaseComparatorTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/archive/phase/AssemblyArchiverPhaseComparatorTest.java
@@ -32,10 +32,10 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertSame;
-public class AssemblyArchiverPhaseComparatorTest {
+class AssemblyArchiverPhaseComparatorTest {
@Test
- public void comparatorSortsCorrectly() throws Exception {
+ void comparatorSortsCorrectly() throws Exception {
List<AssemblyArchiverPhase> items = new ArrayList<>();
Unordered2 u2 = new Unordered2();
items.add(u2);
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/archive/phase/DependencySetAssemblyPhaseTest.java
b/src/test/java/org/apache/maven/plugins/assembly/archive/phase/DependencySetAssemblyPhaseTest.java
index 93841a87..ec088589 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/archive/phase/DependencySetAssemblyPhaseTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/archive/phase/DependencySetAssemblyPhaseTest.java
@@ -18,17 +18,12 @@
*/
package org.apache.maven.plugins.assembly.archive.phase;
-import java.io.IOException;
import java.util.Collections;
import java.util.LinkedHashMap;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.Model;
-import
org.apache.maven.plugins.assembly.InvalidAssemblerConfigurationException;
-import org.apache.maven.plugins.assembly.archive.ArchiveCreationException;
-import
org.apache.maven.plugins.assembly.artifact.DependencyResolutionException;
import org.apache.maven.plugins.assembly.artifact.DependencyResolver;
-import org.apache.maven.plugins.assembly.format.AssemblyFormattingException;
import org.apache.maven.plugins.assembly.model.Assembly;
import org.apache.maven.plugins.assembly.model.DependencySet;
import org.apache.maven.project.MavenProject;
@@ -49,22 +44,20 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class DependencySetAssemblyPhaseTest {
+class DependencySetAssemblyPhaseTest {
private DependencySetAssemblyPhase phase;
private DependencyResolver dependencyResolver;
@BeforeEach
- public void setUp() {
+ void setUp() {
this.dependencyResolver = mock(DependencyResolver.class);
this.phase = new
DependencySetAssemblyPhase(mock(ProjectBuilder.class), dependencyResolver);
}
@Test
- public void testExecuteShouldAddOneDependencyFromProject()
- throws AssemblyFormattingException, ArchiveCreationException,
IOException,
- InvalidAssemblerConfigurationException,
DependencyResolutionException {
+ void executeShouldAddOneDependencyFromProject() throws Exception {
final String outputLocation = "/out";
final MavenProject project = newMavenProject("group", "project", "0");
@@ -98,7 +91,7 @@ public class DependencySetAssemblyPhaseTest {
}
@Test
- public void testExecuteShouldNotAddDependenciesWhenProjectHasNone() throws
Exception {
+ void executeShouldNotAddDependenciesWhenProjectHasNone() throws Exception {
final Assembly assembly = new Assembly();
assembly.setId("test");
assembly.setIncludeBaseDirectory(false);
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/archive/phase/FileItemAssemblyPhaseTest.java
b/src/test/java/org/apache/maven/plugins/assembly/archive/phase/FileItemAssemblyPhaseTest.java
index 17b6af51..cc4d8506 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/archive/phase/FileItemAssemblyPhaseTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/archive/phase/FileItemAssemblyPhaseTest.java
@@ -50,14 +50,14 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class FileItemAssemblyPhaseTest {
+class FileItemAssemblyPhaseTest {
private final Logger logger = LoggerFactory.getLogger(getClass());
@TempDir
private File temporaryFolder;
@Test
- public void testExecuteShouldAddNothingWhenNoFileItemsArePresent() throws
Exception {
+ void executeShouldAddNothingWhenNoFileItemsArePresent() throws Exception {
final AssemblerConfigurationSource macCS =
mock(AssemblerConfigurationSource.class);
final File basedir = temporaryFolder;
@@ -73,7 +73,7 @@ public class FileItemAssemblyPhaseTest {
}
@Test
- public void
testExecuteShouldAddAbsoluteFileNoFilterNoLineEndingConversion() throws
Exception {
+ void executeShouldAddAbsoluteFileNoFilterNoLineEndingConversion() throws
Exception {
final AssemblerConfigurationSource macCS =
mock(AssemblerConfigurationSource.class);
final File basedir = temporaryFolder;
@@ -107,7 +107,7 @@ public class FileItemAssemblyPhaseTest {
}
@Test
- public void
testExecuteShouldAddRelativeFileNoFilterNoLineEndingConversion() throws
Exception {
+ void executeShouldAddRelativeFileNoFilterNoLineEndingConversion() throws
Exception {
final AssemblerConfigurationSource macCS =
mock(AssemblerConfigurationSource.class);
final File basedir = temporaryFolder;
@@ -141,7 +141,7 @@ public class FileItemAssemblyPhaseTest {
}
@Test
- public void testExecuteWithOutputDirectory() throws Exception {
+ void executeWithOutputDirectory() throws Exception {
final AssemblerConfigurationSource macCS =
mock(AssemblerConfigurationSource.class);
final File basedir = temporaryFolder;
@@ -220,7 +220,7 @@ public class FileItemAssemblyPhaseTest {
}
@Test
- public void testExecuteWithOutputDirectoryAndDestName() throws Exception {
+ void executeWithOutputDirectoryAndDestName() throws Exception {
final AssemblerConfigurationSource macCS =
mock(AssemblerConfigurationSource.class);
final File basedir = temporaryFolder;
@@ -302,7 +302,7 @@ public class FileItemAssemblyPhaseTest {
}
@Test
- public void
testExecuteWithOutputDirectoryAndDestNameAndIncludeBaseDirectoryFalse() throws
Exception {
+ void executeWithOutputDirectoryAndDestNameAndIncludeBaseDirectoryFalse()
throws Exception {
final AssemblerConfigurationSource macCS =
mock(AssemblerConfigurationSource.class);
final File basedir = temporaryFolder;
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/archive/phase/FileSetAssemblyPhaseTest.java
b/src/test/java/org/apache/maven/plugins/assembly/archive/phase/FileSetAssemblyPhaseTest.java
index 72852a65..421586b2 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/archive/phase/FileSetAssemblyPhaseTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/archive/phase/FileSetAssemblyPhaseTest.java
@@ -39,16 +39,16 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class FileSetAssemblyPhaseTest {
+class FileSetAssemblyPhaseTest {
private FileSetAssemblyPhase phase;
@BeforeEach
- public void setUp() {
+ void setUp() {
this.phase = new FileSetAssemblyPhase();
}
@Test
- public void testShouldNotFailWhenNoFileSetsSpecified() throws Exception {
+ void shouldNotFailWhenNoFileSetsSpecified() throws Exception {
final Assembly assembly = new Assembly();
assembly.setId("test");
@@ -56,7 +56,7 @@ public class FileSetAssemblyPhaseTest {
}
@Test
- public void testShouldAddOneFileSet() throws Exception {
+ void shouldAddOneFileSet() throws Exception {
final Assembly assembly = new Assembly();
assembly.setId("test");
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/archive/phase/ModuleSetAssemblyPhaseTest.java
b/src/test/java/org/apache/maven/plugins/assembly/archive/phase/ModuleSetAssemblyPhaseTest.java
index a702b0e3..01d8c25d 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/archive/phase/ModuleSetAssemblyPhaseTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/archive/phase/ModuleSetAssemblyPhaseTest.java
@@ -70,7 +70,7 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class ModuleSetAssemblyPhaseTest {
+class ModuleSetAssemblyPhaseTest {
private final Logger logger = LoggerFactory.getLogger(getClass());
@TempDir
@@ -81,7 +81,7 @@ public class ModuleSetAssemblyPhaseTest {
private DependencyResolver dependencyResolver;
@BeforeEach
- public void setUp() {
+ void setUp() {
ProjectBuilder projectBuilder = mock(ProjectBuilder.class);
this.dependencyResolver = mock(DependencyResolver.class);
@@ -89,7 +89,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testIsDeprecatedModuleSourcesConfigPresentShouldCatchOutputDir() {
+ void isDeprecatedModuleSourcesConfigPresentShouldCatchOutputDir() {
final ModuleSources sources = new ModuleSources();
sources.setOutputDirectory("outdir");
@@ -97,7 +97,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void testIsDeprecatedModuleSourcesConfigPresentShouldCatchInclude()
{
+ void isDeprecatedModuleSourcesConfigPresentShouldCatchInclude() {
final ModuleSources sources = new ModuleSources();
sources.addInclude("**/included.txt");
@@ -105,7 +105,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void testIsDeprecatedModuleSourcesConfigPresentShouldCatchExclude()
{
+ void isDeprecatedModuleSourcesConfigPresentShouldCatchExclude() {
final ModuleSources sources = new ModuleSources();
sources.addExclude("**/excluded.txt");
@@ -113,7 +113,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testIsDeprecatedModuleSourcesConfigPresentShouldNotCatchFileMode() {
+ void isDeprecatedModuleSourcesConfigPresentShouldNotCatchFileMode() {
final ModuleSources sources = new ModuleSources();
sources.setFileMode("777");
@@ -121,7 +121,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testIsDeprecatedModuleSourcesConfigPresentShouldNotCatchDirMode() {
+ void isDeprecatedModuleSourcesConfigPresentShouldNotCatchDirMode() {
final ModuleSources sources = new ModuleSources();
sources.setDirectoryMode("777");
@@ -129,7 +129,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void testCreateFileSetShouldUseModuleDirOnlyWhenOutDirIsNull()
throws Exception {
+ void createFileSetShouldUseModuleDirOnlyWhenOutDirIsNull() throws
Exception {
final Model model = new Model();
model.setArtifactId("artifact");
@@ -168,7 +168,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void testCreateFileSetShouldPrependModuleDirWhenOutDirIsProvided()
throws Exception {
+ void createFileSetShouldPrependModuleDirWhenOutDirIsProvided() throws
Exception {
final Model model = new Model();
model.setArtifactId("artifact");
@@ -208,7 +208,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testCreateFileSetShouldAddExcludesForSubModulesWhenExcludeSubModDirsIsTrue()
throws Exception {
+ void
createFileSetShouldAddExcludesForSubModulesWhenExcludeSubModDirsIsTrue() throws
Exception {
final AssemblerConfigurationSource configSource =
mock(AssemblerConfigurationSource.class);
final FileSet fs = new FileSet();
@@ -245,7 +245,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void testExecuteShouldSkipIfNoModuleSetsFound() throws Exception {
+ void executeShouldSkipIfNoModuleSetsFound() throws Exception {
final Assembly assembly = new Assembly();
assembly.setIncludeBaseDirectory(false);
@@ -253,7 +253,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void testExecuteShouldAddOneModuleSetWithOneModuleInIt() throws
Exception {
+ void executeShouldAddOneModuleSetWithOneModuleInIt() throws Exception {
final MavenProject project = createProject("group", "artifact",
"version", null);
final MavenProject module = createProject("group", "module",
"version", project);
@@ -313,12 +313,12 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testAddModuleBinariesShouldReturnImmediatelyWhenBinariesIsNull() throws
Exception {
+ void addModuleBinariesShouldReturnImmediatelyWhenBinariesIsNull() throws
Exception {
this.phase.addModuleBinaries(null, null, null, null, null, null);
}
@Test
- public void testAddModuleBinariesShouldFilterPomModule() throws Exception {
+ void addModuleBinariesShouldFilterPomModule() throws Exception {
final ModuleBinaries binaries = new ModuleBinaries();
binaries.setUnpack(false);
@@ -338,7 +338,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testAddModuleBinariesShouldAddOneModuleAttachmentArtifactAndNoDeps() throws
Exception {
+ void addModuleBinariesShouldAddOneModuleAttachmentArtifactAndNoDeps()
throws Exception {
final AssemblerConfigurationSource configSource =
mock(AssemblerConfigurationSource.class);
when(configSource.getFinalName()).thenReturn("final-name");
@@ -389,8 +389,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testAddModuleBinariesShouldFailWhenOneModuleDoesntHaveAttachmentWithMatchingClassifier()
- throws Exception {
+ void
addModuleBinariesShouldFailWhenOneModuleDoesntHaveAttachmentWithMatchingClassifier()
throws Exception {
Artifact artifact = mock(Artifact.class);
final ModuleBinaries binaries = new ModuleBinaries();
@@ -421,7 +420,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void testAddModuleBinariesShouldAddOneModuleArtifactAndNoDeps()
throws Exception {
+ void addModuleBinariesShouldAddOneModuleArtifactAndNoDeps() throws
Exception {
Artifact artifact = mock(Artifact.class);
final File artifactFile = File.createTempFile("junit", null,
temporaryFolder);
when(artifact.getGroupId()).thenReturn("GROUPID");
@@ -472,7 +471,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testAddModuleArtifactShouldThrowExceptionWhenArtifactFileIsNull() throws
Exception {
+ void addModuleArtifactShouldThrowExceptionWhenArtifactFileIsNull() throws
Exception {
Artifact artifact = mock(Artifact.class);
try {
this.phase.addModuleArtifact(artifact, null, null, null, null);
@@ -484,7 +483,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void testAddModuleArtifactShouldAddOneArtifact() throws Exception {
+ void addModuleArtifactShouldAddOneArtifact() throws Exception {
Artifact artifact = mock(Artifact.class);
when(artifact.getGroupId()).thenReturn("GROUPID");
final File artifactFile = File.createTempFile("junit", null,
temporaryFolder);
@@ -524,12 +523,12 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testAddModuleSourceFileSetsShouldReturnImmediatelyIfSourcesIsNull() throws
Exception {
+ void addModuleSourceFileSetsShouldReturnImmediatelyIfSourcesIsNull()
throws Exception {
this.phase.addModuleSourceFileSets(null, null, null, null);
}
@Test
- public void testAddModuleSourceFileSetsShouldAddOneSourceDirectory()
throws Exception {
+ void addModuleSourceFileSetsShouldAddOneSourceDirectory() throws Exception
{
final MavenProject project = createProject("group", "artifact",
"version", null);
final AssemblerConfigurationSource configSource =
mock(AssemblerConfigurationSource.class);
@@ -569,7 +568,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testGetModuleProjectsShouldReturnNothingWhenReactorContainsOnlyCurrentProject()
throws Exception {
+ void
getModuleProjectsShouldReturnNothingWhenReactorContainsOnlyCurrentProject()
throws Exception {
final MavenProject project = createProject("group", "artifact",
"version", null);
final List<MavenProject> projects = Collections.singletonList(project);
@@ -592,7 +591,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testGetModuleProjectsShouldReturnNothingWhenReactorContainsTwoSiblingProjects()
throws Exception {
+ void
getModuleProjectsShouldReturnNothingWhenReactorContainsTwoSiblingProjects()
throws Exception {
final MavenProject project = createProject("group", "artifact",
"version", null);
final MavenProject project2 = createProject("group", "artifact2",
"version", null);
@@ -618,7 +617,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void testGetModuleProjectsShouldReturnModuleOfCurrentProject()
throws Exception {
+ void getModuleProjectsShouldReturnModuleOfCurrentProject() throws
Exception {
final MavenProject project = createProject("group", "artifact",
"version", null);
final MavenProject project2 = createProject("group", "artifact2",
"version", project);
@@ -648,7 +647,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testGetModuleProjectsShouldReturnDescendentModulesOfCurrentProject() throws
Exception {
+ void getModuleProjectsShouldReturnDescendentModulesOfCurrentProject()
throws Exception {
final MavenProject project = createProject("group", "artifact",
"version", null);
final MavenProject project2 = createProject("group", "artifact2",
"version", project);
final MavenProject project3 = createProject("group", "artifact3",
"version", project2);
@@ -682,7 +681,7 @@ public class ModuleSetAssemblyPhaseTest {
}
@Test
- public void
testGetModuleProjectsShouldExcludeModuleAndDescendentsTransitively() throws
Exception {
+ void getModuleProjectsShouldExcludeModuleAndDescendentsTransitively()
throws Exception {
final MavenProject project = createProject("group", "artifact",
"version", null);
Artifact artifact1 = mock(Artifact.class);
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddArtifactTaskTest.java
b/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddArtifactTaskTest.java
index 7a362a66..90b1a362 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddArtifactTaskTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddArtifactTaskTest.java
@@ -52,7 +52,7 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class AddArtifactTaskTest {
+class AddArtifactTaskTest {
private final Logger logger = LoggerFactory.getLogger(getClass());
@TempDir
@@ -63,7 +63,7 @@ public class AddArtifactTaskTest {
private AssemblerConfigurationSource configSource;
@BeforeEach
- public void setUp() throws IOException {
+ void setUp() throws IOException {
Model model = new Model();
model.setGroupId("group");
model.setArtifactId("main");
@@ -76,14 +76,14 @@ public class AddArtifactTaskTest {
}
@AfterEach
- public void tearDown() {
+ void tearDown() {
// result of easymock migration, should be assert of expected result
instead of verifying methodcalls
verify(configSource, atLeastOnce()).getFinalName();
verify(configSource, atLeastOnce()).getMavenSession();
}
@Test
- public void testShouldAddArchiveFileWithoutUnpacking() throws Exception {
+ void shouldAddArchiveFileWithoutUnpacking() throws Exception {
String outputLocation = "artifact";
Artifact artifact = mock(Artifact.class);
@@ -113,7 +113,7 @@ public class AddArtifactTaskTest {
}
@Test
- public void testShouldAddArchiveFileWithDefaultOutputLocation() throws
Exception {
+ void shouldAddArchiveFileWithDefaultOutputLocation() throws Exception {
String artifactId = "myArtifact";
String version = "1";
String ext = "jar";
@@ -168,7 +168,7 @@ public class AddArtifactTaskTest {
}
@Test
- public void testShouldAddArchiveFileWithUnpack() throws Exception {
+ void shouldAddArchiveFileWithUnpack() throws Exception {
final int originalDirMode = -1;
final int originalFileMode = -1;
@@ -195,7 +195,7 @@ public class AddArtifactTaskTest {
}
@Test
- public void testShouldAddArchiveFileWithUnpackAndModes() throws Exception {
+ void shouldAddArchiveFileWithUnpackAndModes() throws Exception {
final int directoryMode = TypeConversionUtils.modeToInt("777", logger);
final int fileMode = TypeConversionUtils.modeToInt("777", logger);
final int originalDirMode = -1;
@@ -230,7 +230,7 @@ public class AddArtifactTaskTest {
}
@Test
- public void testShouldAddArchiveFileWithUnpackIncludesAndExcludes() throws
Exception {
+ void shouldAddArchiveFileWithUnpackIncludesAndExcludes() throws Exception {
final int originalDirMode = -1;
final int originalFileMode = -1;
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTaskTest.java
b/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTaskTest.java
index eccd2d33..e4946c65 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTaskTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTaskTest.java
@@ -55,9 +55,8 @@ import org.mockito.junit.jupiter.MockitoExtension;
import org.mockito.junit.jupiter.MockitoSettings;
import org.mockito.quality.Strictness;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.mockito.ArgumentMatchers.any;
@@ -70,12 +69,12 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class AddDependencySetsTaskTest {
+class AddDependencySetsTaskTest {
@TempDir
private File temporaryFolder;
@Test
- public void
testAddDependencySetShouldInterpolateDefaultOutputFileNameMapping() throws
Exception {
+ void addDependencySetShouldInterpolateDefaultOutputFileNameMapping()
throws Exception {
final String outDir = "tmp/";
final String mainAid = "main";
final String mainGid = "org.maingrp";
@@ -169,7 +168,7 @@ public class AddDependencySetsTaskTest {
}
@Test
- public void
testAddDependencySetShouldNotAddDependenciesWhenProjectHasNone() throws
Exception {
+ void addDependencySetShouldNotAddDependenciesWhenProjectHasNone() throws
Exception {
final MavenProject project = new MavenProject(new Model());
final DependencySet ds = new DependencySet();
@@ -183,7 +182,7 @@ public class AddDependencySetsTaskTest {
// TODO: Find a better way of testing the project-stubbing behavior when a
ProjectBuildingException takes place.
@Test
- public void
testAddDependencySetShouldNotAddDependenciesWhenProjectIsStubbed() throws
Exception {
+ void addDependencySetShouldNotAddDependenciesWhenProjectIsStubbed() throws
Exception {
final MavenProject project = new MavenProject(new Model());
final ProjectBuildingException pbe = new
ProjectBuildingException("test", "Test error.", new Throwable());
@@ -251,12 +250,12 @@ public class AddDependencySetsTaskTest {
}
@Test
- public void
testAddDependencySetShouldAddOneDependencyFromProjectWithoutUnpacking() throws
Exception {
+ void addDependencySetShouldAddOneDependencyFromProjectWithoutUnpacking()
throws Exception {
verifyOneDependencyAdded("out", false);
}
@Test
- public void
testAddDependencySetShouldAddOneDependencyFromProjectUnpacked() throws
Exception {
+ void addDependencySetShouldAddOneDependencyFromProjectUnpacked() throws
Exception {
verifyOneDependencyAdded("out", true);
}
@@ -340,7 +339,7 @@ public class AddDependencySetsTaskTest {
}
@Test
- public void testGetDependencyArtifactsShouldGetOneDependencyArtifact()
throws Exception {
+ void getDependencyArtifactsShouldGetOneDependencyArtifact() throws
Exception {
final MavenProject project = new MavenProject(new Model());
Artifact artifact = mock(Artifact.class);
@@ -359,7 +358,7 @@ public class AddDependencySetsTaskTest {
}
@Test
- public void
testGetDependencyArtifactsShouldFilterOneDependencyArtifactViaInclude() throws
Exception {
+ void getDependencyArtifactsShouldFilterOneDependencyArtifactViaInclude()
throws Exception {
final MavenProject project = new MavenProject(new Model());
final Set<Artifact> artifacts = new HashSet<>();
@@ -390,8 +389,7 @@ public class AddDependencySetsTaskTest {
}
@Test
- public void
testGetDependencyArtifactsShouldIgnoreTransitivePathFilteringWhenIncludeNotTransitive()
- throws Exception {
+ void
getDependencyArtifactsShouldIgnoreTransitivePathFilteringWhenIncludeNotTransitive()
throws Exception {
final MavenProject project = new MavenProject(new Model());
final Set<Artifact> artifacts = new HashSet<>();
@@ -423,7 +421,7 @@ public class AddDependencySetsTaskTest {
// MASSEMBLY-879
@Test
- public void useDefaultExcludes() throws Exception {
+ void useDefaultExcludes() throws Exception {
Artifact zipArtifact = mock(Artifact.class);
when(zipArtifact.getGroupId()).thenReturn("some-artifact");
when(zipArtifact.getArtifactId()).thenReturn("of-type-zip");
@@ -474,11 +472,11 @@ public class AddDependencySetsTaskTest {
ArgumentCaptor<ArchivedFileSet> archivedFileSet =
ArgumentCaptor.forClass(ArchivedFileSet.class);
verify(archiver).addArchivedFileSet(archivedFileSet.capture(),
isNull());
- assertThat(archivedFileSet.getValue().isUsingDefaultExcludes(),
is(false));
+ assertFalse(archivedFileSet.getValue().isUsingDefaultExcludes());
ArgumentCaptor<FileSet> fileSet =
ArgumentCaptor.forClass(FileSet.class);
verify(archiver).addFileSet(fileSet.capture());
- assertThat(fileSet.getValue().isUsingDefaultExcludes(), is(false));
+ assertFalse(fileSet.getValue().isUsingDefaultExcludes());
}
private static File newFile(File parent, String child) throws IOException {
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddDirectoryTaskTest.java
b/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddDirectoryTaskTest.java
index aec61d38..5999201c 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddDirectoryTaskTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddDirectoryTaskTest.java
@@ -38,19 +38,19 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class AddDirectoryTaskTest {
+class AddDirectoryTaskTest {
@TempDir
private File temporaryFolder;
private Archiver archiver;
@BeforeEach
- public void setUp() {
+ void setUp() {
this.archiver = mock(Archiver.class);
}
@Test
- public void testAddDirectoryShouldNotAddDirectoryIfNonExistent() throws
Exception {
+ void addDirectoryShouldNotAddDirectoryIfNonExistent() throws Exception {
final int defaultDirMode = -1;
final int defaultFileMode = -1;
@@ -67,7 +67,7 @@ public class AddDirectoryTaskTest {
}
@Test
- public void testAddDirectoryShouldAddDirectory() throws Exception {
+ void addDirectoryShouldAddDirectory() throws Exception {
final int defaultDirMode = -1;
final int defaultFileMode = -1;
@@ -86,7 +86,7 @@ public class AddDirectoryTaskTest {
}
@Test
- public void testAddDirectoryShouldAddDirectoryWithDirMode() throws
Exception {
+ void addDirectoryShouldAddDirectoryWithDirMode() throws Exception {
final int dirMode = Integer.parseInt("777", 8);
final int fileMode = Integer.parseInt("777", 8);
final int defaultDirMode = -1;
@@ -113,7 +113,7 @@ public class AddDirectoryTaskTest {
}
@Test
- public void testAddDirectoryShouldAddDirectoryWithIncludesAndExcludes()
throws Exception {
+ void addDirectoryShouldAddDirectoryWithIncludesAndExcludes() throws
Exception {
when(archiver.getOverrideDirectoryMode()).thenReturn(-1);
when(archiver.getOverrideFileMode()).thenReturn(-1);
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddFileSetsTaskTest.java
b/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddFileSetsTaskTest.java
index 92156bfa..ac82899f 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddFileSetsTaskTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/archive/task/AddFileSetsTaskTest.java
@@ -47,12 +47,12 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class AddFileSetsTaskTest {
+class AddFileSetsTaskTest {
@TempDir
private File temporaryFolder;
@Test
- public void testGetFileSetDirectoryShouldReturnAbsoluteSourceDir() throws
Exception {
+ void getFileSetDirectoryShouldReturnAbsoluteSourceDir() throws Exception {
final File dir = newFolder(temporaryFolder, "junit");
final FileSet fs = new FileSet();
@@ -65,7 +65,7 @@ public class AddFileSetsTaskTest {
}
@Test
- public void testGetFileSetDirectoryShouldReturnBasedir() throws Exception {
+ void getFileSetDirectoryShouldReturnBasedir() throws Exception {
final File dir = newFolder(temporaryFolder, "junit");
final FileSet fs = new FileSet();
@@ -76,7 +76,7 @@ public class AddFileSetsTaskTest {
}
@Test
- public void
testGetFileSetDirectoryShouldReturnDirFromBasedirAndSourceDir() throws
Exception {
+ void getFileSetDirectoryShouldReturnDirFromBasedirAndSourceDir() throws
Exception {
final File dir = newFolder(temporaryFolder, "junit");
final String srcPath = "source";
@@ -93,7 +93,7 @@ public class AddFileSetsTaskTest {
}
@Test
- public void
testGetFileSetDirectoryShouldReturnDirFromArchiveBasedirAndSourceDir() throws
Exception {
+ void getFileSetDirectoryShouldReturnDirFromArchiveBasedirAndSourceDir()
throws Exception {
final File dir = newFolder(temporaryFolder, "junit");
final String srcPath = "source";
@@ -110,7 +110,7 @@ public class AddFileSetsTaskTest {
}
@Test
- public void testAddFileSetShouldAddDirectory() throws Exception {
+ void addFileSetShouldAddDirectory() throws Exception {
File basedir = temporaryFolder;
final FileSet fs = new FileSet();
@@ -146,7 +146,7 @@ public class AddFileSetsTaskTest {
}
@Test
- public void testAddFileSetShouldAddDirectoryUsingSourceDirNameForDestDir()
throws Exception {
+ void addFileSetShouldAddDirectoryUsingSourceDirNameForDestDir() throws
Exception {
final FileSet fs = new FileSet();
final String dirname = "dir";
fs.setDirectory(dirname);
@@ -183,7 +183,7 @@ public class AddFileSetsTaskTest {
}
@Test
- public void testAddFileSetShouldNotAddDirectoryWhenSourceDirNonExistent()
throws Exception {
+ void addFileSetShouldNotAddDirectoryWhenSourceDirNonExistent() throws
Exception {
final FileSet fs = new FileSet();
fs.setDirectory("dir");
@@ -215,7 +215,7 @@ public class AddFileSetsTaskTest {
}
@Test
- public void
testExecuteShouldThrowExceptionIfArchiveBasedirProvidedIsNonExistent() throws
Exception {
+ void executeShouldThrowExceptionIfArchiveBasedirProvidedIsNonExistent()
throws Exception {
File archiveBaseDir = new File(temporaryFolder, "archive");
final AssemblerConfigurationSource configSource =
mock(AssemblerConfigurationSource.class);
when(configSource.getArchiveBaseDirectory()).thenReturn(archiveBaseDir);
@@ -235,7 +235,7 @@ public class AddFileSetsTaskTest {
}
@Test
- public void
testExecuteShouldThrowExceptionIfArchiveBasedirProvidedIsNotADirectory() throws
Exception {
+ void executeShouldThrowExceptionIfArchiveBasedirProvidedIsNotADirectory()
throws Exception {
File archiveBaseDir = File.createTempFile("junit", null,
temporaryFolder);
final AssemblerConfigurationSource configSource =
mock(AssemblerConfigurationSource.class);
when(configSource.getArchiveBaseDirectory()).thenReturn(archiveBaseDir);
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/artifact/DefaultDependencyResolverTest.java
b/src/test/java/org/apache/maven/plugins/assembly/artifact/DefaultDependencyResolverTest.java
index 1d68808d..8ed0e7d9 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/artifact/DefaultDependencyResolverTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/artifact/DefaultDependencyResolverTest.java
@@ -60,7 +60,7 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class DefaultDependencyResolverTest {
+class DefaultDependencyResolverTest {
@Mock
private ArtifactHandlerManager artifactHandlerManager;
@@ -75,7 +75,7 @@ public class DefaultDependencyResolverTest {
private DefaultDependencyResolver resolver;
@Test
- public void testGetDependencySetResolutionRequirementsTransitive() throws
Exception {
+ void getDependencySetResolutionRequirementsTransitive() throws Exception {
final DependencySet ds = new DependencySet();
ds.setScope(Artifact.SCOPE_SYSTEM);
ds.setUseTransitiveDependencies(true);
@@ -111,7 +111,7 @@ public class DefaultDependencyResolverTest {
}
@Test
- public void testGetDependencySetResolutionRequirementsNonTransitive()
throws DependencyResolutionException {
+ void getDependencySetResolutionRequirementsNonTransitive() throws
Exception {
final DependencySet ds = new DependencySet();
ds.setScope(Artifact.SCOPE_SYSTEM);
ds.setUseTransitiveDependencies(false);
@@ -131,7 +131,7 @@ public class DefaultDependencyResolverTest {
}
@Test
- public void testGetModuleSetResolutionRequirementsWithoutBinaries() throws
DependencyResolutionException {
+ void getModuleSetResolutionRequirementsWithoutBinaries() throws Exception {
final File rootDir = new File("root");
final MavenProject project = createMavenProject("main-group",
"main-artifact", "1", rootDir);
final MavenProject module1 = createMavenProject("main-group",
"module-1", "1", new File(rootDir, "module-1"));
@@ -150,7 +150,7 @@ public class DefaultDependencyResolverTest {
}
@Test
- public void testGetModuleSetResolutionRequirementsIncludeDeps() throws
Exception {
+ void getModuleSetResolutionRequirementsIncludeDeps() throws Exception {
final File rootDir = new File("root");
final MavenProject project = createMavenProject("main-group",
"main-artifact", "1", rootDir);
final MavenProject module1 = createMavenProject("main-group",
"module-1", "1", new File(rootDir, "module-1"));
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/artifact/ResolutionManagementInfoTest.java
b/src/test/java/org/apache/maven/plugins/assembly/artifact/ResolutionManagementInfoTest.java
index 26e9c10a..badba990 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/artifact/ResolutionManagementInfoTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/artifact/ResolutionManagementInfoTest.java
@@ -30,10 +30,10 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
-public class ResolutionManagementInfoTest {
+class ResolutionManagementInfoTest {
@Test
- public void testAddSingleArtifactWithReplacemen() throws Exception {
+ void addSingleArtifactWithReplacemen() throws Exception {
ResolutionManagementInfo rmi = new ResolutionManagementInfo();
Artifact a1 = new DefaultArtifact(
"groupid",
@@ -59,7 +59,7 @@ public class ResolutionManagementInfoTest {
}
@Test
- public void testAddMultiArtifactWithReplacemen() throws Exception {
+ void addMultiArtifactWithReplacemen() throws Exception {
ResolutionManagementInfo rmi = new ResolutionManagementInfo();
Artifact a1 = new DefaultArtifact(
"groupid",
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/filter/ComponentsXmlArchiverFileFilterTest.java
b/src/test/java/org/apache/maven/plugins/assembly/filter/ComponentsXmlArchiverFileFilterTest.java
index e25cc433..c35afbc4 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/filter/ComponentsXmlArchiverFileFilterTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/filter/ComponentsXmlArchiverFileFilterTest.java
@@ -61,7 +61,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
-public class ComponentsXmlArchiverFileFilterTest {
+class ComponentsXmlArchiverFileFilterTest {
@TempDir
private File temporaryFolder;
@@ -69,12 +69,12 @@ public class ComponentsXmlArchiverFileFilterTest {
private ComponentsXmlArchiverFileFilter filter;
@BeforeEach
- public void setUp() {
+ void setUp() {
filter = new ComponentsXmlArchiverFileFilter();
}
@Test
- public void testAddComponentsXmlShouldAddComponentWithoutRoleHint() throws
Exception {
+ void addComponentsXmlShouldAddComponentWithoutRoleHint() throws Exception {
final Reader reader =
writeComponentsXml(Collections.singletonList(new
ComponentDef("role", null, "org.apache.maven.Impl")));
@@ -91,7 +91,7 @@ public class ComponentsXmlArchiverFileFilterTest {
}
@Test
- public void testAddComponentsXmlShouldAddComponentWithRoleHint() throws
Exception {
+ void addComponentsXmlShouldAddComponentWithRoleHint() throws Exception {
final Reader reader = writeComponentsXml(
Collections.singletonList(new ComponentDef("role", "hint",
"org.apache.maven.Impl")));
@@ -108,7 +108,7 @@ public class ComponentsXmlArchiverFileFilterTest {
}
@Test
- public void testAddComponentsXmlShouldAddTwoComponentsWithRoleHints()
throws Exception {
+ void addComponentsXmlShouldAddTwoComponentsWithRoleHints() throws
Exception {
final List<ComponentDef> defs = new ArrayList<>();
defs.add(new ComponentDef("role", "hint", "org.apache.maven.Impl"));
@@ -137,7 +137,7 @@ public class ComponentsXmlArchiverFileFilterTest {
}
@Test
- public void testAddToArchiveShouldWriteComponentWithoutHintToFile() throws
Exception {
+ void addToArchiveShouldWriteComponentWithoutHintToFile() throws Exception {
final Xpp3Dom dom = createComponentDom(new ComponentDef("role", null,
"impl"));
filter.components = new LinkedHashMap<>();
@@ -165,7 +165,7 @@ public class ComponentsXmlArchiverFileFilterTest {
}
@Test
- public void testAddToArchiveShouldWriteComponentWithHintToFile() throws
Exception {
+ void addToArchiveShouldWriteComponentWithHintToFile() throws Exception {
final Xpp3Dom dom = createComponentDom(new ComponentDef("role",
"hint", "impl"));
filter.components = new LinkedHashMap<>();
@@ -193,7 +193,7 @@ public class ComponentsXmlArchiverFileFilterTest {
}
@Test
- public void testAddToArchiveShouldWriteTwoComponentToFile() throws
Exception {
+ void addToArchiveShouldWriteTwoComponentToFile() throws Exception {
filter.components = new LinkedHashMap<>();
final Xpp3Dom dom = createComponentDom(new ComponentDef("role",
"hint", "impl"));
@@ -236,7 +236,7 @@ public class ComponentsXmlArchiverFileFilterTest {
}
@Test
- public void testAddToArchiveShouldWriteTwoComponentToArchivedFile() throws
Exception {
+ void addToArchiveShouldWriteTwoComponentToArchivedFile() throws Exception {
filter.components = new LinkedHashMap<>();
final Xpp3Dom dom = createComponentDom(new ComponentDef("role",
"hint", "impl"));
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/format/ReaderFormatterTest.java
b/src/test/java/org/apache/maven/plugins/assembly/format/ReaderFormatterTest.java
index 1cf71a7b..222bb13a 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/format/ReaderFormatterTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/format/ReaderFormatterTest.java
@@ -42,18 +42,17 @@ import
org.codehaus.plexus.components.io.resources.PlexusIoResource;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.Matchers.sameInstance;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertSame;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-public class ReaderFormatterTest {
+class ReaderFormatterTest {
@Test
- public void lineDosFeed() throws IOException, AssemblyFormattingException {
+ void lineDosFeed() throws Exception {
final PojoConfigSource cfg = getPojoConfigSource();
InputStreamTransformer fileSetTransformers =
ReaderFormatter.getFileSetTransformers(cfg, true,
Collections.emptySet(), "dos");
@@ -62,7 +61,7 @@ public class ReaderFormatterTest {
}
@Test
- public void lineDosFeedWithoutFiltering() throws IOException,
AssemblyFormattingException {
+ void lineDosFeedWithoutFiltering() throws Exception {
final PojoConfigSource cfg = getPojoConfigSource();
InputStreamTransformer fileSetTransformers =
ReaderFormatter.getFileSetTransformers(cfg, false,
Collections.emptySet(), "dos");
@@ -71,7 +70,7 @@ public class ReaderFormatterTest {
}
@Test
- public void lineUnixFeedWithInterpolation() throws IOException,
AssemblyFormattingException {
+ void lineUnixFeedWithInterpolation() throws Exception {
final PojoConfigSource cfg = getPojoConfigSource();
InputStreamTransformer fileSetTransformers =
ReaderFormatter.getFileSetTransformers(cfg, true,
Collections.emptySet(), "unix");
@@ -81,7 +80,7 @@ public class ReaderFormatterTest {
}
@Test
- public void nonFilteredFileExtensions() throws Exception {
+ void nonFilteredFileExtensions() throws Exception {
final PojoConfigSource cfg = getPojoConfigSource();
Set<String> nonFilteredFileExtensions = new
HashSet<>(Arrays.asList("jpg", "tar.gz"));
InputStreamTransformer transformer =
@@ -91,16 +90,16 @@ public class ReaderFormatterTest {
PlexusIoResource resource = mock(PlexusIoResource.class);
when(resource.getName()).thenReturn("file.jpg", "file.tar.gz",
"file.txt", "file.nojpg", "file.gz", "file");
- assertThat(transformer.transform(resource, is), sameInstance(is));
- assertThat(transformer.transform(resource, is), sameInstance(is));
- assertThat(transformer.transform(resource, is), not(sameInstance(is)));
- assertThat(transformer.transform(resource, is), not(sameInstance(is)));
- assertThat(transformer.transform(resource, is), not(sameInstance(is)));
- assertThat(transformer.transform(resource, is), not(sameInstance(is)));
+ assertSame(transformer.transform(resource, is), is);
+ assertSame(transformer.transform(resource, is), is);
+ assertNotSame(transformer.transform(resource, is), is);
+ assertNotSame(transformer.transform(resource, is), is);
+ assertNotSame(transformer.transform(resource, is), is);
+ assertNotSame(transformer.transform(resource, is), is);
}
@Test
- public void additionalProperties() throws Exception {
+ void additionalProperties() throws Exception {
final MavenReaderFilter mavenReaderFilter =
mock(MavenReaderFilter.class);
when(mavenReaderFilter.filter(any())).thenReturn(mock(Reader.class));
@@ -121,7 +120,7 @@ public class ReaderFormatterTest {
ArgumentCaptor<MavenReaderFilterRequest> filteringRequest =
ArgumentCaptor.forClass(MavenReaderFilterRequest.class);
verify(mavenReaderFilter).filter(filteringRequest.capture());
- assertThat(filteringRequest.getValue().getAdditionalProperties(),
sameInstance(additionalProperties));
+ assertSame(filteringRequest.getValue().getAdditionalProperties(),
additionalProperties);
}
private MavenProject createBasicMavenProject() {
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/interpolation/AssemblyExpressionEvaluatorTest.java
b/src/test/java/org/apache/maven/plugins/assembly/interpolation/AssemblyExpressionEvaluatorTest.java
index 1af5ba82..cbf41632 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/interpolation/AssemblyExpressionEvaluatorTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/interpolation/AssemblyExpressionEvaluatorTest.java
@@ -25,7 +25,6 @@ import org.apache.maven.model.Model;
import org.apache.maven.plugins.assembly.AssemblerConfigurationSource;
import org.apache.maven.plugins.assembly.testutils.PojoConfigSource;
import org.apache.maven.project.MavenProject;
-import
org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
import org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator;
import org.codehaus.plexus.interpolation.fixed.PropertiesBasedValueSource;
import org.junit.jupiter.api.Test;
@@ -41,11 +40,11 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class AssemblyExpressionEvaluatorTest {
+class AssemblyExpressionEvaluatorTest {
private final PojoConfigSource configSourceStub = new PojoConfigSource();
@Test
- public void testShouldResolveModelGroupId() throws
ExpressionEvaluationException {
+ void shouldResolveModelGroupId() throws Exception {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
@@ -67,7 +66,7 @@ public class AssemblyExpressionEvaluatorTest {
}
@Test
- public void testShouldResolveModelPropertyBeforeModelGroupId() throws
ExpressionEvaluationException {
+ void shouldResolveModelPropertyBeforeModelGroupId() throws Exception {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
@@ -88,8 +87,7 @@ public class AssemblyExpressionEvaluatorTest {
}
@Test
- public void
testShouldResolveContextValueBeforeModelPropertyOrModelGroupIdInAssemblyId()
- throws ExpressionEvaluationException {
+ void
shouldResolveContextValueBeforeModelPropertyOrModelGroupIdInAssemblyId() throws
Exception {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
@@ -124,7 +122,7 @@ public class AssemblyExpressionEvaluatorTest {
}
@Test
- public void testShouldReturnUnchangedInputForUnresolvedExpression() throws
ExpressionEvaluationException {
+ void shouldReturnUnchangedInputForUnresolvedExpression() throws Exception {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
@@ -140,7 +138,7 @@ public class AssemblyExpressionEvaluatorTest {
}
@Test
- public void testShouldInterpolateMultiDotProjectExpression() throws
ExpressionEvaluationException {
+ void shouldInterpolateMultiDotProjectExpression() throws Exception {
final Build build = new Build();
build.setFinalName("final-name");
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/interpolation/AssemblyInterpolatorTest.java
b/src/test/java/org/apache/maven/plugins/assembly/interpolation/AssemblyInterpolatorTest.java
index 26a6911b..a5392c77 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/interpolation/AssemblyInterpolatorTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/interpolation/AssemblyInterpolatorTest.java
@@ -48,11 +48,9 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class AssemblyInterpolatorTest {
+class AssemblyInterpolatorTest {
@Test
- public void testDependencySetOutputFileNameMappingsAreNotInterpolated()
- throws IOException, AssemblyInterpolationException,
AssemblyReadException,
- InvalidAssemblerConfigurationException {
+ void dependencySetOutputFileNameMappingsAreNotInterpolated() throws
Exception {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
@@ -88,9 +86,7 @@ public class AssemblyInterpolatorTest {
}
@Test
- public void testDependencySetOutputDirectoryIsNotInterpolated()
- throws IOException, AssemblyInterpolationException,
AssemblyReadException,
- InvalidAssemblerConfigurationException {
+ void dependencySetOutputDirectoryIsNotInterpolated() throws Exception {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
@@ -130,9 +126,7 @@ public class AssemblyInterpolatorTest {
}
@Test
- public void testShouldResolveModelGroupIdInAssemblyId()
- throws AssemblyInterpolationException,
InvalidAssemblerConfigurationException, AssemblyReadException,
- IOException {
+ void shouldResolveModelGroupIdInAssemblyId() throws Exception {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
@@ -154,9 +148,7 @@ public class AssemblyInterpolatorTest {
}
@Test
- public void testShouldResolveModelPropertyBeforeModelGroupIdInAssemblyId()
- throws AssemblyInterpolationException,
InvalidAssemblerConfigurationException, AssemblyReadException,
- IOException {
+ void shouldResolveModelPropertyBeforeModelGroupIdInAssemblyId() throws
Exception {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
@@ -185,7 +177,7 @@ public class AssemblyInterpolatorTest {
}
@Test
- public void
testShouldResolveContextValueBeforeModelPropertyOrModelGroupIdInAssemblyId()
throws Exception {
+ void
shouldResolveContextValueBeforeModelPropertyOrModelGroupIdInAssemblyId() throws
Exception {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
@@ -219,9 +211,7 @@ public class AssemblyInterpolatorTest {
}
@Test
- public void testShouldNotTouchUnresolvedExpression()
- throws AssemblyInterpolationException,
InvalidAssemblerConfigurationException, AssemblyReadException,
- IOException {
+ void shouldNotTouchUnresolvedExpression() throws Exception {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
@@ -244,9 +234,7 @@ public class AssemblyInterpolatorTest {
}
@Test
- public void testShouldInterpolateMultiDotProjectExpression()
- throws AssemblyInterpolationException,
InvalidAssemblerConfigurationException, AssemblyReadException,
- IOException {
+ void shouldInterpolateMultiDotProjectExpression() throws Exception {
final Build build = new Build();
build.setFinalName("final-name");
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/io/DefaultAssemblyReaderTest.java
b/src/test/java/org/apache/maven/plugins/assembly/io/DefaultAssemblyReaderTest.java
index 796a6f50..8a2acab8 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/io/DefaultAssemblyReaderTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/io/DefaultAssemblyReaderTest.java
@@ -84,7 +84,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testIncludeSiteInAssemblyShouldFailIfSiteDirectoryNonExistent() throws
Exception {
+ void includeSiteInAssemblyShouldFailIfSiteDirectoryNonExistent() throws
Exception {
final File siteDir = Files.createTempFile("assembly-reader.",
".test").toFile();
siteDir.delete();
@@ -102,7 +102,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testIncludeSiteInAssemblyShouldAddSiteDirFileSetWhenDirExists() throws
Exception {
+ void includeSiteInAssemblyShouldAddSiteDirFileSetWhenDirExists() throws
Exception {
final File siteDir = temporaryFolder;
when(configSource.getSiteDirectory()).thenReturn(siteDir);
@@ -122,7 +122,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testMergeComponentWithAssemblyShouldAddOneFileSetToExistingListOfTwo() {
+ void mergeComponentWithAssemblyShouldAddOneFileSetToExistingListOfTwo() {
final Assembly assembly = new Assembly();
FileSet fs = new FileSet();
@@ -159,7 +159,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testMergeComponentWithAssemblyShouldAddOneFileItemToExistingListOfTwo() {
+ void mergeComponentWithAssemblyShouldAddOneFileItemToExistingListOfTwo() {
final Assembly assembly = new Assembly();
FileItem fi = new FileItem();
@@ -197,7 +197,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testMergeComponentWithAssemblyShouldAddOneDependencySetToExistingListOfTwo() {
+ void
mergeComponentWithAssemblyShouldAddOneDependencySetToExistingListOfTwo() {
final Assembly assembly = new Assembly();
DependencySet ds = new DependencySet();
@@ -230,7 +230,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testMergeComponentWithAssemblyShouldAddOneContainerDescriptorHandlerToExistingListOfTwo()
{
+ void
mergeComponentWithAssemblyShouldAddOneContainerDescriptorHandlerToExistingListOfTwo()
{
final Assembly assembly = new Assembly();
ContainerDescriptorHandlerConfig cfg = new
ContainerDescriptorHandlerConfig();
@@ -264,7 +264,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testMergeComponentsWithMainAssemblyShouldAddOneFileSetToAssembly() throws
Exception {
+ void mergeComponentsWithMainAssemblyShouldAddOneFileSetToAssembly() throws
Exception {
final Component component = new Component();
final FileSet fileSet = new FileSet();
@@ -310,7 +310,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testReadAssemblyShouldReadAssemblyWithoutComponentsInterpolationOrSiteDirInclusion()
throws Exception {
+ void
readAssemblyShouldReadAssemblyWithoutComponentsInterpolationOrSiteDirInclusion()
throws Exception {
final Assembly assembly = new Assembly();
assembly.setId("test");
@@ -320,7 +320,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testReadAssemblyShouldReadAssemblyWithSiteDirInclusionFromAssemblyWithoutComponentsOrInterpolation()
+ void
readAssemblyShouldReadAssemblyWithSiteDirInclusionFromAssemblyWithoutComponentsOrInterpolation()
throws Exception {
final Assembly assembly = new Assembly();
assembly.setId("test");
@@ -360,8 +360,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testReadAssemblyShouldReadAssemblyWithComponentWithoutSiteDirInclusionOrInterpolation()
- throws Exception {
+ void
readAssemblyShouldReadAssemblyWithComponentWithoutSiteDirInclusionOrInterpolation()
throws Exception {
final File componentsFile = File.createTempFile("junit", null,
temporaryFolder);
final File basedir = componentsFile.getParentFile();
@@ -410,9 +409,8 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
-
testReadAssemblyShouldReadAssemblyWithComponentInterpolationWithoutSiteDirInclusionOrAssemblyInterpolation()
- throws Exception {
+ void
readAssemblyShouldReadAssemblyWithComponentInterpolationWithoutSiteDirInclusionOrAssemblyInterpolation()
+ throws Exception {
final File componentsFile = File.createTempFile("junit", null,
temporaryFolder);
final File basedir = componentsFile.getParentFile();
@@ -462,8 +460,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testReadAssemblyShouldReadAssemblyWithInterpolationWithoutComponentsOrSiteDirInclusion()
- throws Exception {
+ void
readAssemblyShouldReadAssemblyWithInterpolationWithoutComponentsOrSiteDirInclusion()
throws Exception {
final Assembly assembly = new Assembly();
assembly.setId("${groupId}-assembly");
@@ -495,7 +492,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void testGetAssemblyFromDescriptorFileShouldReadAssembly() throws
Exception {
+ void getAssemblyFromDescriptorFileShouldReadAssembly() throws Exception {
final Assembly assembly = new Assembly();
assembly.setId("test");
@@ -525,7 +522,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testGetAssemblyForDescriptorReferenceShouldReadBinaryAssemblyRef() throws
Exception {
+ void getAssemblyForDescriptorReferenceShouldReadBinaryAssemblyRef() throws
Exception {
final File basedir = temporaryFolder;
when(configSource.getBasedir()).thenReturn(basedir);
@@ -540,7 +537,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void testReadAssembliesShouldGetAssemblyDescriptorFromSingleFile()
throws Exception {
+ void readAssembliesShouldGetAssemblyDescriptorFromSingleFile() throws
Exception {
final Assembly assembly = new Assembly();
assembly.setId("test");
@@ -566,7 +563,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void testReadAssembliesShouldFailWhenSingleDescriptorFileMissing()
throws Exception {
+ void readAssembliesShouldFailWhenSingleDescriptorFileMissing() throws
Exception {
final File basedir = temporaryFolder;
try {
@@ -579,7 +576,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testReadAssembliesShouldIgnoreMissingSingleDescriptorFileWhenIgnoreIsConfigured()
throws Exception {
+ void
readAssembliesShouldIgnoreMissingSingleDescriptorFileWhenIgnoreIsConfigured()
throws Exception {
final File basedir = temporaryFolder;
try {
@@ -591,7 +588,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void testReadAssembliesShouldGetAssemblyDescriptorFromFileArray()
throws Exception {
+ void readAssembliesShouldGetAssemblyDescriptorFromFileArray() throws
Exception {
final Assembly assembly1 = new Assembly();
assembly1.setId("test");
@@ -621,7 +618,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testReadAssembliesShouldGetAssemblyDescriptorFromMultipleRefs() throws
Exception {
+ void readAssembliesShouldGetAssemblyDescriptorFromMultipleRefs() throws
Exception {
final File basedir = temporaryFolder;
final List<Assembly> assemblies = performReadAssemblies(basedir, null,
new String[] {"bin", "src"}, null);
@@ -639,7 +636,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void testReadAssembliesShouldGetAssemblyDescriptorFromDirectory()
throws Exception {
+ void readAssembliesShouldGetAssemblyDescriptorFromDirectory() throws
Exception {
final Assembly assembly1 = new Assembly();
assembly1.setId("test");
@@ -669,7 +666,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void
testReadAssembliesShouldGetTwoAssemblyDescriptorsFromDirectoryWithThreeFiles()
throws Exception {
+ void
readAssembliesShouldGetTwoAssemblyDescriptorsFromDirectoryWithThreeFiles()
throws Exception {
final Assembly assembly1 = new Assembly();
assembly1.setId("test");
@@ -704,7 +701,7 @@ public class DefaultAssemblyReaderTest {
}
@Test
- public void inlineAssemblyShouldBeReturned() throws Exception {
+ void inlineAssemblyShouldBeReturned() throws Exception {
// given
Assembly assemby = new Assembly();
assemby.setId("test-id");
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/io/PrefixedClasspathLocatorStrategyTest.java
b/src/test/java/org/apache/maven/plugins/assembly/io/PrefixedClasspathLocatorStrategyTest.java
index 5fd1919d..0ca3bfe9 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/io/PrefixedClasspathLocatorStrategyTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/io/PrefixedClasspathLocatorStrategyTest.java
@@ -26,12 +26,12 @@ import static
org.junit.jupiter.api.Assertions.assertNotNull;
/**
* @author Benjamin Bentmann
*/
-public class PrefixedClasspathLocatorStrategyTest {
+class PrefixedClasspathLocatorStrategyTest {
private MessageHolder mh = new DefaultMessageHolder();
@Test
- public void testResolvePrefixWithLeadingSlashAndWithTrailingSlash() {
+ void resolvePrefixWithLeadingSlashAndWithTrailingSlash() {
LocatorStrategy ls = new
PrefixedClasspathLocatorStrategy("/assemblies/");
Location location = ls.resolve("empty.xml", mh);
@@ -40,7 +40,7 @@ public class PrefixedClasspathLocatorStrategyTest {
}
@Test
- public void testResolvePrefixWithLeadingSlashAndWithoutTrailingSlash() {
+ void resolvePrefixWithLeadingSlashAndWithoutTrailingSlash() {
LocatorStrategy ls = new
PrefixedClasspathLocatorStrategy("/assemblies");
Location location = ls.resolve("empty.xml", mh);
@@ -49,7 +49,7 @@ public class PrefixedClasspathLocatorStrategyTest {
}
@Test
- public void testResolvePrefixWithoutLeadingSlashAndWithTrailingSlash() {
+ void resolvePrefixWithoutLeadingSlashAndWithTrailingSlash() {
LocatorStrategy ls = new
PrefixedClasspathLocatorStrategy("assemblies/");
Location location = ls.resolve("empty.xml", mh);
@@ -58,7 +58,7 @@ public class PrefixedClasspathLocatorStrategyTest {
}
@Test
- public void testResolvePrefixWithoutLeadingSlashAndWithoutTrailingSlash() {
+ void resolvePrefixWithoutLeadingSlashAndWithoutTrailingSlash() {
LocatorStrategy ls = new
PrefixedClasspathLocatorStrategy("assemblies");
Location location = ls.resolve("empty.xml", mh);
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/utils/AssemblyFormatUtilsTest.java
b/src/test/java/org/apache/maven/plugins/assembly/utils/AssemblyFormatUtilsTest.java
index 62255849..4015dc90 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/utils/AssemblyFormatUtilsTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/utils/AssemblyFormatUtilsTest.java
@@ -47,198 +47,196 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class AssemblyFormatUtilsTest {
+class AssemblyFormatUtilsTest {
@Test
- public void testFixRelativePathRefsShouldRemoveRelativeRefToCurrentDir() {
+ void fixRelativePathRefsShouldRemoveRelativeRefToCurrentDir() {
assertEquals("path/", AssemblyFormatUtils.fixRelativeRefs("./path/"));
}
@Test
- public void testFixRelativePathRefsShouldRemoveEmbeddedSameDirRef() {
+ void fixRelativePathRefsShouldRemoveEmbeddedSameDirRef() {
assertEquals("some/path/",
AssemblyFormatUtils.fixRelativeRefs("some/./path/"));
assertEquals("some\\path\\",
AssemblyFormatUtils.fixRelativeRefs("some\\.\\path\\"));
}
@Test
- public void testFixRelativePathRefsShouldRemoveEmbeddedParentDirRef() {
+ void fixRelativePathRefsShouldRemoveEmbeddedParentDirRef() {
assertEquals("path/",
AssemblyFormatUtils.fixRelativeRefs("some/../path/"));
}
@Test
- public void testFixRelativePathRefsShouldTruncateRelativeRefToParentDir() {
+ void fixRelativePathRefsShouldTruncateRelativeRefToParentDir() {
assertEquals("path/", AssemblyFormatUtils.fixRelativeRefs("../path/"));
}
@Test
- public void
testGetDistroNameShouldUseJustFinalNameWithNoAppendAssemblyIdOrClassifier() {
+ void
getDistroNameShouldUseJustFinalNameWithNoAppendAssemblyIdOrClassifier() {
verifyDistroName("assembly", "finalName", false, "finalName");
}
@Test
- public void testGetDistroNameShouldUseFinalNamePlusAssemblyIdIsNull() {
+ void getDistroNameShouldUseFinalNamePlusAssemblyIdIsNull() {
verifyDistroName("assembly", "finalName", true, "finalName-assembly");
}
@Test
- public void testGetOutputDirShouldResolveGroupIdInOutDirUseArtifactInfo()
throws Exception {
+ void getOutputDirShouldResolveGroupIdInOutDirUseArtifactInfo() throws
Exception {
verifyOutputDirUsingArtifactProject("${artifact.groupId}", null,
"group", null, null, null, null, "group/");
}
@Test
- public void
testGetOutputDirShouldResolveArtifactIdInOutDirUseArtifactInfo() throws
Exception {
+ void getOutputDirShouldResolveArtifactIdInOutDirUseArtifactInfo() throws
Exception {
verifyOutputDirUsingArtifactProject(
"${artifact.artifactId}", null, null, "artifact", null, null,
null, "artifact/");
}
@Test
- public void testGetOutputDirShouldResolveVersionInOutDirUseArtifactInfo()
throws Exception {
+ void getOutputDirShouldResolveVersionInOutDirUseArtifactInfo() throws
Exception {
verifyOutputDirUsingArtifactProject("${artifact.version}", null, null,
null, "version", null, null, "version/");
}
@Test
- public void
testGetOutputDirShouldResolveBuildFinalNameInOutDirUseArtifactInfo() throws
Exception {
+ void getOutputDirShouldResolveBuildFinalNameInOutDirUseArtifactInfo()
throws Exception {
verifyOutputDirUsingArtifactProject(
"${artifact.build.finalName}", null, null, null, null,
"finalName", null, "finalName/");
}
@Test
- public void testGetOutputDirShouldResolveGroupIdInOutDirUseModuleInfo()
throws Exception {
+ void getOutputDirShouldResolveGroupIdInOutDirUseModuleInfo() throws
Exception {
verifyOutputDirUsingModuleProject("${module.groupId}", null, "group",
null, null, null, null, "group/");
}
@Test
- public void testGetOutputDirShouldResolveArtifactIdInOutDirUseModuleInfo()
throws Exception {
+ void getOutputDirShouldResolveArtifactIdInOutDirUseModuleInfo() throws
Exception {
verifyOutputDirUsingModuleProject(
"${module.artifactId}", null, null, "artifact", null, null,
null, "artifact/");
}
@Test
- public void testGetOutputDirShouldResolveVersionInOutDirUseModuleInfo()
throws Exception {
+ void getOutputDirShouldResolveVersionInOutDirUseModuleInfo() throws
Exception {
verifyOutputDirUsingModuleProject("${module.version}", null, null,
null, "version", null, null, "version/");
}
@Test
- public void
testGetOutputDirShouldResolveBuildFinalNameInOutDirUseModuleInfo() throws
Exception {
+ void getOutputDirShouldResolveBuildFinalNameInOutDirUseModuleInfo() throws
Exception {
verifyOutputDirUsingModuleProject(
"${module.build.finalName}", null, null, null, null,
"finalName", null, "finalName/");
}
@Test
- public void
testGetOutputDirShouldResolveGroupIdInOutDirUseExplicitMainProject() throws
Exception {
+ void getOutputDirShouldResolveGroupIdInOutDirUseExplicitMainProject()
throws Exception {
verifyOutputDirUsingMainProject("${pom.groupId}", null, "group", null,
null, null, null, "group/");
}
@Test
- public void
testGetOutputDirShouldResolveArtifactIdInOutDirUseExplicitMainProject() throws
Exception {
+ void getOutputDirShouldResolveArtifactIdInOutDirUseExplicitMainProject()
throws Exception {
verifyOutputDirUsingMainProject("${pom.artifactId}", null, null,
"artifact", null, null, null, "artifact/");
}
@Test
- public void
testGetOutputDirShouldResolveVersionInOutDirUseExplicitMainProject() throws
Exception {
+ void getOutputDirShouldResolveVersionInOutDirUseExplicitMainProject()
throws Exception {
verifyOutputDirUsingMainProject("${pom.version}", null, null, null,
"version", null, null, "version/");
}
@Test
- public void
testGetOutputDirShouldResolveBuildFinalNameInOutDirUseExplicitMainProject()
throws Exception {
+ void
getOutputDirShouldResolveBuildFinalNameInOutDirUseExplicitMainProject() throws
Exception {
verifyOutputDirUsingMainProject(
"${pom.build.finalName}", null, null, null, null, "finalName",
null, "finalName/");
}
@Test
- public void
testGetOutputDirShouldResolveGroupIdInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
+ void
getOutputDirShouldResolveGroupIdInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
verifyOutputDirUsingMainProject("${project.groupId}", null, "group",
null, null, null, null, "group/");
}
@Test
- public void
testGetOutputDirShouldResolveArtifactIdInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
+ void
getOutputDirShouldResolveArtifactIdInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
verifyOutputDirUsingMainProject("${project.artifactId}", null, null,
"artifact", null, null, null, "artifact/");
}
@Test
- public void
testGetOutputDirShouldResolveVersionInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
+ void
getOutputDirShouldResolveVersionInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
verifyOutputDirUsingMainProject("${project.version}", null, null,
null, "version", null, null, "version/");
}
@Test
- public void
testGetOutputDirShouldResolveBuildFinalNameInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
+ void
getOutputDirShouldResolveBuildFinalNameInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
verifyOutputDir("${project.build.finalName}", null, "finalName",
"finalName/");
}
@Test
- public void
testGetOutputDirShouldNotAlterOutDirWhenIncludeBaseFalseAndNoExpressions()
throws Exception {
+ void
getOutputDirShouldNotAlterOutDirWhenIncludeBaseFalseAndNoExpressions() throws
Exception {
verifyOutputDir("dir/", "finalName", null, "dir/");
}
@Test
- public void
testGetOutputDirShouldNotAlterOutDirWhenIncludeBaseFalseAndNoExpressionsCheckWithBackslash()
- throws Exception {
+ void
getOutputDirShouldNotAlterOutDirWhenIncludeBaseFalseAndNoExpressionsCheckWithBackslash()
throws Exception {
verifyOutputDir("dir\\", "finalName", null, "dir\\");
}
@Test
- public void
testGetOutputDirShouldAppendSlashToOutDirWhenMissingAndIncludeBaseFalseAndNoExpressions()
- throws Exception {
+ void
getOutputDirShouldAppendSlashToOutDirWhenMissingAndIncludeBaseFalseAndNoExpressions()
throws Exception {
verifyOutputDir("dir", "finalName", null, "dir/");
}
@Test
- public void testGetOutputDirShouldResolveGroupIdInOutDir() throws
Exception {
+ void getOutputDirShouldResolveGroupIdInOutDir() throws Exception {
verifyOutputDirUsingMainProject("${groupId}", "finalName", "group",
null, null, null, null, "group/");
}
@Test
- public void testGetOutputDirShouldResolveArtifactIdInOutDir() throws
Exception {
+ void getOutputDirShouldResolveArtifactIdInOutDir() throws Exception {
verifyOutputDirUsingMainProject("${artifactId}", "finalName", null,
"artifact", null, null, null, "artifact/");
}
@Test
- public void testGetOutputDirShouldResolveVersionInOutDir() throws
Exception {
+ void getOutputDirShouldResolveVersionInOutDir() throws Exception {
verifyOutputDirUsingMainProject("${version}", "finalName", null, null,
"version", null, null, "version/");
}
@Test
- public void testGetOutputDirShouldResolveVersionInLargerOutDirExpr()
throws Exception {
+ void getOutputDirShouldResolveVersionInLargerOutDirExpr() throws Exception
{
verifyOutputDirUsingMainProject(
"my-special-${version}", "finalName", null, null, "99", null,
null, "my-special-99/");
}
@Test
- public void testGetOutputDirShouldResolveFinalNameInOutDir() throws
Exception {
+ void getOutputDirShouldResolveFinalNameInOutDir() throws Exception {
verifyOutputDir("${finalName}", "finalName", null, "finalName/");
}
@Test
- public void testGetOutputDirShouldResolveBuildFinalNameInOutDir() throws
Exception {
+ void getOutputDirShouldResolveBuildFinalNameInOutDir() throws Exception {
verifyOutputDir("${build.finalName}", "finalName", null, "finalName/");
}
@Test
- public void
testGetOutputDirShouldReturnEmptyPathWhenAllInputIsEmptyAndIncludeBaseFalse()
throws Exception {
+ void
getOutputDirShouldReturnEmptyPathWhenAllInputIsEmptyAndIncludeBaseFalse()
throws Exception {
verifyOutputDir(null, null, null, "");
}
@Test
- public void testGetOutputDirShouldRemoveRelativeRefToCurrentDir() throws
Exception {
+ void getOutputDirShouldRemoveRelativeRefToCurrentDir() throws Exception {
verifyOutputDir("./path/", null, null, "path/");
}
@Test
- public void testGetOutputDirShouldRemoveEmbeddedSameDirRef() throws
Exception {
+ void getOutputDirShouldRemoveEmbeddedSameDirRef() throws Exception {
verifyOutputDir("some/./path/", null, null, "some/path/");
}
@Test
- public void testGetOutputDirShouldRemoveEmbeddedParentDirRef() throws
Exception {
+ void getOutputDirShouldRemoveEmbeddedParentDirRef() throws Exception {
verifyOutputDir("some/../path/", null, null, "path/");
}
@Test
- public void testGetOutputDirShouldTruncateRelativeRefToParentDir() throws
Exception {
+ void getOutputDirShouldTruncateRelativeRefToParentDir() throws Exception {
verifyOutputDir("../path/", null, null, "path/");
}
@Test
- public void testGetOutputDirShouldResolveProjectProperty() throws
Exception {
+ void getOutputDirShouldResolveProjectProperty() throws Exception {
final Properties props = new Properties();
props.setProperty("myProperty", "value");
@@ -246,7 +244,7 @@ public class AssemblyFormatUtilsTest {
}
@Test
- public void testGetOutputDirShouldResolveProjectPropertyAltExpr() throws
Exception {
+ void getOutputDirShouldResolveProjectPropertyAltExpr() throws Exception {
final Properties props = new Properties();
props.setProperty("myProperty", "value");
@@ -255,8 +253,7 @@ public class AssemblyFormatUtilsTest {
}
@Test
- public void
-
testEvalFileNameMappingShouldResolveArtifactIdAndBaseVersionInOutDirUseArtifactInfoWithValidMainProject()
{
+ void
evalFileNameMappingShouldResolveArtifactIdAndBaseVersionInOutDirUseArtifactInfoWithValidMainProject()
{
final MavenProject mainProject = createProject("group", "main", "1",
null);
final String artifactVersion = "2-20070807.112233-1";
@@ -291,144 +288,143 @@ public class AssemblyFormatUtilsTest {
}
@Test
- public void
testEvalFileNameMappingShouldResolveGroupIdInOutDirUseArtifactInfo() {
+ void evalFileNameMappingShouldResolveGroupIdInOutDirUseArtifactInfo() {
verifyEvalFileNameMappingUsingArtifactProject(
"${artifact.groupId}", null, "group", null, null, null,
"group", null);
}
@Test
- public void
testEvalFileNameMappingShouldResolveArtifactIdInOutDirUseArtifactInfo() {
+ void evalFileNameMappingShouldResolveArtifactIdInOutDirUseArtifactInfo() {
verifyEvalFileNameMappingUsingArtifactProject(
"${artifact.artifactId}", null, null, "artifact", null, null,
"artifact", null);
}
@Test
- public void
testEvalFileNameMappingShouldResolveVersionInOutDirUseArtifactInfo() {
+ void evalFileNameMappingShouldResolveVersionInOutDirUseArtifactInfo() {
verifyEvalFileNameMappingUsingArtifactProject(
"${artifact.version}", null, null, null, "version", null,
"version", null);
}
@Test
- public void
testEvalFileNameMappingShouldResolveGroupIdInOutDirUseArtifactInfoAndModulePrefix()
{
+ void
evalFileNameMappingShouldResolveGroupIdInOutDirUseArtifactInfoAndModulePrefix()
{
verifyEvalFileNameMappingUsingModuleProject(
"${module.groupId}", null, "group", null, null, null, "group",
null);
}
@Test
- public void
testEvalFileNameMappingShouldResolveArtifactIdInOutDirUseArtifactInfoAndModulePrefix()
{
+ void
evalFileNameMappingShouldResolveArtifactIdInOutDirUseArtifactInfoAndModulePrefix()
{
verifyEvalFileNameMappingUsingModuleProject(
"${module.artifactId}", null, null, "artifact", null, null,
"artifact", null);
}
@Test
- public void
testEvalFileNameMappingShouldResolveVersionInOutDirUseArtifactInfoAndModulePrefix()
{
+ void
evalFileNameMappingShouldResolveVersionInOutDirUseArtifactInfoAndModulePrefix()
{
verifyEvalFileNameMappingUsingModuleProject(
"${module.version}", null, null, null, "version", null,
"version", null);
}
@Test
- public void
testEvalFileNameMappingShouldResolveGroupIdInOutDirUseExplicitMainProject()
throws Exception {
+ void
evalFileNameMappingShouldResolveGroupIdInOutDirUseExplicitMainProject() throws
Exception {
verifyEvalFileNameMappingUsingMainProject("${pom.groupId}", null,
"group", null, null, null, "group", null);
}
@Test
- public void
testEvalFileNameMappingShouldResolveArtifactIdInOutDirUseExplicitMainProject()
throws Exception {
+ void
evalFileNameMappingShouldResolveArtifactIdInOutDirUseExplicitMainProject()
throws Exception {
verifyEvalFileNameMappingUsingMainProject(
"${pom.artifactId}", null, null, "artifact", null, null,
"artifact", null);
}
@Test
- public void
testEvalFileNameMappingShouldResolveVersionInOutDirUseExplicitMainProject()
throws Exception {
+ void
evalFileNameMappingShouldResolveVersionInOutDirUseExplicitMainProject() throws
Exception {
verifyEvalFileNameMappingUsingMainProject("${pom.version}", null,
null, null, "version", null, "version", null);
}
@Test
- public void
testEvalFileNameMappingShouldResolveGroupIdInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
+ void
evalFileNameMappingShouldResolveGroupIdInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
verifyEvalFileNameMappingUsingMainProject("${project.groupId}", null,
"group", null, null, null, "group", null);
}
@Test
- public void
testEvalFileNameMappingShouldResolveArtifactIdInOutDirUseExplicitMainProjectProjectRef()
- throws Exception {
+ void
evalFileNameMappingShouldResolveArtifactIdInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
verifyEvalFileNameMappingUsingMainProject(
"${project.artifactId}", null, null, "artifact", null, null,
"artifact", null);
}
@Test
- public void
testEvalFileNameMappingShouldResolveVersionInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
+ void
evalFileNameMappingShouldResolveVersionInOutDirUseExplicitMainProjectProjectRef()
throws Exception {
verifyEvalFileNameMappingUsingMainProject(
"${project.version}", null, null, null, "version", null,
"version", null);
}
@Test
- public void testEvalFileNameMappingShouldRemoveRelativeRefToCurrentDir()
throws Exception {
+ void evalFileNameMappingShouldRemoveRelativeRefToCurrentDir() throws
Exception {
verifyEvalFileNameMappingUsingMainProject("./path/", null, null, null,
null, null, "path/", null);
}
@Test
- public void testEvalFileNameMappingShouldRemoveEmbeddedSameDirRef() throws
Exception {
+ void evalFileNameMappingShouldRemoveEmbeddedSameDirRef() throws Exception {
verifyEvalFileNameMappingUsingMainProject("some/./path/", null, null,
null, null, null, "some/path/", null);
}
@Test
- public void testEvalFileNameMappingShouldRemoveEmbeddedParentDirRef()
throws Exception {
+ void evalFileNameMappingShouldRemoveEmbeddedParentDirRef() throws
Exception {
verifyEvalFileNameMappingUsingMainProject("some/../path/", null, null,
null, null, null, "path/", null);
}
@Test
- public void testEvalFileNameMappingShouldTruncateRelativeRefToParentDir()
throws Exception {
+ void evalFileNameMappingShouldTruncateRelativeRefToParentDir() throws
Exception {
verifyEvalFileNameMappingUsingMainProject("../path/", null, null,
null, null, null, "path/", null);
}
@Test
- public void testEvalFileNameMappingShouldPassExpressionThroughUnchanged()
throws Exception {
+ void evalFileNameMappingShouldPassExpressionThroughUnchanged() throws
Exception {
verifyEvalFileNameMapping("filename", null, null, "filename", null);
}
@Test
- public void
testEvalFileNameMappingShouldInsertClassifierAheadOfExtension() throws
Exception {
+ void evalFileNameMappingShouldInsertClassifierAheadOfExtension() throws
Exception {
verifyEvalFileNameMapping(
"filename-${artifact.classifier}.ext", "classifier", null,
"filename-classifier.ext", null);
}
@Test
- public void
testEvalFileNameMappingShouldAppendDashClassifierWhenClassifierPresent() throws
Exception {
+ void evalFileNameMappingShouldAppendDashClassifierWhenClassifierPresent()
throws Exception {
verifyEvalFileNameMapping("filename${dashClassifier?}", "classifier",
null, "filename-classifier", null);
}
@Test
- public void
testEvalFileNameMappingShouldNotAppendDashClassifierWhenClassifierMissing()
throws Exception {
+ void
evalFileNameMappingShouldNotAppendDashClassifierWhenClassifierMissing() throws
Exception {
verifyEvalFileNameMapping("filename${dashClassifier?}", null, null,
"filename", null);
}
@Test
- public void
testEvalFileNameMappingShouldNotAppendDashClassifierWhenClassifierEmpty()
throws Exception {
+ void evalFileNameMappingShouldNotAppendDashClassifierWhenClassifierEmpty()
throws Exception {
verifyEvalFileNameMapping("filename${dashClassifier?}", "", null,
"filename", null);
}
@Test
- public void testEvalFileNameMappingShouldResolveGroupId() throws Exception
{
+ void evalFileNameMappingShouldResolveGroupId() throws Exception {
verifyEvalFileNameMappingUsingMainProject("${groupId}", null, "group",
null, null, null, "group", null);
}
@Test
- public void testEvalFileNameMappingShouldResolveArtifactId() throws
Exception {
+ void evalFileNameMappingShouldResolveArtifactId() throws Exception {
verifyEvalFileNameMappingUsingMainProject(
"${artifactId}", null, null, "artifact", null, null,
"artifact", null);
}
@Test
- public void testEvalFileNameMappingShouldResolveVersion() throws Exception
{
+ void evalFileNameMappingShouldResolveVersion() throws Exception {
verifyEvalFileNameMappingUsingMainProject("${version}", null, null,
null, "version", null, "version", null);
}
@Test
- public void testEvalFileNameMappingShouldResolveExtension() throws
Exception {
+ void evalFileNameMappingShouldResolveExtension() throws Exception {
verifyEvalFileNameMapping("file.${artifact.extension}", null, "ext",
"file.ext", null);
}
@Test
- public void testEvalFileNameMappingShouldResolveProjectProperty() throws
Exception {
+ void evalFileNameMappingShouldResolveProjectProperty() throws Exception {
final Properties props = new Properties();
props.setProperty("myProperty", "value");
@@ -436,7 +432,7 @@ public class AssemblyFormatUtilsTest {
}
@Test
- public void testEvalFileNameMappingShouldResolveProjectPropertyAltExpr()
throws Exception {
+ void evalFileNameMappingShouldResolveProjectPropertyAltExpr() throws
Exception {
final Properties props = new Properties();
props.setProperty("myProperty", "value");
@@ -444,7 +440,7 @@ public class AssemblyFormatUtilsTest {
}
@Test
- public void
testEvalFileNameMappingShouldResolveSystemPropertyWithoutMainProjectPresent()
throws Exception {
+ void
evalFileNameMappingShouldResolveSystemPropertyWithoutMainProjectPresent()
throws Exception {
verifyEvalFileNameMapping(
"file.${java.version}", null, null, "file." +
System.getProperty("java.version"), null);
}
@@ -716,17 +712,17 @@ public class AssemblyFormatUtilsTest {
}
@Test
- public void testWindowsPath() {
+ void windowsPath() {
assertTrue(AssemblyFormatUtils.isWindowsPath("C:\foobar"));
}
@Test
- public void testLinuxRootReferencePath() {
+ void linuxRootReferencePath() {
assertTrue(AssemblyFormatUtils.isUnixRootReference("/etc/home"));
}
@Test
- public void groupIdPathArtifactProjectInterpolator() {
+ void groupIdPathArtifactProjectInterpolator() {
Artifact artifact = mock(Artifact.class);
when(artifact.getFile()).thenReturn(new File("dir", "artifactId.jar"));
@@ -740,7 +736,7 @@ public class AssemblyFormatUtilsTest {
}
@Test
- public void groupIdPathArtifactInterpolator() {
+ void groupIdPathArtifactInterpolator() {
Artifact artifact = mock(Artifact.class);
when(artifact.getGroupId()).thenReturn("a.b.c");
when(artifact.getFile()).thenReturn(new File("dir", "artifactId.jar"));
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/utils/FilterUtilsTest.java
b/src/test/java/org/apache/maven/plugins/assembly/utils/FilterUtilsTest.java
index 1107cf77..b5684b55 100644
--- a/src/test/java/org/apache/maven/plugins/assembly/utils/FilterUtilsTest.java
+++ b/src/test/java/org/apache/maven/plugins/assembly/utils/FilterUtilsTest.java
@@ -20,6 +20,7 @@ package org.apache.maven.plugins.assembly.utils;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -29,7 +30,6 @@ import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import
org.apache.maven.plugins.assembly.InvalidAssemblerConfigurationException;
import org.apache.maven.project.MavenProject;
-import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
@@ -37,20 +37,20 @@ import org.mockito.junit.jupiter.MockitoSettings;
import org.mockito.quality.Strictness;
import org.slf4j.LoggerFactory;
-import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.WARN)
@ExtendWith(MockitoExtension.class)
-public class FilterUtilsTest {
+class FilterUtilsTest {
@Test
- public void
testFilterArtifactsShouldThrowExceptionUsingStrictModeWithUnmatchedInclude() {
+ void
filterArtifactsShouldThrowExceptionUsingStrictModeWithUnmatchedInclude() {
final Artifact artifact = mock(Artifact.class);
when(artifact.getGroupId()).thenReturn("group");
lenient().when(artifact.getArtifactId()).thenReturn("artifact");
@@ -66,24 +66,21 @@ public class FilterUtilsTest {
final Set<Artifact> artifacts = new HashSet<>();
artifacts.add(artifact);
- try {
- FilterUtils.filterArtifacts(
- artifacts, includes, excludes, true, false,
LoggerFactory.getLogger(getClass()));
-
- fail("Should fail because of unmatched include.");
- } catch (final InvalidAssemblerConfigurationException e) {
- // expected.
- }
+ assertThrows(
+ InvalidAssemblerConfigurationException.class,
+ () -> FilterUtils.filterArtifacts(
+ artifacts, includes, excludes, true, false,
LoggerFactory.getLogger(getClass())),
+ "Should fail because of unmatched include.");
}
@Test
- public void testFilterArtifactsShouldNotRemoveArtifactDirectlyIncluded()
throws Exception {
+ void filterArtifactsShouldNotRemoveArtifactDirectlyIncluded() throws
Exception {
verifyArtifactInclusion("group", "artifact", "group:artifact", null,
null, null);
verifyArtifactInclusion("group", "artifact", "group:artifact:jar",
null, null, null);
}
@Test
- public void
testFilterArtifactsShouldNotRemoveArtifactTransitivelyIncluded() throws
Exception {
+ void filterArtifactsShouldNotRemoveArtifactTransitivelyIncluded() throws
Exception {
verifyArtifactInclusion(
"group",
"artifact",
@@ -94,7 +91,7 @@ public class FilterUtilsTest {
}
@Test
- public void testFilterArtifactsShouldRemoveArtifactTransitivelyExcluded()
throws Exception {
+ void filterArtifactsShouldRemoveArtifactTransitivelyExcluded() throws
Exception {
verifyArtifactExclusion(
"group",
"artifact",
@@ -105,37 +102,32 @@ public class FilterUtilsTest {
}
@Test
- public void testFilterArtifactsShouldRemoveArtifactDirectlyExcluded()
throws Exception {
+ void filterArtifactsShouldRemoveArtifactDirectlyExcluded() throws
Exception {
verifyArtifactExclusion("group", "artifact", null, "group:artifact",
null, null);
verifyArtifactExclusion("group", "artifact", null,
"group:artifact:jar", null, null);
}
@Test
- public void
testFilterArtifactsShouldNotRemoveArtifactNotIncludedAndNotExcluded() throws
Exception {
+ void filterArtifactsShouldNotRemoveArtifactNotIncludedAndNotExcluded()
throws Exception {
verifyArtifactInclusion("group", "artifact", null, null, null, null);
verifyArtifactInclusion("group", "artifact", null, null, null, null);
}
@Test
- public void
testFilterArtifactsShouldRemoveArtifactExcludedByAdditionalFilter() throws
Exception {
- final ArtifactFilter filter = new ArtifactFilter() {
-
- public boolean include(final Artifact artifact) {
- return false;
- }
- };
+ void filterArtifactsShouldRemoveArtifactExcludedByAdditionalFilter()
throws Exception {
+ ArtifactFilter filter = artifact -> false;
verifyArtifactExclusion("group", "artifact", "fail:fail", null, null,
filter);
}
@Test
- public void testFilterProjectsShouldNotRemoveProjectDirectlyIncluded() {
+ void filterProjectsShouldNotRemoveProjectDirectlyIncluded() {
verifyProjectInclusion("group", "artifact", "group:artifact", null,
null);
verifyProjectInclusion("group", "artifact", "group:artifact:jar",
null, null);
}
@Test
- public void testFilterProjectsShouldNotRemoveProjectTransitivelyIncluded()
{
+ void filterProjectsShouldNotRemoveProjectTransitivelyIncluded() {
verifyProjectInclusion(
"group",
"artifact",
@@ -145,7 +137,7 @@ public class FilterUtilsTest {
}
@Test
- public void testFilterProjectsShouldRemoveProjectTransitivelyExcluded() {
+ void filterProjectsShouldRemoveProjectTransitivelyExcluded() {
verifyProjectExclusion(
"group",
"artifact",
@@ -155,33 +147,42 @@ public class FilterUtilsTest {
}
@Test
- public void testFilterProjectsShouldRemoveProjectDirectlyExcluded() {
+ void filterProjectsShouldRemoveProjectDirectlyExcluded() {
verifyProjectExclusion("group", "artifact", null, "group:artifact",
null);
verifyProjectExclusion("group", "artifact", null,
"group:artifact:jar", null);
}
@Test
- public void
testFilterProjectsShouldNotRemoveProjectNotIncludedAndNotExcluded() {
+ void filterProjectsShouldNotRemoveProjectNotIncludedAndNotExcluded() {
verifyProjectInclusion("group", "artifact", null, null, null);
verifyProjectInclusion("group", "artifact", null, null, null);
}
@Test
- public void testTransitiveScopes() {
- assertThat(
- FilterUtils.newScopeFilter("compile").getIncluded(),
- Matchers.containsInAnyOrder("compile", "provided", "system"));
-
- assertThat(FilterUtils.newScopeFilter("provided").getIncluded(),
Matchers.containsInAnyOrder("provided"));
-
- assertThat(FilterUtils.newScopeFilter("system").getIncluded(),
Matchers.containsInAnyOrder("system"));
-
- assertThat(
- FilterUtils.newScopeFilter("runtime").getIncluded(),
Matchers.containsInAnyOrder("compile", "runtime"));
-
- assertThat(
- FilterUtils.newScopeFilter("test").getIncluded(),
- Matchers.containsInAnyOrder("compile", "provided", "runtime",
"system", "test"));
+ void transitiveScopes() {
+ Collection<String> compileScope =
FilterUtils.newScopeFilter("compile").getIncluded();
+ assertFalse(compileScope.isEmpty());
+ assertTrue(compileScope.contains("compile"));
+ assertTrue(compileScope.contains("provided"));
+ assertTrue(compileScope.contains("system"));
+
+ Collection<String> providedScope =
+ FilterUtils.newScopeFilter("provided").getIncluded();
+ assertTrue(providedScope.contains("provided"));
+
+ Collection<String> systemScope =
FilterUtils.newScopeFilter("system").getIncluded();
+ assertTrue(systemScope.contains("system"));
+
+ Collection<String> runtimeScope =
FilterUtils.newScopeFilter("runtime").getIncluded();
+ assertTrue(runtimeScope.contains("compile"));
+ assertTrue(runtimeScope.contains("runtime"));
+
+ Collection<String> testScope =
FilterUtils.newScopeFilter("test").getIncluded();
+ assertTrue(testScope.contains("compile"));
+ assertTrue(testScope.contains("provided"));
+ assertTrue(testScope.contains("runtime"));
+ assertTrue(testScope.contains("system"));
+ assertTrue(testScope.contains("test"));
}
private void verifyArtifactInclusion(
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/utils/LineEndingsUtilsTest.java
b/src/test/java/org/apache/maven/plugins/assembly/utils/LineEndingsUtilsTest.java
index f21486d3..f3fd438a 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/utils/LineEndingsUtilsTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/utils/LineEndingsUtilsTest.java
@@ -34,61 +34,61 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
-public class LineEndingsUtilsTest {
+class LineEndingsUtilsTest {
private static final String CRLF = "\r\n";
private static final String LF = "\n";
@Test
- public void shouldWorkCauseWeTestJdkEnumConversion() {
+ void shouldWorkCauseWeTestJdkEnumConversion() {
LineEndings lineEnding = LineEndings.valueOf("windows");
assertEquals(CRLF, lineEnding.getLineEndingCharacters());
}
@Test
- public void shouldReturnDosLineEnding() {
+ void shouldReturnDosLineEnding() {
assertEquals(CRLF, LineEndings.windows.getLineEndingCharacters());
assertEquals(CRLF, LineEndings.dos.getLineEndingCharacters());
assertEquals(CRLF, LineEndings.crlf.getLineEndingCharacters());
}
@Test
- public void shouldReturnUnixLineEnding() {
+ void shouldReturnUnixLineEnding() {
assertEquals(LF, LineEndings.unix.getLineEndingCharacters());
assertEquals(LF, LineEndings.lf.getLineEndingCharacters());
}
@Test
- public void shouldReturnNullAsLineEndingForKeep() {
+ void shouldReturnNullAsLineEndingForKeep() {
assertNull(LineEndings.keep.getLineEndingCharacters());
}
@Test
- public void testGetLineEndingCharsShouldReturnDosLineEnding() throws
AssemblyFormattingException {
+ void getLineEndingCharsShouldReturnDosLineEnding() throws Exception {
assertEquals("\r\n",
LineEndingsUtils.getLineEndingCharacters("windows"));
assertEquals("\r\n", LineEndingsUtils.getLineEndingCharacters("dos"));
assertEquals("\r\n", LineEndingsUtils.getLineEndingCharacters("crlf"));
}
@Test
- public void testGetLineEndingCharsShouldReturnUnixLineEnding() throws
AssemblyFormattingException {
+ void getLineEndingCharsShouldReturnUnixLineEnding() throws Exception {
assertEquals("\n", LineEndingsUtils.getLineEndingCharacters("unix"));
assertEquals("\n", LineEndingsUtils.getLineEndingCharacters("lf"));
}
@Test
- public void testGetLineEndingCharsShouldReturnNullLineEnding() throws
AssemblyFormattingException {
+ void getLineEndingCharsShouldReturnNullLineEnding() throws Exception {
assertNull(LineEndingsUtils.getLineEndingCharacters("keep"));
}
@Test
- public void
testGetLineEndingCharsShouldThrowFormattingExceptionWithInvalidHint() {
+ void getLineEndingCharsShouldThrowFormattingExceptionWithInvalidHint() {
assertThrows(AssemblyFormattingException.class, () ->
LineEndingsUtils.getLineEndingCharacters("invalid"));
}
@Test
- public void testConvertLineEndingsShouldReplaceLFWithCRLF() throws
IOException {
+ void convertLineEndingsShouldReplaceLFWithCRLF() throws Exception {
String test = "This is a \ntest.";
String check = "This is a \r\ntest.";
@@ -96,7 +96,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsShouldReplaceLFWithCRLFAtEOF() throws
IOException {
+ void convertLineEndingsShouldReplaceLFWithCRLFAtEOF() throws Exception {
String test = "This is a \ntest.\n";
String check = "This is a \r\ntest.\r\n";
@@ -104,7 +104,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsShouldReplaceCRLFWithLF() throws
IOException {
+ void convertLineEndingsShouldReplaceCRLFWithLF() throws Exception {
String test = "This is a \r\ntest.";
String check = "This is a \ntest.";
@@ -112,7 +112,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsShouldReplaceCRLFWithLFAtEOF() throws
IOException {
+ void convertLineEndingsShouldReplaceCRLFWithLFAtEOF() throws Exception {
String test = "This is a \r\ntest.\r\n";
String check = "This is a \ntest.\n";
@@ -120,7 +120,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsShouldReplaceLFWithLF() throws
IOException {
+ void convertLineEndingsShouldReplaceLFWithLF() throws Exception {
String test = "This is a \ntest.";
String check = "This is a \ntest.";
@@ -128,7 +128,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsShouldReplaceLFWithLFAtEOF() throws
IOException {
+ void convertLineEndingsShouldReplaceLFWithLFAtEOF() throws Exception {
String test = "This is a \ntest.\n";
String check = "This is a \ntest.\n";
@@ -136,7 +136,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsShouldReplaceCRLFWithCRLF() throws
IOException {
+ void convertLineEndingsShouldReplaceCRLFWithCRLF() throws Exception {
String test = "This is a \r\ntest.";
String check = "This is a \r\ntest.";
@@ -144,7 +144,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsShouldReplaceCRLFWithCRLFAtEOF() throws
IOException {
+ void convertLineEndingsShouldReplaceCRLFWithCRLFAtEOF() throws Exception {
String test = "This is a \r\ntest.\r\n";
String check = "This is a \r\ntest.\r\n";
@@ -152,7 +152,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsLFToCRLFNoEOFForceEOF() throws
IOException {
+ void convertLineEndingsLFToCRLFNoEOFForceEOF() throws Exception {
String test = "This is a \ntest.";
String check = "This is a \r\ntest.\r\n";
@@ -160,7 +160,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsLFToCRLFWithEOFForceEOF() throws
IOException {
+ void convertLineEndingsLFToCRLFWithEOFForceEOF() throws Exception {
String test = "This is a \ntest.\n";
String check = "This is a \r\ntest.\r\n";
@@ -168,7 +168,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsLFToCRLFNoEOFStripEOF() throws
IOException {
+ void convertLineEndingsLFToCRLFNoEOFStripEOF() throws Exception {
String test = "This is a \ntest.";
String check = "This is a \r\ntest.";
@@ -176,7 +176,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsLFToCRLFWithEOFStripEOF() throws
IOException {
+ void convertLineEndingsLFToCRLFWithEOFStripEOF() throws Exception {
String test = "This is a \ntest.\n";
String check = "This is a \r\ntest.";
@@ -184,7 +184,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsCRLFToLFNoEOFForceEOF() throws
IOException {
+ void convertLineEndingsCRLFToLFNoEOFForceEOF() throws Exception {
String test = "This is a \r\ntest.";
String check = "This is a \ntest.\n";
@@ -192,7 +192,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsCRLFToLFWithEOFForceEOF() throws
IOException {
+ void convertLineEndingsCRLFToLFWithEOFForceEOF() throws Exception {
String test = "This is a \r\ntest.\r\n";
String check = "This is a \ntest.\n";
@@ -200,7 +200,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsCRLFToLFNoEOFStripEOF() throws
IOException {
+ void convertLineEndingsCRLFToLFNoEOFStripEOF() throws Exception {
String test = "This is a \r\ntest.";
String check = "This is a \ntest.";
@@ -208,7 +208,7 @@ public class LineEndingsUtilsTest {
}
@Test
- public void testConvertLineEndingsCRLFToLFWithEOFStripEOF() throws
IOException {
+ void convertLineEndingsCRLFToLFWithEOFStripEOF() throws Exception {
String test = "This is a \r\ntest.\r\n";
String check = "This is a \ntest.";
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/utils/LinuxLineFeedInputStreamTest.java
b/src/test/java/org/apache/maven/plugins/assembly/utils/LinuxLineFeedInputStreamTest.java
index 849d287c..5f924894 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/utils/LinuxLineFeedInputStreamTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/utils/LinuxLineFeedInputStreamTest.java
@@ -25,40 +25,40 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
-public class LinuxLineFeedInputStreamTest {
+class LinuxLineFeedInputStreamTest {
@Test
- public void testSimpleString() throws Exception {
+ void simpleString() throws Exception {
assertEquals("abc\n", roundtrip("abc"));
}
@Test
- public void testInTheMiddleOfTheLine() throws Exception {
+ void inTheMiddleOfTheLine() throws Exception {
assertEquals("a\nbc\n", roundtrip("a\r\nbc"));
}
@Test
- public void testCrOnly() throws Exception {
+ void crOnly() throws Exception {
assertEquals("a\nb\n", roundtrip("a\rb"));
}
@Test
- public void testCrAtEnd() throws Exception {
+ void crAtEnd() throws Exception {
assertEquals("a\n", roundtrip("a\r"));
}
@Test
- public void testMultipleBlankLines() throws Exception {
+ void multipleBlankLines() throws Exception {
assertEquals("a\n\nbc\n", roundtrip("a\r\n\r\nbc"));
}
@Test
- public void testTwoLinesAtEnd() throws Exception {
+ void twoLinesAtEnd() throws Exception {
assertEquals("a\n\n", roundtrip("a\r\n\r\n"));
}
@Test
- public void testRetainLineFeed() throws Exception {
+ void retainLineFeed() throws Exception {
assertEquals("a\n\n", roundtrip("a\r\n\r\n", false));
assertEquals("a", roundtrip("a", false));
}
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/utils/ProjectUtilsTest.java
b/src/test/java/org/apache/maven/plugins/assembly/utils/ProjectUtilsTest.java
index 4bdd6e54..c2bef87d 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/utils/ProjectUtilsTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/utils/ProjectUtilsTest.java
@@ -19,7 +19,6 @@
package org.apache.maven.plugins.assembly.utils;
import java.io.File;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -37,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
-public class ProjectUtilsTest {
+class ProjectUtilsTest {
private final Logger logger = LoggerFactory.getLogger(getClass());
private MavenProject createTestProject(final String artifactId, final
String groupId, final String version) {
@@ -50,7 +49,7 @@ public class ProjectUtilsTest {
}
@Test
- public void
testGetProjectModulesShouldIncludeDirectModuleOfMasterProject() throws
IOException {
+ void getProjectModulesShouldIncludeDirectModuleOfMasterProject() throws
Exception {
final MavenProject master = createTestProject("test", "testGroup",
"1.0");
master.setFile(new File("pom.xml"));
@@ -74,7 +73,7 @@ public class ProjectUtilsTest {
}
@Test
- public void testGetProjectModulesShouldNotIncludeMasterProject() throws
IOException {
+ void getProjectModulesShouldNotIncludeMasterProject() throws Exception {
final MavenProject master = createTestProject("test", "testGroup",
"1.0");
final Set<MavenProject> result =
@@ -85,8 +84,7 @@ public class ProjectUtilsTest {
}
@Test
- public void
testGetProjectModulesShouldIncludeInDirectModuleOfMasterWhenIncludeSubModulesIsTrue()
- throws IOException {
+ void
getProjectModulesShouldIncludeInDirectModuleOfMasterWhenIncludeSubModulesIsTrue()
throws Exception {
final MavenProject master = createTestProject("test", "testGroup",
"1.0");
master.setFile(new File("project/pom.xml"));
@@ -121,8 +119,7 @@ public class ProjectUtilsTest {
}
@Test
- public void
testGetProjectModulesShouldExcludeInDirectModuleOfMasterWhenIncludeSubModulesIsFalse()
- throws IOException {
+ void
getProjectModulesShouldExcludeInDirectModuleOfMasterWhenIncludeSubModulesIsFalse()
throws Exception {
final MavenProject master = createTestProject("test", "testGroup",
"1.0");
master.setFile(new File("project/pom.xml"));
@@ -158,7 +155,7 @@ public class ProjectUtilsTest {
}
@Test
- public void testGetProjectModulesShouldExcludeNonModuleOfMasterProject()
throws IOException {
+ void getProjectModulesShouldExcludeNonModuleOfMasterProject() throws
Exception {
final MavenProject master = createTestProject("test", "testGroup",
"1.0");
master.setFile(new File("project/pom.xml"));
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/utils/TypeConversionUtilsTest.java
b/src/test/java/org/apache/maven/plugins/assembly/utils/TypeConversionUtilsTest.java
index d4b46b8d..4e3faa0c 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/utils/TypeConversionUtilsTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/utils/TypeConversionUtilsTest.java
@@ -33,11 +33,11 @@ import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-public class TypeConversionUtilsTest {
+class TypeConversionUtilsTest {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Test
- public void testModeToIntInterpretAsOctalWithoutLeadingZero() throws
AssemblyFormattingException {
+ void modeToIntInterpretAsOctalWithoutLeadingZero() throws Exception {
final int check = Integer.decode("0777");
final int test = TypeConversionUtils.modeToInt("777", logger);
@@ -45,7 +45,7 @@ public class TypeConversionUtilsTest {
}
@Test
- public void testModeToIntInterpretValuesWithLeadingZeroAsOctal() throws
AssemblyFormattingException {
+ void modeToIntInterpretValuesWithLeadingZeroAsOctal() throws Exception {
final int check = Integer.decode("0777");
final int test = TypeConversionUtils.modeToInt("0777", logger);
@@ -53,7 +53,7 @@ public class TypeConversionUtilsTest {
}
@Test
- public void testModeToIntFailOnInvalidOctalValue() {
+ void modeToIntFailOnInvalidOctalValue() {
try {
TypeConversionUtils.modeToInt("493", logger);
@@ -64,7 +64,7 @@ public class TypeConversionUtilsTest {
}
@Test
- public void testVerifyModeSanityWarnOnNonsensicalOctalValue002() {
+ void verifyModeSanityWarnOnNonsensicalOctalValue002() {
final List<String> messages = new ArrayList<>(2);
messages.add("World has write access, but user does not.");
messages.add("World has write access, but group does not.");
@@ -73,7 +73,7 @@ public class TypeConversionUtilsTest {
}
@Test
- public void testVerifyModeSanityWarnOnNonsensicalOctalValue020() {
+ void verifyModeSanityWarnOnNonsensicalOctalValue020() {
final List<String> messages = new ArrayList<>(1);
messages.add("Group has write access, but user does not.");
@@ -81,7 +81,7 @@ public class TypeConversionUtilsTest {
}
@Test
- public void testVerifyModeSanityReturnTrueForValidOctalValue775() {
+ void verifyModeSanityReturnTrueForValidOctalValue775() {
checkFileModeSanity("775", true, null);
}
diff --git
a/src/test/java/org/apache/maven/plugins/assembly/utils/WindowsLineFeedInputStreamTest.java
b/src/test/java/org/apache/maven/plugins/assembly/utils/WindowsLineFeedInputStreamTest.java
index da8b0213..5f826ba2 100644
---
a/src/test/java/org/apache/maven/plugins/assembly/utils/WindowsLineFeedInputStreamTest.java
+++
b/src/test/java/org/apache/maven/plugins/assembly/utils/WindowsLineFeedInputStreamTest.java
@@ -25,41 +25,41 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
-public class WindowsLineFeedInputStreamTest {
+class WindowsLineFeedInputStreamTest {
@Test
- public void testSimpleString() throws Exception {
+ void simpleString() throws Exception {
assertEquals("abc\r\n", roundtrip("abc"));
}
@Test
- public void testInTheMiddleOfTheLine() throws Exception {
+ void inTheMiddleOfTheLine() throws Exception {
assertEquals("a\r\nbc\r\n", roundtrip("a\r\nbc"));
}
@Test
- public void testMultipleBlankLines() throws Exception {
+ void multipleBlankLines() throws Exception {
assertEquals("a\r\n\r\nbc\r\n", roundtrip("a\r\n\r\nbc"));
}
@Test
- public void testTwoLinesAtEnd() throws Exception {
+ void twoLinesAtEnd() throws Exception {
assertEquals("a\r\n\r\n", roundtrip("a\r\n\r\n"));
}
@Test
- public void testLinuxLinefeeds() throws Exception {
+ void linuxLinefeeds() throws Exception {
final String roundtrip = roundtrip("ab\nc", false);
assertEquals("ab\r\nc", roundtrip);
}
@Test
- public void testMalformed() throws Exception {
+ void malformed() throws Exception {
assertEquals("a\rbc", roundtrip("a\rbc", false));
}
@Test
- public void testRetainLineFeed() throws Exception {
+ void retainLineFeed() throws Exception {
assertEquals("a\r\n\r\n", roundtrip("a\r\n\r\n", false));
assertEquals("a", roundtrip("a", false));
}