File tree Expand file tree Collapse file tree
src/test/java/pl/project13/maven/git Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020import org .apache .commons .io .FileUtils ;
2121import org .apache .maven .execution .MavenSession ;
2222import org .apache .maven .project .MavenProject ;
23+ import org .apache .maven .settings .Settings ;
2324import org .eclipse .jgit .api .Git ;
2425import org .junit .After ;
2526import org .junit .Before ;
@@ -116,6 +117,7 @@ public static void initializeMojoWithDefaults(GitCommitIdMojo mojo) {
116117 mojo .evaluateOnCommit = evaluateOnCommit ;
117118 mojo .nativeGitTimeoutInMs = (30 * 1000 );
118119 mojo .session = mockSession ();
120+ mojo .settings = mockSettings ();
119121 }
120122
121123 public void setProjectToExecuteMojoIn (@ Nonnull MavenProject project ) {
@@ -131,6 +133,12 @@ private static MavenSession mockSession() {
131133 return session ;
132134 }
133135
136+ private static Settings mockSettings () {
137+ Settings settings = mock (Settings .class );
138+ when (settings .isOffline ()).thenReturn (false );
139+ return settings ;
140+ }
141+
134142 private static List <MavenProject > getReactorProjects (@ Nonnull MavenProject project ) {
135143 List <MavenProject > reactorProjects = new ArrayList <>();
136144 MavenProject mavenProject = project ;
You can’t perform that action at this time.
0 commit comments