RequiresCognos
import io.skipcheck.tm1.testcontainers.RequiresCognos;Runs a test class or method that needs IBM Cognos Analytics (CAM security) as well as TM1, and skips it when either isn't available.
It includes RequiresTm1, so tests also skip without Docker or a
Tm1Source. Declare a CognosSource parameter to get the source
CognosSource.discover found. Cognos takes minutes to start and its test users
vary by test, so there's no shared Cognos: build a CognosContainer with the
users the test needs.
@RequiresCognos
static class CamSecurityTest {
@Test
void readersCanOnlyRead(CognosSource cognosSource) {
// No shared Cognos: each test starts its own, with the users it needs
try (var cognos = new CognosContainer(cognosSource).withUser("viewer", "viewerpw", "Readers")) {
cognos.start();
// ...
}
}
}
Members
NO_SOURCE_MESSAGE static | Why tests skip when no Cognos source is configured, and what to set. |
NO_SOURCE_MESSAGE
staticString NO_SOURCE_MESSAGEWhy tests skip when no Cognos source is configured, and what to set.
Also in the Javadoc.