You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2020/04/21 20:12:46 UTC
[maven-assembly-plugin] branch setupInterpolators updated: More
configSources converted to Mockito
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch setupInterpolators
in repository https://gitbox.apache.org/repos/asf/maven-assembly-plugin.git
The following commit(s) were added to refs/heads/setupInterpolators by this push:
new 5472d3e More configSources converted to Mockito
5472d3e is described below
commit 5472d3ec64eec0bb4ddaaa8ad11d93d7ef89a306
Author: rfscholte <rf...@apache.org>
AuthorDate: Tue Apr 21 22:12:37 2020 +0200
More configSources converted to Mockito
---
.../archive/DefaultAssemblyArchiverTest.java | 78 ++++++++-------------
.../phase/DependencySetAssemblyPhaseTest.java | 17 ++---
.../archive/phase/ModuleSetAssemblyPhaseTest.java | 8 +--
.../archive/phase/RepositoryAssemblyPhaseTest.java | 79 ++++------------------
.../archive/task/AddDependencySetsTaskTest.java | 7 +-
.../assembly/utils/AssemblyFormatUtilsTest.java | 18 ++---
6 files changed, 57 insertions(+), 150 deletions(-)
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 93a7401..f38eb31 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
@@ -111,8 +111,7 @@ public class DefaultAssemblyArchiverTest
final MockAndControlForAssemblyArchiver macMgr = new MockAndControlForAssemblyArchiver( mm );
- final AssemblerConfigurationSource configSource =
- mm.createControl().createMock( AssemblerConfigurationSource.class );
+ final AssemblerConfigurationSource configSource = mock( AssemblerConfigurationSource.class );
mm.replayAll();
@@ -138,14 +137,11 @@ public class DefaultAssemblyArchiverTest
phase.execute( (Assembly) anyObject(), (Archiver) anyObject(), (AssemblerConfigurationSource) anyObject() );
- final AssemblerConfigurationSource configSource =
- mm.createControl().createMock( AssemblerConfigurationSource.class );
+ final AssemblerConfigurationSource configSource = mock( AssemblerConfigurationSource.class );
final File tempDir = new File ( temporaryFolder.getRoot(), "temp" );
- expect( configSource.getTemporaryRootDirectory() ).andReturn( tempDir ).anyTimes();
- expect( configSource.isDryRun() ).andReturn( false ).anyTimes();
- expect( configSource.isIgnoreDirFormatExtensions() ).andReturn( false ).anyTimes();
+ when( configSource.getTemporaryRootDirectory() ).thenReturn( tempDir );
final File outDir = temporaryFolder.newFolder( "out" );
@@ -160,16 +156,13 @@ public class DefaultAssemblyArchiverTest
fail( "Should never happen" );
}
- expect( configSource.getOverrideUid() ).andReturn( 0 ).atLeastOnce();
- expect( configSource.getOverrideUserName() ).andReturn( "root" ).atLeastOnce();
- expect( configSource.getOverrideGid() ).andReturn( 0 ).atLeastOnce();
- expect( configSource.getOverrideGroupName() ).andReturn( "root" ).atLeastOnce();
- expect( configSource.getOutputDirectory() ).andReturn( outDir );
- expect( configSource.getFinalName() ).andReturn( "finalName" );
- expect( configSource.getArchiverConfig() ).andReturn( null ).anyTimes();
- expect( configSource.getWorkingDirectory() ).andReturn( new File( "." ) ).anyTimes();
- expect( configSource.isUpdateOnly() ).andReturn( false ).anyTimes();
- expect( configSource.isIgnorePermissions() ).andReturn( false ).anyTimes();
+ when( configSource.getOverrideUid() ).thenReturn( 0 );
+ when( configSource.getOverrideUserName() ).thenReturn( "root" );
+ when( configSource.getOverrideGid() ).thenReturn( 0 );
+ when( configSource.getOverrideGroupName() ).thenReturn( "root" );
+ when( configSource.getOutputDirectory() ).thenReturn( outDir );
+ when( configSource.getFinalName() ).thenReturn( "finalName" );
+ when( configSource.getWorkingDirectory() ).thenReturn( new File( "." ) );
final Assembly assembly = new Assembly();
assembly.setId( "id" );
@@ -249,12 +242,9 @@ public class DefaultAssemblyArchiverTest
macArchiverManager.expectGetArchiver( "tar", ttArchiver );
- final AssemblerConfigurationSource configSource = mm.createMock( AssemblerConfigurationSource.class );
-
- expect( configSource.getTarLongFileMode() ).andReturn( TarLongFileMode.fail.toString() ).anyTimes();
- expect( configSource.isDryRun() ).andReturn( false ).anyTimes();
+ final AssemblerConfigurationSource configSource = mock( AssemblerConfigurationSource.class );
- expect( configSource.getArchiverConfig() ).andReturn( null ).anyTimes();
+ when( configSource.getTarLongFileMode() ).thenReturn( TarLongFileMode.fail.toString() );
final DefaultAssemblyArchiver subject = setupStdExpectations( mm, macArchiverManager, configSource );
@@ -270,20 +260,14 @@ public class DefaultAssemblyArchiverTest
MockAndControlForAssemblyArchiver macArchiverManager,
AssemblerConfigurationSource configSource )
{
- expect( configSource.getProject() ).andReturn( new MavenProject( new Model() ) ).anyTimes();
-
- expect( configSource.getJarArchiveConfiguration() ).andReturn( null ).anyTimes();
-
- expect( configSource.getWorkingDirectory() ).andReturn( new File( "." ) ).anyTimes();
-
- expect( configSource.isUpdateOnly() ).andReturn( false ).anyTimes();
-
- expect( configSource.isIgnorePermissions() ).andReturn( true ).anyTimes();
+ when( configSource.getProject() ).thenReturn( new MavenProject( new Model() ) );
+ when( configSource.getWorkingDirectory() ).thenReturn( new File( "." ) );
+ when( configSource.isIgnorePermissions() ).thenReturn( true );
- expect( configSource.getOverrideUid() ).andReturn( 0 ).atLeastOnce();
- expect( configSource.getOverrideUserName() ).andReturn( "root" ).atLeastOnce();
- expect( configSource.getOverrideGid() ).andReturn( 0 ).atLeastOnce();
- expect( configSource.getOverrideGroupName() ).andReturn( "root" ).atLeastOnce();
+ when( configSource.getOverrideUid() ).thenReturn( 0 );
+ when( configSource.getOverrideUserName() ).thenReturn( "root" );
+ when( configSource.getOverrideGid() ).thenReturn( 0 );
+ when( configSource.getOverrideGroupName() ).thenReturn( "root" );
mm.replayAll();
@@ -302,11 +286,8 @@ public class DefaultAssemblyArchiverTest
macArchiverManager.expectGetArchiver( "war", twArchiver );
- final AssemblerConfigurationSource configSource = mm.createMock( AssemblerConfigurationSource.class );
+ final AssemblerConfigurationSource configSource = mock( AssemblerConfigurationSource.class );
- expect( configSource.isDryRun() ).andReturn( false ).anyTimes();
- expect( configSource.getArchiverConfig() ).andReturn( null ).anyTimes();
- expect( configSource.getMavenSession() ).andReturn( null ).anyTimes();
final DefaultAssemblyArchiver subject = setupStdExpectations( mm, macArchiverManager, configSource );
subject.createArchiver( "war", false, null, configSource, null, false, null, null );
@@ -326,19 +307,14 @@ public class DefaultAssemblyArchiverTest
macArchiverManager.expectGetArchiver( "zip", archiver );
- final AssemblerConfigurationSource configSource = mm.createMock( AssemblerConfigurationSource.class );
-
- expect( configSource.isDryRun() ).andReturn( false ).anyTimes();
- expect( configSource.getArchiverConfig() ).andReturn( null ).anyTimes();
- expect( configSource.getWorkingDirectory() ).andReturn( new File( "." ) ).anyTimes();
- expect( configSource.isUpdateOnly() ).andReturn( false ).anyTimes();
- expect( configSource.getJarArchiveConfiguration() ).andReturn( null ).anyTimes();
- expect( configSource.isIgnorePermissions() ).andReturn( true ).anyTimes();
+ final AssemblerConfigurationSource configSource = mock( AssemblerConfigurationSource.class );
- expect( configSource.getOverrideUid() ).andReturn( 0 ).atLeastOnce();
- expect( configSource.getOverrideUserName() ).andReturn( "root" ).atLeastOnce();
- expect( configSource.getOverrideGid() ).andReturn( 0 ).atLeastOnce();
- expect( configSource.getOverrideGroupName() ).andReturn( "root" ).atLeastOnce();
+ when( configSource.getWorkingDirectory() ).thenReturn( new File( "." ) );
+ when( configSource.isIgnorePermissions() ).thenReturn( true );
+ when( configSource.getOverrideUid() ).thenReturn( 0 );
+ when( configSource.getOverrideUserName() ).thenReturn( "root" );
+ when( configSource.getOverrideGid() ).thenReturn( 0 );
+ when( configSource.getOverrideGroupName() ).thenReturn( "root" );
mm.replayAll();
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 5b4e0ad..35a29a5 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
@@ -82,7 +82,7 @@ public class DependencySetAssemblyPhaseTest
final MockAndControlForAddDependencySetsTask macTask =
new MockAndControlForAddDependencySetsTask( mm, project );
- AssemblerConfigurationSource configSource = mm.createMock( AssemblerConfigurationSource.class );
+ AssemblerConfigurationSource configSource = mock( AssemblerConfigurationSource.class );
MavenSession session = mock( MavenSession.class );
when( session.getProjectBuildingRequest() ).thenReturn( mock( ProjectBuildingRequest.class ) );
@@ -90,18 +90,14 @@ public class DependencySetAssemblyPhaseTest
when( session.getUserProperties() ).thenReturn( new Properties() );
when( session.getExecutionProperties() ).thenReturn( new Properties() );
- expect( configSource.getProject() ).andReturn( project ).anyTimes();
- expect( configSource.getMavenSession() ).andReturn( session ).anyTimes();
-
- expect( configSource.getLocalRepository() ).andReturn( null ).anyTimes();
- expect( configSource.getRemoteRepositories() ).andReturn( null ).anyTimes();
+ when( configSource.getProject() ).thenReturn( project );
+ when( configSource.getMavenSession() ).thenReturn( session );
macTask.expectGetDestFile( new File( "junk" ) );
-// macTask.expectAddFile( artifactFile, "out/dep", 10 );
project.setArtifacts( Collections.singleton( artifact ) );
- expect( configSource.getFinalName() ).andReturn( "final-name" ).anyTimes();
+ when( configSource.getFinalName() ).thenReturn( "final-name" );
final Logger logger = new ConsoleLogger( Logger.LEVEL_DEBUG, "test" );
@@ -142,7 +138,7 @@ public class DependencySetAssemblyPhaseTest
final Logger logger = new ConsoleLogger( Logger.LEVEL_DEBUG, "test" );
final MockAndControlForAddDependencySetsTask macTask = new MockAndControlForAddDependencySetsTask( mm, null );
- AssemblerConfigurationSource configSource = mm.createMock( AssemblerConfigurationSource.class );
+ AssemblerConfigurationSource configSource = mock( AssemblerConfigurationSource.class );
MavenSession session = mock( MavenSession.class );
when( session.getProjectBuildingRequest() ).thenReturn( mock( ProjectBuildingRequest.class ) );
@@ -150,8 +146,7 @@ public class DependencySetAssemblyPhaseTest
when( session.getUserProperties() ).thenReturn( new Properties() );
when( session.getExecutionProperties() ).thenReturn( new Properties() );
- expect( configSource.getProject() ).andReturn( null ).anyTimes();
- expect( configSource.getMavenSession() ).andReturn( session ).anyTimes();
+ when( configSource.getMavenSession() ).thenReturn( session );
macTask.expectResolveDependencySets();
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 ddee59a..8b63c1b 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
@@ -324,9 +324,7 @@ public class ModuleSetAssemblyPhaseTest
final EasyMockSupport mm = new EasyMockSupport();
final MockAndControlForAddArtifactTask macTask = new MockAndControlForAddArtifactTask( mm );
- AssemblerConfigurationSource configSource = mm.createMock( AssemblerConfigurationSource.class );
- expect( configSource.getProject() ).andReturn( null ).anyTimes();
- expect( configSource.getMavenSession() ).andReturn( null ).anyTimes();
+ AssemblerConfigurationSource configSource = mock( AssemblerConfigurationSource.class );
final ModuleBinaries binaries = new ModuleBinaries();
@@ -409,9 +407,7 @@ public class ModuleSetAssemblyPhaseTest
final EasyMockSupport mm = new EasyMockSupport();
final MockAndControlForAddArtifactTask macTask = new MockAndControlForAddArtifactTask( mm );
- AssemblerConfigurationSource configSource = mm.createMock( AssemblerConfigurationSource.class );
- expect( configSource.getProject() ).andReturn( null ).anyTimes();
- expect( configSource.getMavenSession() ).andReturn( null ).anyTimes();
+ AssemblerConfigurationSource configSource = mock( AssemblerConfigurationSource.class );
Artifact artifact = mock( Artifact.class );
when( artifact.getClassifier() ).thenReturn( "test" );
diff --git a/src/test/java/org/apache/maven/plugins/assembly/archive/phase/RepositoryAssemblyPhaseTest.java b/src/test/java/org/apache/maven/plugins/assembly/archive/phase/RepositoryAssemblyPhaseTest.java
index 3f38c97..2989470 100644
--- a/src/test/java/org/apache/maven/plugins/assembly/archive/phase/RepositoryAssemblyPhaseTest.java
+++ b/src/test/java/org/apache/maven/plugins/assembly/archive/phase/RepositoryAssemblyPhaseTest.java
@@ -22,6 +22,8 @@ package org.apache.maven.plugins.assembly.archive.phase;
import static org.easymock.EasyMock.anyObject;
import static org.easymock.EasyMock.expect;
import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
import java.io.File;
@@ -61,11 +63,11 @@ public class RepositoryAssemblyPhaseTest
final MockAndControlForRepositoryAssembler macRepo = new MockAndControlForRepositoryAssembler( mm );
final MockAndControlForArchiver macArchiver = new MockAndControlForArchiver( mm );
- final MockAndControlForConfigSource macCS = new MockAndControlForConfigSource( mm );
+ final AssemblerConfigurationSource configSource = mock( AssemblerConfigurationSource.class );
final File tempRoot = temporaryFolder.getRoot();
- macCS.expectGetTemporaryRootDirectory( tempRoot );
+ when( configSource.getTemporaryRootDirectory() ).thenReturn( tempRoot );
final Assembly assembly = new Assembly();
@@ -75,8 +77,7 @@ public class RepositoryAssemblyPhaseTest
createPhase( macRepo.repositoryAssembler, new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) ).execute( assembly,
macArchiver.archiver,
- macCS
- .configSource );
+ configSource );
mm.verifyAll();
}
@@ -89,14 +90,16 @@ public class RepositoryAssemblyPhaseTest
final MockAndControlForRepositoryAssembler macRepo = new MockAndControlForRepositoryAssembler( mm );
final MockAndControlForArchiver macArchiver = new MockAndControlForArchiver( mm );
- final MockAndControlForConfigSource macCS = new MockAndControlForConfigSource( mm );
+ final AssemblerConfigurationSource configSource = mock( AssemblerConfigurationSource.class );
final File tempRoot = temporaryFolder.getRoot();
- macCS.expectGetTemporaryRootDirectory( tempRoot );
- macCS.expectGetProject( new MavenProject( new Model() ) );
- macCS.expectGetFinalName( "final-name" );
- macCS.expectInterpolators();
+ when( configSource.getTemporaryRootDirectory() ).thenReturn( tempRoot );
+ when( configSource.getProject() ).thenReturn( new MavenProject( new Model() ) );
+ when( configSource.getFinalName() ).thenReturn( "final-name" );
+ when( configSource.getCommandLinePropsInterpolator() ).thenReturn( FixedStringSearchInterpolator.empty() );
+ when( configSource.getEnvInterpolator() ).thenReturn( FixedStringSearchInterpolator.empty() );
+ when( configSource.getMainProjectInterpolator() ).thenReturn( FixedStringSearchInterpolator.empty() );
final Assembly assembly = new Assembly();
@@ -123,8 +126,7 @@ public class RepositoryAssemblyPhaseTest
createPhase( macRepo.repositoryAssembler, new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) ).execute( assembly,
macArchiver.archiver,
- macCS
- .configSource );
+ configSource );
mm.verifyAll();
}
@@ -184,61 +186,6 @@ public class RepositoryAssemblyPhaseTest
archiver.setDirectoryMode( defaultDirMode );
archiver.setFileMode( defaultFileMode );
}
-
- // public void expectAddFile( File file, String outputLocation, int fileMode )
- // {
- // try
- // {
- // archiver.addFile( file, outputLocation, fileMode );
- // }
- // catch ( ArchiverException e )
- // {
- // Assert.fail( "Should never happen." );
- // }
- // }
- }
-
- private final class MockAndControlForConfigSource
- {
- final AssemblerConfigurationSource configSource;
-
- public MockAndControlForConfigSource( final EasyMockSupport mockManager )
- {
- configSource = mockManager.createMock( AssemblerConfigurationSource.class );
-
- expect( configSource.getMavenSession() ).andReturn( null ).anyTimes();
- }
-
- public void expectGetProject( final MavenProject project )
- {
- expect( configSource.getProject() ).andReturn( project ).atLeastOnce();
- }
-
- public void expectGetFinalName( final String finalName )
- {
- expect( configSource.getFinalName() ).andReturn( finalName ).atLeastOnce();
- }
-
- public void expectInterpolators()
- {
- expect( configSource.getCommandLinePropsInterpolator() ).andReturn(
- FixedStringSearchInterpolator.empty() ).anyTimes();
- expect( configSource.getEnvInterpolator() ).andReturn( FixedStringSearchInterpolator.empty() ).anyTimes();
- expect( configSource.getMainProjectInterpolator() ).andReturn(
- FixedStringSearchInterpolator.empty() ).anyTimes();
- }
-
- public void expectGetTemporaryRootDirectory( final File tempRoot )
- {
- expect( configSource.getTemporaryRootDirectory() ).andReturn( tempRoot ).atLeastOnce();
- }
-
- //
- // public void expectGetBasedir( File basedir )
- // {
- // configSource.getBasedir();
- // control.setReturnValue( basedir, MockControl.ONE_OR_MORE );
- // }
}
private final class MockAndControlForRepositoryAssembler
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 d25da20..3ca8d11 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
@@ -1,7 +1,5 @@
package org.apache.maven.plugins.assembly.archive.task;
-import static org.easymock.EasyMock.expect;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -152,7 +150,7 @@ public class AddDependencySetsTaskTest
final MockAndControlForAddDependencySetsTask macTask =
new MockAndControlForAddDependencySetsTask( mockManager );
- AssemblerConfigurationSource configSource = mockManager.createMock( AssemblerConfigurationSource.class );
+ AssemblerConfigurationSource configSource = mock( AssemblerConfigurationSource.class );
MavenSession session = mock( MavenSession.class );
when( session.getProjectBuildingRequest() ).thenReturn( mock( ProjectBuildingRequest.class ) );
@@ -160,8 +158,7 @@ public class AddDependencySetsTaskTest
when( session.getUserProperties() ).thenReturn( new Properties() );
when( session.getExecutionProperties() ).thenReturn( new Properties() );
- expect( configSource.getProject() ).andReturn( null ).anyTimes();
- expect( configSource.getMavenSession() ).andReturn( session ).anyTimes();
+ when( configSource.getMavenSession() ).thenReturn( session );
final DependencySet ds = new DependencySet();
ds.setOutputDirectory( "/out" );
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 22307f2..c99034a 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
@@ -19,6 +19,13 @@ package org.apache.maven.plugins.assembly.utils;
* under the License.
*/
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.Properties;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.execution.MavenSession;
@@ -31,13 +38,6 @@ import org.apache.maven.plugins.assembly.model.Assembly;
import org.apache.maven.project.MavenProject;
import org.junit.Test;
-import java.util.Properties;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
public class AssemblyFormatUtilsTest
{
@@ -333,13 +333,11 @@ public class AssemblyFormatUtilsTest
final MavenProject artifactProject = createProject( "group", "artifact", artifactVersion, null );
Artifact artifact = mock( Artifact.class );
- when( artifact.getVersion() ).thenReturn( artifactVersion );
when( artifact.getBaseVersion() ).thenReturn( artifactBaseVersion );
artifactProject.setArtifact( artifact );
final MavenSession session = mock( MavenSession.class );
- when( session.getUserProperties() ).thenReturn( new Properties() );
final AssemblerConfigurationSource cs = mock( AssemblerConfigurationSource.class );
when( cs.getMavenSession() ).thenReturn( session );
@@ -670,7 +668,6 @@ public class AssemblyFormatUtilsTest
final MavenSession session = mock( MavenSession.class );
when( session.getExecutionProperties() ).thenReturn( System.getProperties() );
- when( session.getUserProperties() ).thenReturn( new Properties() );
final AssemblerConfigurationSource cs = mock( AssemblerConfigurationSource.class );
when( cs.getMavenSession() ).thenReturn( session );
@@ -766,7 +763,6 @@ public class AssemblyFormatUtilsTest
final MavenSession session = mock( MavenSession.class );
when( session.getExecutionProperties() ).thenReturn( System.getProperties() );
- when( session.getUserProperties() ).thenReturn( new Properties() );
final AssemblerConfigurationSource cs = mock( AssemblerConfigurationSource.class );
when( cs.getMavenSession() ).thenReturn( session );