public class ResolvableEntityProviderMock extends CoreEntityProviderMock implements CoreEntityProvider, Resolvable, CollectionResolvable, Outputable
Resolvablecapability, will perform like the actual class so it can be reliably used for testing
CollectionResolvableas well, returns 3
MyEntityobjects if no search restrictions, 1 if "stuff" property is set, none if other properties are set
SEARCH_LOCATION_REFERENCE, SEARCH_TAGS, SEARCH_USER_REFERENCE
ALL_KNOWN_FORMATS, ATOM, ATOM_EXTENSIONS, ATOM_MIME_TYPE, FORM, FORM_EXTENSIONS, FORM_MIME_TYPE, HTML, HTML_EXTENSIONS, HTML_MIME_TYPE, JSON, JSON_EXTENSIONS, JSON_MIME_TYPE, JSONP, JSONP_EXTENSIONS, JSONP_MIME_TYPE, RSS, RSS_EXTENSIONS, RSS_MIME_TYPE, TXT, TXT_EXTENSIONS, TXT_MIME_TYPE, UTF_8, XML, XML_EXTENSIONS, XML_MIME_TYPE
|Constructor and Description|
TEST Constructor: allows for easy setup of this stub for testing
|Modifier and Type||Method and Description|
Allows these entities to be fetched based on search parameters, this should never return null and if there are no entities then the list should be empty
Note: The entity class types in the list need to be able to be resolved from the ClassLoader of the EntityBrokerManager (currently this means deployed into shared)
These do not have to be model objects and may simply be something created (e.g.
Allows this entity to be fetched based on the ref (prefix and local id), also used to determine the class type of these entities by requesting an entity without specifying an id (id = null)
WARNING: this method should not return null, throw the appropriate exception if the entity data cannot be found Note: The entity class type needs to be able to be resolved from the ClassLoader of the EntityBrokerManager (currently this means deployed into shared)
The entity object does not have to be a model object itself and may simply be something created (
Defines the output format types (extensions) handled by this provider
NOTE: In the case of an entity view the extension which goes on the end of an entity URL (after a ".") indicates the return type
WARNING: This combines with the access interface when http requests are being processed, all requests will pass through to the
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public String getHandledOutputFormats()
EntityViewAccessProviderif they are not handled
Formats.HTML) or feel free to make up your own if you like
public Object getEntity(EntityReference reference)
EntityData, etc.) to give to anyone calling this method.
reference- the parsed reference object which uniquely represents an entity OR only a prefix (indicating you should return a default constructed object with no properties set)
Map, your own POJO, etc.
public List<?> getEntities(EntityReference ref, Search search)
ref- the parsed reference object which uniquely represents this entity, only the prefix will be used from this reference (since that identifies the space and collection)
search- a search object which can define the order to return entities, search filters, and total number of entities returned,
Map, etc.) of the type handled by this provider OR a list of
EntityDataobjects based on the search OR empty if none found, should not return null
Copyright © 2003–2019 The Sakai Foundation. All rights reserved.