Commit 8158b7b3 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '165-update-creator-roles' into 'master'

Resolve "Update Creator roles"

Closes #165

See merge request !156
parents 44e90d0e 804a847b
......@@ -52,11 +52,17 @@ public class DatasetCreator extends UuidModel implements PublishValidationInterf
*/
public enum DatasetCreatorRole {
/** The contact. */
CONTACT,
/** The contributor. */
CONTRIBUTOR
/** Data manager: Responsible of the planning and execution of the germplasm characterization and evaluation activity which resulted in the dataset. Oversees the collection and management of characterization and evaluation data, and has final sign-off on publication. */
MANAGER,
/** Data collector: Records germplasm characterization or evaluation data in the field. */
COLLECTOR,
/** Data digitizer: Digitizes data. */
DIGITIZER,
/** Data curator: Organizes and validates data and metadata in correct format, ensures quality of both. */
CURATOR
}
/** The full name. */
......
......@@ -97,7 +97,7 @@ public abstract class AbstractDatasetServiceTest extends CatalogServiceTest {
datasetCreator.setDataset(dataset);
datasetCreator.setFullName(fullName);
datasetCreator.setEmail(email);
datasetCreator.setRole(DatasetCreator.DatasetCreatorRole.CONTACT);
datasetCreator.setRole(DatasetCreator.DatasetCreatorRole.MANAGER);
datasetCreator.setPhoneNumber(phoneNumber);
return datasetCreator;
}
......
......@@ -53,7 +53,7 @@ public class DatasetCreatorServiceTest extends AbstractDatasetServiceTest {
final DatasetCreator datasetCreator = buildDatasetCreator("TestFullName", "TestEmailName", "0673579007", result);
final DatasetCreator datasetCreators = datasetCreatorService.createDatasetCreator(result, datasetCreator);
assertThat(datasetCreators, is(not(nullValue())));
assertThat(datasetCreators.getRole(), is(DatasetCreator.DatasetCreatorRole.CONTACT));
assertThat(datasetCreators.getRole(), is(DatasetCreator.DatasetCreatorRole.MANAGER));
assertThat(datasetCreators.getDataset().getUuid().toString(), equalTo(result.getUuid().toString()));
}
......@@ -87,7 +87,7 @@ public class DatasetCreatorServiceTest extends AbstractDatasetServiceTest {
final String[] strs = new String[] { "fullName" };
final Pageable pageable = new PageRequest(0, Integer.min(50, 100), Sort.Direction.ASC, strs);
final Page page = datasetCreatorService.listDatasetCreators(result.getUuid(), pageable);
final Page<?> page = datasetCreatorService.listDatasetCreators(result.getUuid(), pageable);
assertThat(page.getTotalElements(), is(1L));
assertThat(((DatasetCreator) page.getContent().get(0)).getUuid(), is(creator.getUuid()));
......
......@@ -3849,3 +3849,13 @@ databaseChangeLog:
- sql:
sql: >-
CREATE INDEX UK_1my8xep8hi5fv42o3ivu0t41o ON short_filter(json(250))
- changeSet:
id: 1529314171000-1
author: mobreza
comment: Migrate Creator#roles to new values
changes:
- sql:
sql: >-
UPDATE dataset_creator SET role = 'CURATOR' WHERE role = 'CONTACT';
UPDATE dataset_creator SET role = 'DIGITIZER' WHERE role = 'CONTRIBUTOR';
......@@ -128,7 +128,7 @@ public class DatasetCreatorControllerTest extends AbstractDatasetControllerTest
final DatasetCreator datasetCreator = new DatasetCreator();
datasetCreator.setDataset(dataset);
datasetCreator.setFullName(fullName);
datasetCreator.setRole(DatasetCreator.DatasetCreatorRole.CONTACT);
datasetCreator.setRole(DatasetCreator.DatasetCreatorRole.MANAGER);
datasetCreator.setEmail(email);
datasetCreator.setPhoneNumber(phoneNumber);
return datasetCreator;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment