Skip to content
Snippets Groups Projects
Commit b9d446db authored by cramakri's avatar cramakri
Browse files

LMS-1544 Fixed tests.

SVN: 16145
parent a998749f
No related branches found
No related tags found
No related merge requests found
...@@ -47,6 +47,7 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleBO; ...@@ -47,6 +47,7 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleBO;
import ch.systemsx.cisd.openbis.generic.server.business.bo.IVocabularyBO; import ch.systemsx.cisd.openbis.generic.server.business.bo.IVocabularyBO;
import ch.systemsx.cisd.openbis.generic.server.business.bo.datasetlister.IDatasetLister; import ch.systemsx.cisd.openbis.generic.server.business.bo.datasetlister.IDatasetLister;
import ch.systemsx.cisd.openbis.generic.server.business.bo.materiallister.IMaterialLister; import ch.systemsx.cisd.openbis.generic.server.business.bo.materiallister.IMaterialLister;
import ch.systemsx.cisd.openbis.generic.server.business.bo.samplelister.ISampleLister;
import ch.systemsx.cisd.openbis.generic.server.dataaccess.IAttachmentDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IAttachmentDAO;
import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory;
import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDataSetTypeDAO; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDataSetTypeDAO;
...@@ -166,6 +167,8 @@ public abstract class AbstractServerTestCase extends AssertJUnit ...@@ -166,6 +167,8 @@ public abstract class AbstractServerTestCase extends AssertJUnit
protected IDataStoreDAO dataStoreDAO; protected IDataStoreDAO dataStoreDAO;
protected ISampleLister sampleLister;
@BeforeMethod @BeforeMethod
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void setUp() public void setUp()
...@@ -206,6 +209,7 @@ public abstract class AbstractServerTestCase extends AssertJUnit ...@@ -206,6 +209,7 @@ public abstract class AbstractServerTestCase extends AssertJUnit
externalDataBO = context.mock(IExternalDataBO.class); externalDataBO = context.mock(IExternalDataBO.class);
// Table // Table
externalDataTable = context.mock(IExternalDataTable.class); externalDataTable = context.mock(IExternalDataTable.class);
sampleLister = context.mock(ISampleLister.class);
datasetLister = context.mock(IDatasetLister.class); datasetLister = context.mock(IDatasetLister.class);
experimentTable = context.mock(IExperimentTable.class); experimentTable = context.mock(IExperimentTable.class);
propertyTypeTable = context.mock(IPropertyTypeTable.class); propertyTypeTable = context.mock(IPropertyTypeTable.class);
...@@ -270,7 +274,7 @@ public abstract class AbstractServerTestCase extends AssertJUnit ...@@ -270,7 +274,7 @@ public abstract class AbstractServerTestCase extends AssertJUnit
} }
}); });
} }
protected void prepareRegisterPerson() protected void prepareRegisterPerson()
{ {
context.checking(new Expectations() context.checking(new Expectations()
...@@ -278,22 +282,22 @@ public abstract class AbstractServerTestCase extends AssertJUnit ...@@ -278,22 +282,22 @@ public abstract class AbstractServerTestCase extends AssertJUnit
{ {
one(personDAO).listByCodes(Arrays.asList(CommonTestUtils.USER_ID)); one(personDAO).listByCodes(Arrays.asList(CommonTestUtils.USER_ID));
will(returnValue(new ArrayList<PersonPE>())); will(returnValue(new ArrayList<PersonPE>()));
final String applicationToken = "application-token"; final String applicationToken = "application-token";
one(authenticationService).authenticateApplication(); one(authenticationService).authenticateApplication();
will(returnValue(applicationToken)); will(returnValue(applicationToken));
final PersonPE systemPerson = createSystemUser(); final PersonPE systemPerson = createSystemUser();
one(personDAO).tryFindPersonByUserId(PersonPE.SYSTEM_USER_ID); one(personDAO).tryFindPersonByUserId(PersonPE.SYSTEM_USER_ID);
will(returnValue(systemPerson)); will(returnValue(systemPerson));
one(authenticationService).getPrincipal(applicationToken, one(authenticationService).getPrincipal(applicationToken,
CommonTestUtils.USER_ID); CommonTestUtils.USER_ID);
will(returnValue(PRINCIPAL)); will(returnValue(PRINCIPAL));
final PersonPE person = CommonTestUtils.createPersonFromPrincipal(PRINCIPAL); final PersonPE person = CommonTestUtils.createPersonFromPrincipal(PRINCIPAL);
person.setDisplaySettings(systemPerson.getDisplaySettings()); person.setDisplaySettings(systemPerson.getDisplaySettings());
one(personDAO).createPerson(with(new PersonWithDisplaySettingsMatcher(person))); one(personDAO).createPerson(with(new PersonWithDisplaySettingsMatcher(person)));
} }
}); });
...@@ -313,7 +317,6 @@ public abstract class AbstractServerTestCase extends AssertJUnit ...@@ -313,7 +317,6 @@ public abstract class AbstractServerTestCase extends AssertJUnit
return new DisplaySettings(); return new DisplaySettings();
} }
static final protected ExperimentPE createExperiment(final String experimentTypeCode, static final protected ExperimentPE createExperiment(final String experimentTypeCode,
final String experimentCode, final String groupCode) final String experimentCode, final String groupCode)
{ {
......
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