@Test
public void getMissingBranchWithRecordTest() {

    // Setup:
    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage("Branch " + RANDOM_IRI + " could not be found");
    try (RepositoryConnection conn = repo.getConnection()) {
        VersionedRDFRecord record = versionedRDFRecordFactory.createNew(VERSIONED_RDF_RECORD_IRI);
        record.setBranch(Collections.singleton(branchFactory.createNew(RANDOM_IRI)));
        service.getBranch(record, RANDOM_IRI, branchFactory, conn);
    }
}