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);
}
Aggregations