// Path: src/test/java/com/tw/go/plugins/artifactory/task/config/TaskConfigBuilder.java
// public class TaskConfigBuilder {
// 
//     private final TaskConfig config;
// 
//     public TaskConfigBuilder() {
//         config = mock(TaskConfig.class);
//     }
// 
//     public TaskConfigBuilder uri(String path) {
//         when(config.getValue("URI")).thenReturn(path);
//         return this;
//     }
// 
//     public TaskConfigBuilder path(String path) {
//         when(config.getValue("Path")).thenReturn(path);
//         return this;
//     }
// 
//     public TaskConfigBuilder property(String name, String value) {
//         when(config.getValue("Properties")).thenReturn(format("%s=%s\n", name, value));
//         return this;
//     }
// 
//     public TaskConfigBuilder uriIsFolder(boolean isFolder) {
//         when(config.getValue("uriIsFolder")).thenReturn(valueOf(isFolder));
//         return this;
//     }
// 
//     public TaskConfig build() {
//         return config;
//     }
// }
// 
// Path: src/test/java/com/tw/go/plugins/artifactory/task/executor/TaskExecutionContextBuilder.java
// public class TaskExecutionContextBuilder {
//     private Map<String, String> envVars = new HashMap<>();
//     private String workingDir;
// 
//     public TaskExecutionContextBuilder withEnvVars(Map<String, String> envVars) {
//         this.envVars = envVars;
//         return this;
//     }
// 
//     public TaskExecutionContextBuilder withWorkingDir(String workingDir) {
//         this.workingDir = workingDir;
//         return this;
//     }
// 
//     public TaskExecutionContext build() {
//         EnvironmentVariables environmentVariables = mock(EnvironmentVariables.class);
//         when(environmentVariables.asMap()).thenReturn(envVars);
//         when(environmentVariables.secureEnvSpecifier()).thenReturn(mock(Console.SecureEnvVarSpecifier.class));
// 
//         TaskExecutionContext context = mock(TaskExecutionContext.class);
//         when(context.environment()).thenReturn(environmentVariables);
//         when(context.workingDir()).thenReturn(workingDir);
// 
//         Console console = mock(Console.class);
//         when(context.console()).thenReturn(console);
// 
//         return context;
//     }
// }
// 
// Path: src/test/java/com/tw/go/plugins/artifactory/testutils/FilesystemUtils.java
// public static String path(String first, String... more) {
//     return Paths.get(first, more).toString();
// }


import com.google.common.collect.ImmutableMap;
import com.thoughtworks.go.plugin.api.task.TaskConfig;
import com.thoughtworks.go.plugin.api.task.TaskExecutionContext;
import com.tw.go.plugins.artifactory.task.config.TaskConfigBuilder;
import com.tw.go.plugins.artifactory.task.executor.TaskExecutionContextBuilder;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import static com.tw.go.plugins.artifactory.testutils.FilesystemUtils.path;
import static org.apache.commons.lang.StringUtils.join;
import static org.truth0.Truth.ASSERT;
                .uri("repo/path/to/output.ext")
                .property("name", "value")
                .build();

        Collection<GoArtifact> artifacts = factory.createArtifacts(config, context);

        GoArtifact expectedArtifact = goArtifact("src/test/resources/artifact.txt", "repo/path/to/output.ext", properties);

        ASSERT.that(artifacts).has().exactly(expectedArtifact);
    }

    @Test
    public void shouldCreateArtifactsWithUniqueRemotePathsIfUriIsAFolder() {
        TaskConfig config = new TaskConfigBuilder()
                .path(asPath("src", "test", "resources", "**{artifact.txt,test.html}"))
                .uri("repo/path")
                .uriIsFolder(true)
                .property("name", "value")
                .build();

        Collection<GoArtifact> artifacts = factory.createArtifacts(config, context);

        GoArtifact artifactTxt = goArtifact("src/test/resources/artifact.txt", "repo/path/artifact.txt", properties);
        GoArtifact testHtml = goArtifact("src/test/resources/view/test.html", "repo/path/test.html", properties);

        ASSERT.that(artifacts).has().exactly(artifactTxt, testHtml);
    }

    @Test
    public void shouldCreateArtifactsWithSameRemotePathIfUriIsNotAFolder() {
// Path: src/test/java/com/tw/go/plugins/artifactory/task/config/TaskConfigBuilder.java
// public class TaskConfigBuilder {
// 
//     private final TaskConfig config;
// 
//     public TaskConfigBuilder() {
//         config = mock(TaskConfig.class);
//     }
// 
//     public TaskConfigBuilder uri(String path) {
//         when(config.getValue("URI")).thenReturn(path);
//         return this;
//     }
// 
//     public TaskConfigBuilder path(String path) {
//         when(config.getValue("Path")).thenReturn(path);
//         return this;
//     }
// 
//     public TaskConfigBuilder property(String name, String value) {
//         when(config.getValue("Properties")).thenReturn(format("%s=%s\n", name, value));
//         return this;
//     }
// 
//     public TaskConfigBuilder uriIsFolder(boolean isFolder) {
//         when(config.getValue("uriIsFolder")).thenReturn(valueOf(isFolder));
//         return this;
//     }
// 
//     public TaskConfig build() {
//         return config;
//     }
// }
// 
// Path: src/test/java/com/tw/go/plugins/artifactory/task/executor/TaskExecutionContextBuilder.java
// public class TaskExecutionContextBuilder {
//     private Map<String, String> envVars = new HashMap<>();
//     private String workingDir;
// 
//     public TaskExecutionContextBuilder withEnvVars(Map<String, String> envVars) {
//         this.envVars = envVars;
//         return this;
//     }
// 
//     public TaskExecutionContextBuilder withWorkingDir(String workingDir) {
//         this.workingDir = workingDir;
//         return this;
//     }
// 
//     public TaskExecutionContext build() {
//         EnvironmentVariables environmentVariables = mock(EnvironmentVariables.class);
//         when(environmentVariables.asMap()).thenReturn(envVars);
//         when(environmentVariables.secureEnvSpecifier()).thenReturn(mock(Console.SecureEnvVarSpecifier.class));
// 
//         TaskExecutionContext context = mock(TaskExecutionContext.class);
//         when(context.environment()).thenReturn(environmentVariables);
//         when(context.workingDir()).thenReturn(workingDir);
// 
//         Console console = mock(Console.class);
//         when(context.console()).thenReturn(console);
// 
//         return context;
//     }
// }
// 
// Path: src/test/java/com/tw/go/plugins/artifactory/testutils/FilesystemUtils.java
// public static String path(String first, String... more) {
//     return Paths.get(first, more).toString();
// }


// Path: src/test/java/com/tw/go/plugins/artifactory/model/GoArtifactFactoryIntegrationTest.java
import com.google.common.collect.ImmutableMap;
import com.thoughtworks.go.plugin.api.task.TaskConfig;
import com.thoughtworks.go.plugin.api.task.TaskExecutionContext;
import com.tw.go.plugins.artifactory.task.config.TaskConfigBuilder;
import com.tw.go.plugins.artifactory.task.executor.TaskExecutionContextBuilder;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import static com.tw.go.plugins.artifactory.testutils.FilesystemUtils.path;
import static org.apache.commons.lang.StringUtils.join;
import static org.truth0.Truth.ASSERT;

                .uri("repo/path/to/output.ext")
                .property("name", "value")
                .build();

        Collection<GoArtifact> artifacts = factory.createArtifacts(config, context);

        GoArtifact expectedArtifact = goArtifact("src/test/resources/artifact.txt", "repo/path/to/output.ext", properties);

        ASSERT.that(artifacts).has().exactly(expectedArtifact);
    }

    @Test
    public void shouldCreateArtifactsWithUniqueRemotePathsIfUriIsAFolder() {
        TaskConfig config = new TaskConfigBuilder()
                .path(asPath("src", "test", "resources", "**{artifact.txt,test.html}"))
                .uri("repo/path")
                .uriIsFolder(true)
                .property("name", "value")
                .build();

        Collection<GoArtifact> artifacts = factory.createArtifacts(config, context);

        GoArtifact artifactTxt = goArtifact("src/test/resources/artifact.txt", "repo/path/artifact.txt", properties);
        GoArtifact testHtml = goArtifact("src/test/resources/view/test.html", "repo/path/test.html", properties);

        ASSERT.that(artifacts).has().exactly(artifactTxt, testHtml);
    }

    @Test
    public void shouldCreateArtifactsWithSameRemotePathIfUriIsNotAFolder() {
        TaskConfig config = new TaskConfigBuilder()