Skip to content
Snippets Groups Projects
Commit e7909e66 authored by anttil's avatar anttil
Browse files

BIS-170 / SP-279: Changing the owner of dataset from sample to experiment is impossible in the U

SVN: 26840
parent 576eeb26
No related branches found
No related tags found
No related merge requests found
......@@ -567,6 +567,7 @@ public class DataBO extends AbstractDataSetBusinessObject implements IDataBO
updateSample(data, updates.getSampleIdentifierOrNull());
} else
{
data.setSample(null);
updateExperiment(data, updates.getExperimentIdentifierOrNull());
}
......
......@@ -196,6 +196,17 @@ public class AssignDataSetToSampleTest extends BaseTest
assertThat(component, is(inSample(sourceSample)));
}
@Test
public void dataSetCanBeUnassignedFromSample() throws Exception
{
ExternalData data = create(aDataSet().inSample(sourceSample));
perform(anUpdateOf(data).removingSample());
assertThat(data, hasNoSample());
assertThat(data, is(inExperiment(sourceExperiment)));
}
Space unrelatedAdmin;
Space unrelatedObserver;
......
......@@ -102,6 +102,12 @@ public class DataSetUpdateBuilder extends UpdateBuilder<DataSetUpdatesDTO>
return this;
}
public DataSetUpdateBuilder removingSample()
{
this.sampleIdentifier = null;
return this;
}
public DataSetUpdateBuilder withContainer(ExternalData dataSet)
{
this.containerCode = dataSet.getCode();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment