Class Tm1Database
java.lang.Object
io.skipcheck.tm1.testcontainers.Tm1Database
A database of a
Tm1EngineContainer: what a test of TM1 v12 uses.
An engine holds instances, and an instance holds databases. The REST API of one
database is at getRestUrl(); a user logs in to its instance
(login()), and the session serves every database there.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanThe engine this database is in.The instance this database is in;tm1unless one was named.getName()The database's name.The REST API's service root as seen from the host, e.g.The version of TM1 the engine runs.inthashCode()login()A login asadmin, the administrator every database has.A login as a user.oauth2Login(String user) A login through OAuth 2.0: as a user the engine's Keycloak knows the password of (Tm1EngineContainer.withLogin(String, String)).A pass-through login as the TM1 11 server's own user (Tm1ServerContainer.getUsername()): the administrator of a server with its own users, or the first administrator of one in Cognos (CAM) security.passThroughLogin(String user) A pass-through login as a user whose password the containers know: one of Cognos's test users when the TM1 11 server is in CAM security, and otherwise that server's own user only.passThroughLogin(String user, String password) A pass-through login with a name and password of your own: a user you created on the TM1 11 server, or a wrong password to see refused.passThroughLoginWith(String authorization) A pass-through login with anAuthorizationheader of your own, which TM1 v12 passes on as it is:"CAMPassport " + passportfrom a Cognos logon, say.toString()
-
Method Details
-
getEngine
The engine this database is in.- Returns:
- the engine's container
-
getInstance
The instance this database is in;tm1unless one was named.- Returns:
- the instance's name
-
getName
-
getRestUrl
The REST API's service root as seen from the host, e.g.http://localhost:54321/tm1/api/v1/Databases('planning')/.- Returns:
- the service root, ending in
/
-
getVersion
The version of TM1 the engine runs. Only available once it has started.- Returns:
- the version
-
login
-
login
-
oauth2Login
A login through OAuth 2.0: as a user the engine's Keycloak knows the password of (Tm1EngineContainer.withLogin(String, String)). The login gets a token from Keycloak with that password and sends it to TM1, as a program acting for the user would.- Parameters:
user- the user's name- Returns:
- the login
- Throws:
IllegalStateException- if the engine has noTm1EngineContainer.withOAuth2(KeycloakContainer)IllegalArgumentException- if the user has no password
-
passThroughLogin
A pass-through login as the TM1 11 server's own user (Tm1ServerContainer.getUsername()): the administrator of a server with its own users, or the first administrator of one in Cognos (CAM) security. The login sends TM1 v12 what that server takes, and TM1 v12 asks it who that is.- Returns:
- the login
- Throws:
IllegalStateException- if the engine has noTm1EngineContainer.withPassThrough(Tm1ServerContainer)
-
passThroughLogin
A pass-through login as a user whose password the containers know: one of Cognos's test users when the TM1 11 server is in CAM security, and otherwise that server's own user only.- Parameters:
user- the user's name on the TM1 11 server, or in Cognos- Returns:
- the login
- Throws:
IllegalStateException- if the engine has noTm1EngineContainer.withPassThrough(Tm1ServerContainer)IllegalArgumentException- if the user's password isn't known
-
passThroughLogin
A pass-through login with a name and password of your own: a user you created on the TM1 11 server, or a wrong password to see refused. They go asBasic, or asCAMNamespacewhen the server is in CAM security.- Parameters:
user- the user's name on the TM1 11 server, or in Cognospassword- the password- Returns:
- the login
- Throws:
IllegalStateException- if the engine has noTm1EngineContainer.withPassThrough(Tm1ServerContainer)
-
passThroughLoginWith
A pass-through login with anAuthorizationheader of your own, which TM1 v12 passes on as it is:"CAMPassport " + passportfrom a Cognos logon, say.- Parameters:
authorization- the header's value- Returns:
- the login, with no user name or password
- Throws:
IllegalStateException- if the engine has noTm1EngineContainer.withPassThrough(Tm1ServerContainer)
-
equals
-
hashCode
-
toString
-