package io.freefair.gradle.plugins.android.ci;

import io.freefair.gradle.plugins.android.AbstractGradlePluginTest;
import org.gradle.testkit.runner.BuildResult;
import org.gradle.testkit.runner.GradleRunner;
import org.junit.Test;

import java.io.IOException;

import static org.gradle.testkit.runner.TaskOutcome.SUCCESS;
import static org.junit.Assert.*;

public class CiPluginTest extends AbstractGradlePluginTest {

    @Test
    public void testApp() throws IOException {
        loadBuildFileFromClasspath("/ci-app.gradle");
        setPackageName("io.freefair.android.test.ciApp");

        BuildResult result = GradleRunner.create()
                .withProjectDir(testProjectDir.getRoot())
                .withArguments("build", "--stacktrace")
                .withPluginClasspath()
                .withDebug(true)
                .build();

        assertEquals(result.task(":build").getOutcome(), SUCCESS);
    }

    @Test
    public void testLibrary() throws IOException {
        loadBuildFileFromClasspath("/ci-library.gradle");
        setPackageName("io.freefair.android.test.ciLib");

        BuildResult result = GradleRunner.create()
                .withProjectDir(testProjectDir.getRoot())
                .withArguments("build", "--stacktrace")
                .withPluginClasspath()
                .withDebug(true)
                .build();

        assertEquals(result.task(":build").getOutcome(), SUCCESS);
    }
}
@@ -716,37 +716,40 @@
 .withArguments(%22
-build
+assemble
 %22, %22--stacktrace
@@ -877,37 +877,40 @@
 s(result.task(%22:
-build
+assemble
 %22).getOutcome(),
@@ -1246,21 +1246,24 @@
 uments(%22
-build
+assemble
 %22, %22--st
@@ -1407,21 +1407,24 @@
 .task(%22:
-build
+assemble
 %22).getOu

fix unit tests