@Override
  public void updateTableSchema(String tableName, MessageType schema, SchemaDifference schemaDifference) {
    try (RestEmitter emitter = config.getRestEmitter()) {
      DatahubResponseLogger responseLogger = new DatahubResponseLogger();
      MetadataChangeProposalWrapper schemaChange = createSchemaMetadataUpdate(tableName);
      emitter.emit(schemaChange, responseLogger).get();

      // When updating an entity, it is necessary to set its soft-delete status to false, or else the update won't get
      // reflected in the UI.
      MetadataChangeProposalWrapper softDeleteUndoProposal = createUndoSoftDelete();
      emitter.emit(softDeleteUndoProposal, responseLogger).get();
    } catch (Exception e) {
      throw new HoodieDataHubSyncException("Fail to change schema for Dataset " + datasetUrn, e);
    }
  }
@Test
  public void testUpdateTableSchemaInvokesRestEmitter() throws IOException {
    Properties props = new Properties();
    props.put(META_SYNC_PARTITION_EXTRACTOR_CLASS.key(), DummyPartitionValueExtractor.class.getName());
    props.put(META_SYNC_BASE_PATH.key(), tableBasePath);

    Mockito.when(
        restEmitterMock.emit(any(MetadataChangeProposalWrapper.class), Mockito.any())
    ).thenReturn(
        CompletableFuture.completedFuture(MetadataWriteResponse.builder().build())
    );

    DatahubSyncConfigStub configStub = new DatahubSyncConfigStub(props, restEmitterMock);
    DataHubSyncClientStub dhClient = new DataHubSyncClientStub(configStub);

    dhClient.updateTableSchema("some_table", null, null);
    verify(restEmitterMock, times(2)).emit(any(MetadataChangeProposalWrapper.class),
            Mockito.any());
  }