@Test
public void testAddMasterBranch() throws Exception {

    // Setup:
    VersionedRDFRecord record = versionedRDFRecordFactory.createNew(VERSIONED_RDF_RECORD_IRI);
    doReturn(record).when(utilsService).getRecord(eq(distributedCatalogId), eq(VERSIONED_RDF_RECORD_IRI), eq(versionedRDFRecordFactory), any(RepositoryConnection.class));
    manager.addMasterBranch(distributedCatalogId, VERSIONED_RDF_RECORD_IRI);
    verify(utilsService).getRecord(eq(distributedCatalogId), eq(VERSIONED_RDF_RECORD_IRI), eq(versionedRDFRecordFactory), any(RepositoryConnection.class));
    verify(utilsService).updateObject(eq(record), any(RepositoryConnection.class));
    verify(utilsService).addObject(any(Branch.class), any(RepositoryConnection.class));
    assertTrue(record.getMasterBranch_resource().isPresent());
    assertEquals(1, record.getBranch_resource().size());
}