package com.github.mazzeb.gradle.autoversion;

import org.gradle.api.Project;
import org.gradle.testfixtures.ProjectBuilder;
import org.gradle.tooling.BuildLauncher;
import org.gradle.tooling.GradleConnector;
import org.gradle.tooling.ProjectConnection;
import org.junit.Test;

import java.io.File;

public class AutoVersionPluginTest {
    @Test
    public void shouldApplyVersion() throws Exception {
        Project someProject = ProjectBuilder.builder()
                .build();

        someProject.getPluginManager().apply(AutoVersionPlugin.class);
    }

    @Test
    public void shouldExecuteNextPatchTask() throws Exception {
        GradleConnector connector = GradleConnector.newConnector();
        connector.forProjectDirectory(new File("."));
        ProjectConnection connection = connector.connect();
        try {
            BuildLauncher launcher = connection.newBuild();
            launcher.forTasks("nextPatch");
            launcher.run();
        } finally {
            connection.close();
        }
    }
}
@@ -559,476 +559,7 @@
   %7D%0A
-%0A    @Test%0A    public void shouldExecuteNextPatchTask() throws Exception %7B%0A        GradleConnector connector = GradleConnector.newConnector();%0A        connector.forProjectDirectory(new File(%22.%22));%0A        ProjectConnection connection = connector.connect();%0A        try %7B%0A            BuildLauncher launcher = connection.newBuild();%0A            launcher.forTasks(%22nextPatch%22);%0A            launcher.run();%0A        %7D finally %7B%0A            connection.close();%0A        %7D%0A    %7D%0A%7D
+%7D%0A%0A

remove unneeded test