Class SilverpeasTestEnvironment
- java.lang.Object
-
- org.silverpeas.web.test.environment.SilverpeasTestEnvironment
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_DOMAIN
-
Constructor Summary
Constructors Constructor Description SilverpeasTestEnvironment()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUser(UserDetail userDetail)
Adds a user.User
createDefaultUser()
Creates a default user to use in the test case.static SilverpeasTestEnvironment
get()
Gets the Silverpeas environment.ComponentInst
getDummyPublicComponent()
Gets the dummy component created into database at start of the test.String
getTokenOf(User userDetail)
Gets the token of a user that must be passed into the request header "Authorization" as a value of a bearer authorization scheme.void
removeAllProfiles(ComponentInst componentInst)
Removes all the user profiles set for the specified component instance.void
removeAllProfiles(SpaceInst spaceInst)
Removes all the user profiles set for the specified space instance.void
updateComponent(ComponentInst componentInst)
Updates the database with the given component instance.
-
-
-
Field Detail
-
DEFAULT_DOMAIN
public static final String DEFAULT_DOMAIN
- See Also:
- Constant Field Values
-
-
Method Detail
-
get
public static SilverpeasTestEnvironment get()
Gets the Silverpeas environment.- Returns:
- the instance of the Silverpeas environment.
-
createDefaultUser
public User createDefaultUser()
Creates a default user to use in the test case.- Returns:
- the detail about the user in use in the current test case.
-
addUser
public void addUser(UserDetail userDetail)
Adds a user.
-
getTokenOf
public String getTokenOf(User userDetail)
Gets the token of a user that must be passed into the request header "Authorization" as a value of a bearer authorization scheme.- Parameters:
userDetail
- the user details for which the token is needed.- Returns:
- the API token of the given user.
-
getDummyPublicComponent
public ComponentInst getDummyPublicComponent()
Gets the dummy component created into database at start of the test.- Returns:
- a
ComponentInst
instance that represents the dummy component.
-
updateComponent
public void updateComponent(ComponentInst componentInst)
Updates the database with the given component instance.- Parameters:
componentInst
- theComponentInst
instance
-
removeAllProfiles
public void removeAllProfiles(ComponentInst componentInst)
Removes all the user profiles set for the specified component instance. So, nobody will be authorized to access and to modify the contributions managed by the component instance.- Parameters:
componentInst
- the component instance.
-
removeAllProfiles
public void removeAllProfiles(SpaceInst spaceInst)
Removes all the user profiles set for the specified space instance. So, nobody will be authorized to access the space and the component instances in it.- Parameters:
spaceInst
- the space instance.
-
-