when( mockProcess.waitFor() ).thenReturn( 0 );
Commandline commandLineMock = mock( Commandline.class );
when( commandLineMock.execute() ).thenReturn( mockProcess );
Arg valueArgument = mock( Arg.class );
when( commandLineMock.createArg() ).thenReturn( valueArgument );
CommandLineFactory commandLineFactoryMock = mock( CommandLineFactory.class );
when( commandLineFactoryMock.createCommandLine( isA( String.class ) /* "mvn" */) ).thenReturn( commandLineMock );