Class PlanningAnalyticsEnvironment.Builder
java.lang.Object
io.skipcheck.tm1.testcontainers.PlanningAnalyticsEnvironment.Builder
- Enclosing class:
PlanningAnalyticsEnvironment
Builds a
PlanningAnalyticsEnvironment. Every part is optional.-
Method Summary
Modifier and TypeMethodDescriptionAdds a shared Admin Server, even for one TM1 server.adminServer(Consumer<Tm1AdminServerContainer> customizer) Adds a shared Admin Server.build()Creates the containers and wires them together.camSecurity(CognosContainer.Namespace namespace, String... admins) How the TM1 servers use Cognos: the namespace their administrators and groups are in, and which test users are TM1 administrators.cognos(Consumer<CognosContainer> customizer) Adds Cognos, and runs every TM1 server in CAM security against it (camSecurity(CognosContainer.Namespace, String...)).cognosSource(CognosSource source) Where Cognos comes from;CognosSource.discover()by default.keycloak()Adds Keycloak, giving Cognos an OIDC namespace with the same test users.keycloak(Consumer<KeycloakContainer> customizer) Adds Keycloak.network(org.testcontainers.containers.Network network) The Docker network to put everything on; a new one, removed byStartable.close(), by default.paw(Consumer<PawContainer> customizer) Adds PAW, logging users on to the first TM1 server and listing every one.Where PAW comes from;PawSource.discover()by default.reuse(boolean reuse) Keeps the containers running between test runs, when you've also turned on Testcontainers reuse (testcontainers.reuse.enable=truein~/.testcontainers.properties, orTESTCONTAINERS_REUSE_ENABLE=true).Adds a TM1 server with an empty database.tm1(String name, Consumer<Tm1ServerContainer> customizer) Adds a TM1 server.Where TM1 comes from;Tm1Source.discover()by default.tm1Web()Adds TM1 Web, listing every TM1 server.tm1Web(Consumer<Tm1WebContainer> customizer) Adds TM1 Web.tm1WebSource(Tm1WebSource source) Where TM1 Web comes from;Tm1WebSource.discover()by default.
-
Method Details
-
tm1
Adds a TM1 server with an empty database.- Parameters:
name- its name (ServerName), also its name on the network- Returns:
- this builder
-
tm1
public PlanningAnalyticsEnvironment.Builder tm1(String name, Consumer<Tm1ServerContainer> customizer) Adds a TM1 server.- Parameters:
name- its name (ServerName), also its name on the network: letters, digits,_and-customizer- configures the container, e.g.withSeedorwithData- Returns:
- this builder
- Throws:
IllegalArgumentException- if the name isn't allowed or is already used
-
adminServer
Adds a shared Admin Server, even for one TM1 server. With more than one, it's added anyway.- Returns:
- this builder
-
adminServer
public PlanningAnalyticsEnvironment.Builder adminServer(Consumer<Tm1AdminServerContainer> customizer) Adds a shared Admin Server.- Parameters:
customizer- configures the container- Returns:
- this builder
-
tm1Web
Adds TM1 Web, listing every TM1 server.- Returns:
- this builder
-
tm1Web
Adds TM1 Web.- Parameters:
customizer- configures the container, e.g.TM1_WEB_HEAP- Returns:
- this builder
-
paw
Adds PAW, logging users on to the first TM1 server and listing every one. IBM's license must be accepted (PawContainer.acceptLicense()in the customizer, orPAW_ACCEPT_LICENSE=true). Withcognos, users log on to PAW through Cognos, in the CAM namespace.- Parameters:
customizer- configures the container- Returns:
- this builder
-
cognos
Adds Cognos, and runs every TM1 server in CAM security against it (camSecurity(CognosContainer.Namespace, String...)).- Parameters:
customizer- configures the container, and adds its test users withCognosContainer.withUser(String, String, String...)- Returns:
- this builder
-
keycloak
Adds Keycloak, giving Cognos an OIDC namespace with the same test users. Needscognos.- Returns:
- this builder
-
keycloak
Adds Keycloak.- Parameters:
customizer- configures the container- Returns:
- this builder
-
camSecurity
public PlanningAnalyticsEnvironment.Builder camSecurity(CognosContainer.Namespace namespace, String... admins) How the TM1 servers use Cognos: the namespace their administrators and groups are in, and which test users are TM1 administrators. Default:CognosContainer.Namespace.LDAP, with the first test user as the administrator.- Parameters:
namespace- the namespace (CognosContainer.Namespace.OIDCneedskeycloak())admins- test users to make TM1 administrators; none for the first test user- Returns:
- this builder
-
tm1Source
Where TM1 comes from;Tm1Source.discover()by default.- Parameters:
source- the source- Returns:
- this builder
-
tm1WebSource
Where TM1 Web comes from;Tm1WebSource.discover()by default.- Parameters:
source- the source- Returns:
- this builder
-
pawSource
Where PAW comes from;PawSource.discover()by default.- Parameters:
source- the source- Returns:
- this builder
-
cognosSource
Where Cognos comes from;CognosSource.discover()by default.- Parameters:
source- the source- Returns:
- this builder
-
network
The Docker network to put everything on; a new one, removed byStartable.close(), by default.- Parameters:
network- the network- Returns:
- this builder
-
reuse
Keeps the containers running between test runs, when you've also turned on Testcontainers reuse (testcontainers.reuse.enable=truein~/.testcontainers.properties, orTESTCONTAINERS_REUSE_ENABLE=true). A later run with the same configuration finds them, and objects tests left behind are still there. Without the switch it has no effect. SeePlanningAnalyticsEnvironmentfor what's reused and how to start clean.With your own
network, reuse only works if it's the same network each run: Testcontainers finds a container by everything it's created with, including its network's ID.- Parameters:
reuse- whether to keep the containers- Returns:
- this builder
-
build
Creates the containers and wires them together. Nothing starts untilPlanningAnalyticsEnvironment.start().- Returns:
- the environment
- Throws:
IllegalStateException- if a part needs one that's missing, or a source can't be found
-