Package org.silverpeas.web.environment
Class SilverpeasEnvironmentTest
- java.lang.Object
-
- org.silverpeas.web.environment.SilverpeasEnvironmentTest
-
@Technical @Bean @Singleton public class SilverpeasEnvironmentTest extends Object
This class permits to load easily a Silverpeas Environment:- Spaces
- Components
- Users
- etc.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_DOMAIN
-
Constructor Summary
Constructors Constructor Description SilverpeasEnvironmentTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SilverpeasEnvironmentTestaddUser(UserDetail userDetail)Adds a user.UsercreateDefaultUser()Creates a default user to use in the test case.static SilverpeasEnvironmentTestget()Gets the Silverpeas environment.ComponentInstgetDummyPublicComponent()Gets the dummy component created into database at start of the test.StringgetTokenOf(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.SilverpeasEnvironmentTestupdateComponent(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 SilverpeasEnvironmentTest 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 SilverpeasEnvironmentTest 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
ComponentInstinstance that represents the dummy component.
-
updateComponent
public SilverpeasEnvironmentTest updateComponent(ComponentInst componentInst)
Updates the database with the given component instance.- Parameters:
componentInst- theComponentInstinstance- Returns:
- the manager of test environment itself.
-
-