Search in sources :

Example 1 with DiffResponse

use of org.projectnessie.model.DiffResponse in project nessie by projectnessie.

the class AbstractResteasyTest method testGetDiff.

@Test
public void testGetDiff() {
    Branch fromBranch = makeBranch("getdiff-test-from");
    Branch toBranch = makeBranch("getdiff-test-to");
    IcebergTable fromTable = IcebergTable.of("content-table", 42, 42, 42, 42);
    IcebergTable toTable = IcebergTable.of("content-table", 43, 43, 43, 43);
    ContentKey contentKey = ContentKey.of("key1");
    commit(contentKey, fromTable, fromBranch, "diffAuthor");
    commit(contentKey, toTable, toBranch, "diffAuthor2");
    DiffResponse diffResponse = rest().get(String.format("diffs/%s...%s", fromBranch.getName(), toBranch.getName())).then().statusCode(200).extract().as(DiffResponse.class);
    assertThat(diffResponse).isNotNull();
    assertThat(diffResponse.getDiffs()).hasSize(1);
    DiffEntry diff = diffResponse.getDiffs().get(0);
    assertThat(diff.getKey()).isEqualTo(contentKey);
    assertThat(diff.getFrom()).isEqualTo(fromTable);
    assertThat(diff.getTo()).isEqualTo(toTable);
}
Also used : ContentKey(org.projectnessie.model.ContentKey) DiffResponse(org.projectnessie.model.DiffResponse) ImmutableBranch(org.projectnessie.model.ImmutableBranch) Branch(org.projectnessie.model.Branch) IcebergTable(org.projectnessie.model.IcebergTable) DiffEntry(org.projectnessie.model.DiffResponse.DiffEntry) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 Branch (org.projectnessie.model.Branch)1 ContentKey (org.projectnessie.model.ContentKey)1 DiffResponse (org.projectnessie.model.DiffResponse)1 DiffEntry (org.projectnessie.model.DiffResponse.DiffEntry)1 IcebergTable (org.projectnessie.model.IcebergTable)1 ImmutableBranch (org.projectnessie.model.ImmutableBranch)1