Class SimpleMockOrganizationService
java.lang.Object
org.exoplatform.commons.testing.mock.SimpleMockOrganizationService
- All Implemented Interfaces:
org.exoplatform.services.organization.OrganizationService
public class SimpleMockOrganizationService
extends Object
implements org.exoplatform.services.organization.OrganizationService
A partial implementation of OrganizationService for use in tests of classes
that rely on it. It provides a simple method to insert the membership data :
addMemberships(String, String...) Uses dumb implementations of
Group, User and Membership based on an identifier. All find operations are
implemented. Write operations are not implemented.-
Field Summary
Fields inherited from interface org.exoplatform.services.organization.OrganizationService
EXTERNAL_STORE, INTERNAL_STORE, USER_AUTHENTICATED_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListenerPlugin(org.exoplatform.container.component.ComponentPlugin listener) voidaddMemberships(String user, String... membershipExprs) Insert a new membership.voiddestroy()org.exoplatform.services.organization.GroupHandlerorg.exoplatform.services.organization.MembershipHandlerorg.exoplatform.services.organization.MembershipTypeHandlerorg.exoplatform.services.organization.UserHandlerorg.exoplatform.services.organization.UserProfileHandler
-
Constructor Details
-
SimpleMockOrganizationService
public SimpleMockOrganizationService()
-
-
Method Details
-
addMemberships
Insert a new membership. The user, group and membership type are added to the model if they don't exist.- Parameters:
user- username username for the membershipmembershipExprs- membership expressions in the classical form [TYPE:]GROUP . TYPE may be omitted. In that case "*" membership will be used.
-
destroy
public void destroy() -
getGroupHandler
public org.exoplatform.services.organization.GroupHandler getGroupHandler()- Specified by:
getGroupHandlerin interfaceorg.exoplatform.services.organization.OrganizationService
-
getMembershipHandler
public org.exoplatform.services.organization.MembershipHandler getMembershipHandler()- Specified by:
getMembershipHandlerin interfaceorg.exoplatform.services.organization.OrganizationService
-
getMembershipTypeHandler
public org.exoplatform.services.organization.MembershipTypeHandler getMembershipTypeHandler()- Specified by:
getMembershipTypeHandlerin interfaceorg.exoplatform.services.organization.OrganizationService
-
getUserHandler
public org.exoplatform.services.organization.UserHandler getUserHandler()- Specified by:
getUserHandlerin interfaceorg.exoplatform.services.organization.OrganizationService
-
getUserProfileHandler
public org.exoplatform.services.organization.UserProfileHandler getUserProfileHandler()- Specified by:
getUserProfileHandlerin interfaceorg.exoplatform.services.organization.OrganizationService
-
addListenerPlugin
public void addListenerPlugin(org.exoplatform.container.component.ComponentPlugin listener) throws Exception - Specified by:
addListenerPluginin interfaceorg.exoplatform.services.organization.OrganizationService- Throws:
Exception
-