19
19
package pl .project13 .maven .git ;
20
20
21
21
import java .nio .file .Files ;
22
-
23
22
import junitparams .JUnitParamsRunner ;
24
23
import junitparams .Parameters ;
25
24
import org .apache .maven .project .MavenProject ;
@@ -34,7 +33,8 @@ public class GitSubmodulesTest extends GitIntegrationTest {
34
33
35
34
@ Test
36
35
@ Parameters (method = "useNativeGit" )
37
- public void shouldResolvePropertiesOnDefaultSettingsForNonPomProject (boolean useNativeGit ) throws Exception {
36
+ public void shouldResolvePropertiesOnDefaultSettingsForNonPomProject (
37
+ boolean useNativeGit ) throws Exception {
38
38
mavenSandbox
39
39
.withParentProject ("my-jar-project" , "jar" )
40
40
.withGitRepoInParent (AvailableGitTestRepo .WITH_SUBMODULES )
@@ -57,18 +57,19 @@ public void shouldResolvePropertiesOnDefaultSettingsForNonPomProject(boolean use
57
57
public void shouldGeneratePropertiesWithSubmodules (boolean useNativeGit ) throws Exception {
58
58
// given
59
59
mavenSandbox
60
- .withParentProject ("my-pom-project" , "pom" )
61
- .withGitRepoInParent (AvailableGitTestRepo .WITH_REMOTE_SUBMODULES )
62
- .withChildProject ("remote-module" , "jar" )
63
- .create ();
60
+ .withParentProject ("my-pom-project" , "pom" )
61
+ .withGitRepoInParent (AvailableGitTestRepo .WITH_REMOTE_SUBMODULES )
62
+ .withChildProject ("remote-module" , "jar" )
63
+ .create ();
64
64
MavenProject targetProject = mavenSandbox .getChildProject ();
65
65
setProjectToExecuteMojoIn (targetProject );
66
66
67
- // create a relative pointer to trigger the relative path logic in GitDirLocator#lookupGitDirectory
67
+ // create a relative pointer to trigger the relative path logic in
68
+ // GitDirLocator#lookupGitDirectory
68
69
// makes the dotGitDirectory look like "my-pom-project/.git/modules/remote-module"
69
70
Files .write (
70
- mavenSandbox .getChildProject ().getBasedir ().toPath ().resolve (".git" ),
71
- "gitdir: ../.git/modules/remote-module" .getBytes ()
71
+ mavenSandbox .getChildProject ().getBasedir ().toPath ().resolve (".git" ),
72
+ "gitdir: ../.git/modules/remote-module" .getBytes ()
72
73
);
73
74
74
75
mojo .useNativeGit = useNativeGit ;
@@ -77,6 +78,7 @@ public void shouldGeneratePropertiesWithSubmodules(boolean useNativeGit) throws
77
78
mojo .execute ();
78
79
79
80
// then
80
- assertPropertyPresentAndEqual (targetProject .getProperties (), "git.commit.id.abbrev" , "945bfe6" );
81
+ assertPropertyPresentAndEqual (
82
+ targetProject .getProperties (), "git.commit.id.abbrev" , "945bfe6" );
81
83
}
82
84
}
0 commit comments