public class CRUDableEntityProviderMock extends EntityProviderMock implements CoreEntityProvider, CRUDable
CRUDable capabilities, will perform like the
actual class so it can be reliably used for testingCRUDable operationsMyEntity objectsResolvable and CollectionResolvable as well, returns 3 MyEntity objects
if no search restrictions, 1 if "stuff" property is set, none if other properties are set| Modifier and Type | Field and Description |
|---|---|
Map<String,MyEntity> |
myEntities |
prefix| Constructor and Description |
|---|
CRUDableEntityProviderMock(String prefix,
String[] ids) |
| Modifier and Type | Method and Description |
|---|---|
String |
createEntity(EntityReference ref,
Object entity,
Map<String,Object> params)
Expects
MyEntity objects
|
void |
deleteEntity(EntityReference ref,
Map<String,Object> params) |
boolean |
entityExists(String id) |
List<?> |
getEntities(EntityReference ref,
Search search) |
Object |
getEntity(EntityReference reference) |
Object |
getSampleEntity()
Returns
MyEntity objects with no id, default number to 10
|
void |
updateEntity(EntityReference ref,
Object entity,
Map<String,Object> params)
Expects
MyEntity objects
|
getEntityPrefixclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEntityPrefixpublic boolean entityExists(String id)
entityExists in interface CoreEntityProviderpublic Object getEntity(EntityReference reference)
getEntity in interface Resolvablepublic List<?> getEntities(EntityReference ref, Search search)
public Object getSampleEntity()
MyEntity objects with no id, default number to 10
getSampleEntity in interface Sampleablepublic String createEntity(EntityReference ref, Object entity, Map<String,Object> params)
MyEntity objects
createEntity in interface Createablepublic void updateEntity(EntityReference ref, Object entity, Map<String,Object> params)
MyEntity objects
updateEntity in interface Updateablepublic void deleteEntity(EntityReference ref, Map<String,Object> params)
deleteEntity in interface DeleteableCopyright © 2003–2021 Sakai Project. All rights reserved.