diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UnassignSampleFromSpaceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UnassignSampleFromSpaceTest.java index e740527b97952d66238f90c9893198e53e07763f..efed56395227fcc482472f4e6534eaa90ab413de 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UnassignSampleFromSpaceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UnassignSampleFromSpaceTest.java @@ -86,29 +86,6 @@ public class UnassignSampleFromSpaceTest extends BaseTest perform(anUpdateOf(sample).removingSpace()); } - @Test - public void childSampleCanBeUnassignedFromSpace() throws Exception - { - Sample parent = create(aSample().inExperiment(experiment)); - Sample child = create(aSample().withParent(parent).inExperiment(experiment)); - - perform(anUpdateOf(child).removingSpace()); - - assertThat(child, hasNoSpace()); - } - - @Test - public void spaceAssignmentOfParentSampleIsNotChangedWhenChildSampleIsUnassignedFromSpace() - throws Exception - { - Sample parent = create(aSample().inExperiment(experiment)); - Sample child = create(aSample().withParent(parent).inExperiment(experiment)); - - perform(anUpdateOf(child).removingSpace()); - - assertThat(parent, is(inSpace(space))); - } - @Test(expectedExceptions = { UserFailureException.class }) public void childSampleCantBeUnassignedFromSpace() throws Exception @@ -117,8 +94,6 @@ public class UnassignSampleFromSpaceTest extends BaseTest Sample child = create(aSample().withParent(parent).inExperiment(experiment)); perform(anUpdateOf(child).removingSpace()); - - assertThat(child, hasNoSpace()); } @Test @@ -144,15 +119,14 @@ public class UnassignSampleFromSpaceTest extends BaseTest assertThat(child, is(inSpace(space))); } - @Test + @Test(expectedExceptions = + { UserFailureException.class }) public void componentOfSpaceLevelSampleCanBeUnassignedFromSpace() throws Exception { Sample container = create(aSample().inExperiment(experiment)); Sample component = create(aSample().inExperiment(experiment).inContainer(container)); perform(anUpdateOf(component).removingSpace()); - - assertThat(component, hasNoSpace()); } @Test diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/SampleUpdateBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/SampleUpdateBuilder.java index 2199f58f7d7c542d1b6c183f917777ee6c42df99..3b5aa2652687c6448f217de318d2a74eb80b35be 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/SampleUpdateBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/SampleUpdateBuilder.java @@ -65,7 +65,7 @@ public class SampleUpdateBuilder extends UpdateBuilder<SampleUpdatesDTO> this.version = sample.getVersion(); this.sampleIdentifier = id(sample); this.parents = null; - this.container = null; + this.container = sample.getContainer(); } public SampleUpdateBuilder toExperiment(Experiment experiment)