// Path: java-runtime-builder-app/src/test/java/com/google/cloud/runtimes/builder/TestUtils.java
// public static class TestWorkspaceBuilder {
// 
//   private final Path workspaceDir;
// 
//   public TestWorkspaceBuilder() throws IOException {
//     this.workspaceDir = Files.createTempDirectory(null);
//   }
// 
//   public FileBuilder file(String path) {
//     return new FileBuilder(this, workspaceDir.resolve(path));
//   }
// 
//   public Path build() {
//     return workspaceDir;
//   }
// 
//   public class FileBuilder {
//     private final Path path;
//     private final TestWorkspaceBuilder workspaceBuilder;
//     private String contents = "";
//     private boolean isExecutable = false;
// 
//     private FileBuilder(TestWorkspaceBuilder workspaceBuilder, Path path) {
//       this.workspaceBuilder = workspaceBuilder;
//       this.path = path;
//     }
// 
//     public FileBuilder withContents(String contents) {
//       this.contents = contents;
//       return this;
//     }
// 
//     public FileBuilder setIsExecutable(boolean isExecutable) {
//       this.isExecutable = isExecutable;
//       return this;
//     }
// 
//     public TestWorkspaceBuilder build() throws IOException {
//       // mkdir -p
//       Files.createDirectories(path.getParent());
// 
//       try (Writer out = Files.newBufferedWriter(path, Charset.defaultCharset())) {
//         out.write(contents);
//       }
// 
//       Set<PosixFilePermission> permissions = Sets.newHashSet(
//           PosixFilePermission.OWNER_READ,
//           PosixFilePermission.OWNER_WRITE);
//       if (isExecutable) {
//         permissions.add(PosixFilePermission.OWNER_EXECUTE);
//       }
// 
//       Files.setPosixFilePermissions(path, permissions);
//       return workspaceBuilder;
//     }
//   }
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import com.google.cloud.runtimes.builder.TestUtils.TestWorkspaceBuilder;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import org.junit.Before;
import org.junit.Test;
package com.google.cloud.runtimes.builder.config.domain;



/**
 * Unit tests for {@link BuildContext}.
 */
public class BuildContextTest {

  private Path workspace;
  private RuntimeConfig runtimeConfig;
  private BetaSettings betaSettings;
  private boolean disableSourceBuild;

  private static final String DOCKER_IGNORE_PREAMBLE = "Dockerfile\n"
      + ".dockerignore\n";

  @Before
  public void before() throws IOException {
    // initialize to empty dir
// Path: java-runtime-builder-app/src/test/java/com/google/cloud/runtimes/builder/TestUtils.java
// public static class TestWorkspaceBuilder {
// 
//   private final Path workspaceDir;
// 
//   public TestWorkspaceBuilder() throws IOException {
//     this.workspaceDir = Files.createTempDirectory(null);
//   }
// 
//   public FileBuilder file(String path) {
//     return new FileBuilder(this, workspaceDir.resolve(path));
//   }
// 
//   public Path build() {
//     return workspaceDir;
//   }
// 
//   public class FileBuilder {
//     private final Path path;
//     private final TestWorkspaceBuilder workspaceBuilder;
//     private String contents = "";
//     private boolean isExecutable = false;
// 
//     private FileBuilder(TestWorkspaceBuilder workspaceBuilder, Path path) {
//       this.workspaceBuilder = workspaceBuilder;
//       this.path = path;
//     }
// 
//     public FileBuilder withContents(String contents) {
//       this.contents = contents;
//       return this;
//     }
// 
//     public FileBuilder setIsExecutable(boolean isExecutable) {
//       this.isExecutable = isExecutable;
//       return this;
//     }
// 
//     public TestWorkspaceBuilder build() throws IOException {
//       // mkdir -p
//       Files.createDirectories(path.getParent());
// 
//       try (Writer out = Files.newBufferedWriter(path, Charset.defaultCharset())) {
//         out.write(contents);
//       }
// 
//       Set<PosixFilePermission> permissions = Sets.newHashSet(
//           PosixFilePermission.OWNER_READ,
//           PosixFilePermission.OWNER_WRITE);
//       if (isExecutable) {
//         permissions.add(PosixFilePermission.OWNER_EXECUTE);
//       }
// 
//       Files.setPosixFilePermissions(path, permissions);
//       return workspaceBuilder;
//     }
//   }
// }


// Path: java-runtime-builder-app/src/test/java/com/google/cloud/runtimes/builder/config/domain/BuildContextTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import com.google.cloud.runtimes.builder.TestUtils.TestWorkspaceBuilder;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import org.junit.Before;
import org.junit.Test;

package com.google.cloud.runtimes.builder.config.domain;



/**
 * Unit tests for {@link BuildContext}.
 */
public class BuildContextTest {

  private Path workspace;
  private RuntimeConfig runtimeConfig;
  private BetaSettings betaSettings;
  private boolean disableSourceBuild;

  private static final String DOCKER_IGNORE_PREAMBLE = "Dockerfile\n"
      + ".dockerignore\n";

  @Before
  public void before() throws IOException {
    // initialize to empty dir
    workspace = new TestWorkspaceBuilder().build();