Annotation Interface RequiresCognos
@Target({TYPE,METHOD})
@Retention(RUNTIME)
@Documented
@RequiresTm1
@ExtendWith(io.skipcheck.tm1.testcontainers.CognosExtension.class)
public @interface 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();
// ...
}
}
}
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWhy tests skip when no Cognos source is configured, and what to set.
-
Field Details
-
NO_SOURCE_MESSAGE
Why tests skip when no Cognos source is configured, and what to set.- See Also:
-