ProcessDefinitionDataSetProvider extends BeanDataSetProvider { @Override public DataSetMetadata getDataSetMetadata(DataSetDef def) throws Exception { List<String> columnNames = new ArrayList<>(); List<ColumnType> columnTypes = new ArrayList<>(); List<DataColumnDef> columns = def.getColumns(); for (DataColumnDef column : columns) { columnNames.add(column.getId()); columnTypes.add(column.getColumnType()); } return new DataSetMetadataImpl(def, def.getUUID(), -1, def.getColumns().size(), columnNames, columnTypes, -1); }  @Override DataSetProviderType getType(); @Override DataSetMetadata getDataSetMetadata(DataSetDef def); @Override DataSet lookupDataSet(DataSetDef def, DataSetLookup lookup); @Override boolean isDataSetOutdated(DataSetDef def);  }
@Test public void testGetDataSetMetadata() throws Exception { DataSetMetadata dataSetMetadata = processDefinitionDataSetProvider.getDataSetMetadata(dataSetdef); assertEquals(PROCESS_DEFINITION_DATASET, dataSetMetadata.getUUID()); assertThat(dataSetMetadata.getColumnIds()).hasSize(5).containsOnlyOnce(COL_ID_PROCESSNAME, COL_ID_PROCESSVERSION, COL_ID_PROJECT, COL_ID_PROCESSDEF, COL_DYNAMIC); assertThat(dataSetMetadata.getColumnTypes()).hasSize(5).containsOnly(ColumnType.LABEL); }