### Question:
JcrDataSourceProvider extends BaseJcrProvider<DataSource, DataSource.ID> implements DataSourceProvider { @Override public Optional<DataSource> find(com.thinkbiganalytics.metadata.api.catalog.DataSource.ID id) { return Optional.ofNullable(findById(id)); }  @Override DataSource.ID resolveId(Serializable fid); @Override DataSource create(ID connId, String title); @Override List<DataSource> findByConnector(ID connId, ID... moreIds); @Override List<DataSource> findByConnector(Collection<ID> connIds); @Override Optional<DataSource> find(com.thinkbiganalytics.metadata.api.catalog.DataSource.ID id); @Override Class<? extends JcrEntity<?>> getJcrEntityClass(); @Override String getNodeType(Class<? extends JcrObject> jcrEntityType); @Override Optional<DataSource> findByNifiControlerServiceId(final String serviceId); String generateSystemName(String title);  }### Answer:
@Test public void testDelete() { metadata.commit(() -> { this.dsProvider.deleteById(this.dsId); }, MetadataAccess.SERVICE); metadata.read(() -> { Optional<DataSource> ds = this.dsProvider.find(this.dsId); assertThat(ds).isNotNull().isNotPresent(); }, MetadataAccess.SERVICE); }
@Test(dependsOnMethods = "testCreate") public void testConnectorHasDataSources() { metadata.read(() -> { Optional<Connector> conn = this.connProvider.find(this.connId); assertThat(conn).isNotNull().isPresent(); List<? extends DataSource> dsList = conn.get().getDataSources(); assertThat(dsList).hasSize(COUNT); }, MetadataAccess.SERVICE); }