Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions maven-wrapper-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ under the License.
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>${version.maven-plugin-tools}</version>
<scope>provided</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@
package org.apache.maven.plugins.wrapper;

import org.apache.maven.settings.Settings;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayNameGeneration;
import org.junit.jupiter.api.DisplayNameGenerator;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;

@DisplayNameGeneration(DisplayNameGenerator.ReplaceUnderscores.class)
class WrapperMojoTest {

@Test
void user_supplied_repo_url_gets_trailing_slash_trimmed() {
void userSuppliedRepoUrlGetsTrailingSlashTrimmed() {
// given
Settings settings = new Settings();
WrapperMojo wrapperMojo = new WrapperMojo();
Expand All @@ -39,11 +35,11 @@ void user_supplied_repo_url_gets_trailing_slash_trimmed() {
String determinedRepoUrl = wrapperMojo.determineRepoUrl(WrapperMojo.DEFAULT_REPOURL + "/", settings);

// then
Assertions.assertEquals(WrapperMojo.DEFAULT_REPOURL, determinedRepoUrl);
assertEquals(WrapperMojo.DEFAULT_REPOURL, determinedRepoUrl);
}

@Test
void null_repo_url_not_used() {
void nullRepoUrlNotUsed() {
// given
Settings settings = new Settings();
WrapperMojo wrapperMojo = new WrapperMojo();
Expand All @@ -52,11 +48,11 @@ void null_repo_url_not_used() {
String determinedRepoUrl = wrapperMojo.determineRepoUrl(null, settings);

// then
Assertions.assertEquals(WrapperMojo.DEFAULT_REPOURL, determinedRepoUrl);
assertEquals(WrapperMojo.DEFAULT_REPOURL, determinedRepoUrl);
}

@Test
void empty_repo_url_not_used() {
void emptyRepoUrlNotUsed() {
// given
Settings settings = new Settings();
WrapperMojo wrapperMojo = new WrapperMojo();
Expand All @@ -65,11 +61,11 @@ void empty_repo_url_not_used() {
String determinedRepoUrl = wrapperMojo.determineRepoUrl("", settings);

// then
Assertions.assertEquals(WrapperMojo.DEFAULT_REPOURL, determinedRepoUrl);
assertEquals(WrapperMojo.DEFAULT_REPOURL, determinedRepoUrl);
}

@Test
void slash_repo_url_not_used() {
void slashRepoUrlNotUsed() {
// given
Settings settings = new Settings();
WrapperMojo wrapperMojo = new WrapperMojo();
Expand All @@ -78,6 +74,6 @@ void slash_repo_url_not_used() {
String determinedRepoUrl = wrapperMojo.determineRepoUrl("/", settings);

// then
Assertions.assertEquals(WrapperMojo.DEFAULT_REPOURL, determinedRepoUrl);
assertEquals(WrapperMojo.DEFAULT_REPOURL, determinedRepoUrl);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public class HashAlgorithmVerifierTest {

@TempDir
public File temporaryFolder;
private File temporaryFolder;

private Verifier verifier = new HashAlgorithmVerifier();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
*/
public class InstallerTest {
@TempDir
public File tempFolder;
private File tempFolder;

private Path testDir;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void testRelativeDistUrl() throws Exception {
}

@Test
void testEnvironmentVariableOverwrite_simpleCase() throws Exception {
void testEnvironmentVariableOverwriteSimpleCase() throws Exception {
final Map<String, String> environmentVariables = new HashMap<>();
environmentVariables.put(MVNW_REPOURL, "https://repo/test");

Expand All @@ -206,7 +206,7 @@ void testEnvironmentVariableOverwrite_simpleCase() throws Exception {
}

@Test
void testEnvironmentVariableOverwrite_mvnwRepoUrl_trailingSlash() throws Exception {
void testEnvironmentVariableOverwriteMvnwRepoUrlTrailingSlash() throws Exception {
final Map<String, String> environmentVariables = new HashMap<>();
environmentVariables.put(MVNW_REPOURL, "https://repo/test/");
properties = new Properties();
Expand All @@ -220,7 +220,7 @@ void testEnvironmentVariableOverwrite_mvnwRepoUrl_trailingSlash() throws Excepti
}

@Test
void testEnvironmentVariableOverwrite_packageName() throws Exception {
void testEnvironmentVariableOverwritePackageName() throws Exception {
final Map<String, String> environmentVariables = new HashMap<>();
environmentVariables.put(MVNW_REPOURL, "https://repo/test");
properties = new Properties();
Expand All @@ -235,7 +235,7 @@ void testEnvironmentVariableOverwrite_packageName() throws Exception {
}

@Test
void testEnvironmentVariableOverwrite_packageName_trailingSpace() throws Exception {
void testEnvironmentVariableOverwritePackageNameTrailingSpace() throws Exception {
final Map<String, String> environmentVariables = new HashMap<>();
environmentVariables.put(MVNW_REPOURL, "https://repo/test/");
properties = new Properties();
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
<version>42</version>
<version>45</version>
</parent>

<groupId>org.apache.maven.wrapper</groupId>
Expand Down
Loading