when( mockProcess.exitValue() ).thenReturn( 1 ); // why was this here in the original test?
Commandline commandLineMock = mock( Commandline.class );
when( commandLineMock.execute() ).thenReturn( mockProcess );
Arg argMock = mock( Arg.class );
when( commandLineMock.createArg() ).thenReturn( argMock );
CommandLineFactory commandLineFactoryMock = mock( CommandLineFactory.class );
when( commandLineFactoryMock.createCommandLine( endsWith( "mvn" ) ) ).thenReturn( commandLineMock );