From 2496f743dc36c57fd15f9bf09798239b88154361 Mon Sep 17 00:00:00 2001
From: pkupczyk <pkupczyk>
Date: Sat, 20 May 2017 21:03:42 +0000
Subject: [PATCH] SSDM-5142 : Project Authorization - experiment predicates and
 validators - fix TrashBOTest

SVN: 38201
---
 .../generic/server/business/bo/TrashBOTest.java        | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBOTest.java
index 9b731df54ff..7467187c8dc 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBOTest.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBOTest.java
@@ -38,6 +38,7 @@ import org.testng.annotations.Test;
 import ch.rinn.restrictions.Friend;
 import ch.systemsx.cisd.common.exceptions.UserFailureException;
 import ch.systemsx.cisd.common.test.RecordingMatcher;
+import ch.systemsx.cisd.openbis.generic.server.authorization.TestAuthorizationConfig;
 import ch.systemsx.cisd.openbis.generic.server.business.ManagerTestTool;
 import ch.systemsx.cisd.openbis.generic.server.business.bo.entitygraph.DataSetNode;
 import ch.systemsx.cisd.openbis.generic.server.business.bo.entitygraph.EntityGraphGenerator;
@@ -66,8 +67,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind;
  * 
  * @author Piotr Buczek
  */
-@Friend(toClasses =
-{ ScriptBO.class, ScriptBO.IScriptFactory.class, ScriptPE.class })
+@Friend(toClasses = { ScriptBO.class, ScriptBO.IScriptFactory.class, ScriptPE.class })
 public final class TrashBOTest extends AbstractBOTest
 {
 
@@ -209,6 +209,9 @@ public final class TrashBOTest extends AbstractBOTest
         context.checking(new Expectations()
             {
                 {
+                    allowing(daoFactory).getAuthorizationConfig();
+                    will(returnValue(new TestAuthorizationConfig(false, null)));
+
                     one(deletionDAO).trash(EntityKind.EXPERIMENT, experimentIds, deletion, true);
                     will(returnValue(0));
                 }
@@ -234,7 +237,8 @@ public final class TrashBOTest extends AbstractBOTest
         {
             assertEquals(
                     "Deletion not possible because the following data sets are not deletable:\n"
-                            + " Status: ARCHIVE_PENDING, data sets: [DS1]", ex.getMessage());
+                            + " Status: ARCHIVE_PENDING, data sets: [DS1]",
+                    ex.getMessage());
         }
 
         context.assertIsSatisfied();
-- 
GitLab