Search in sources :

Example 1 with Baseline

use of com.google.copybara.Origin.Baseline in project copybara by google.

the class GitDestinationTest method testDestinationReader.

@Test
public void testDestinationReader() throws Exception {
    fetch = primaryBranch;
    push = primaryBranch;
    Path file = workdir.resolve("test.txt");
    Files.write(file, "some content".getBytes(UTF_8));
    Writer<GitRevision> writer = firstCommitWriter();
    process(writer, new DummyRevision("first_commit"));
    assertThat(writer.getDestinationReader(console, new Baseline<>(repo().resolveReference("HEAD").getSha1(), null), workdir).readFile("test.txt")).contains("some content");
}
Also used : Path(java.nio.file.Path) DummyRevision(com.google.copybara.testing.DummyRevision) Baseline(com.google.copybara.Origin.Baseline) Test(org.junit.Test)

Aggregations

Baseline (com.google.copybara.Origin.Baseline)1 DummyRevision (com.google.copybara.testing.DummyRevision)1 Path (java.nio.file.Path)1 Test (org.junit.Test)1