@Before public void setUp() { super.setUp(); context.setImposteriser(ClassImposteriser.INSTANCE); wrapper = createTask(Wrapper.class); wrapperScriptGeneratorMock = context.mock(WrapperScriptGenerator.class); wrapper.setScriptDestinationPath("scriptDestination"); wrapper.setGradleVersion("1.0"); targetWrapperJarPath = "jarPath"; expectedTargetWrapperJar = new TestFile( getProject().getProjectDir(), targetWrapperJarPath + "/" + Wrapper.WRAPPER_JAR); expectedTargetWrapperProperties = new File( getProject().getProjectDir(), targetWrapperJarPath + "/" + Wrapper.WRAPPER_PROPERTIES); new File(getProject().getProjectDir(), targetWrapperJarPath).mkdirs(); distributionPath = "somepath"; wrapper.setJarPath(targetWrapperJarPath); wrapper.setDistributionPath(distributionPath); wrapper.setUnixWrapperScriptGenerator(wrapperScriptGeneratorMock); }