diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/BasicEntityDescriptionPredicateTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/BasicEntityDescriptionPredicateTest.java index 14469a33ede6cfe5f0935d1e4c5fd8b5ea2d980a..f4e0a1a6a18586f17603952b54a33ceb83a13d16 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/BasicEntityDescriptionPredicateTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/BasicEntityDescriptionPredicateTest.java @@ -87,6 +87,14 @@ public class BasicEntityDescriptionPredicateTest extends AuthorizationTestCase prepareProvider(createSpaces()); predicate.init(provider); + context.checking(new Expectations() + { + { + allowing(provider).getAuthorizationConfig(); + will(returnValue(new TestAuthorizationConfig(false, false))); + } + }); + Status status = predicate.doEvaluation(createPerson(), createRoles(false), entityDescription); assertEquals("ERROR: \"User 'megapixel' does not have enough privileges.\"", status.toString()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleUpdatesCollectionPredicateTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleUpdatesCollectionPredicateTest.java index 5334b53b2d9b0b713672862e0224fbc0fb0e584a..f1854bb92e914fc772416efae978d2cdab35f4dc 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleUpdatesCollectionPredicateTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleUpdatesCollectionPredicateTest.java @@ -24,6 +24,7 @@ import org.testng.annotations.Test; import ch.systemsx.cisd.common.exceptions.Status; import ch.systemsx.cisd.openbis.generic.server.authorization.AuthorizationTestCase; +import ch.systemsx.cisd.openbis.generic.server.authorization.TestAuthorizationConfig; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleAccessPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleUpdatesDTO; @@ -57,6 +58,9 @@ public class SampleUpdatesCollectionPredicateTest extends AuthorizationTestCase context.checking(new Expectations() { { + allowing(provider).getAuthorizationConfig(); + will(returnValue(new TestAuthorizationConfig(false, false))); + one(provider).getSampleCollectionAccessData(TechId.createList(42L, 43L, 44L)); will(returnValue(Collections.singleton(sampleAccess))); } @@ -91,6 +95,9 @@ public class SampleUpdatesCollectionPredicateTest extends AuthorizationTestCase context.checking(new Expectations() { { + allowing(provider).getAuthorizationConfig(); + will(returnValue(new TestAuthorizationConfig(false, false))); + one(provider).getSampleCollectionAccessData(TechId.createList(42L, 43L, 44L)); will(returnValue(Collections.singleton(sampleAccess))); } @@ -117,6 +124,15 @@ public class SampleUpdatesCollectionPredicateTest extends AuthorizationTestCase new SampleUpdatesDTO(new TechId(44L), null, null, null, null, 0, SampleIdentifierFactory.parse("/" + SPACE_CODE + "/S1"), null, null); prepareProvider(createSpaces()); + + context.checking(new Expectations() + { + { + allowing(provider).getAuthorizationConfig(); + will(returnValue(new TestAuthorizationConfig(false, false))); + } + }); + SampleUpdatesCollectionPredicate predicate = new SampleUpdatesCollectionPredicate(); predicate.init(provider); @@ -152,6 +168,9 @@ public class SampleUpdatesCollectionPredicateTest extends AuthorizationTestCase context.checking(new Expectations() { { + allowing(provider).getAuthorizationConfig(); + will(returnValue(new TestAuthorizationConfig(false, false))); + one(provider).getSampleCollectionAccessData(TechId.createList(42L, 43L, 44L)); will(returnValue(Collections.singleton(sampleAccess))); }