ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
database_helper Class Reference

Provides database setup and cleanup utilities for tests. More...

#include <database_helper.hpp>

Collaboration diagram for database_helper:
Collaboration graph

Public Member Functions

void seed_rbac ()
 Seeds minimal RBAC data for tests.
 
void set_tenant_context ()
 Sets the tenant context for tests.
 
database::contextcontext ()
 Gets the database context.
 
utility::uuid::tenant_id tenant_id ()
 Gets the test tenant ID.
 
std::string db_user ()
 Gets the database user for the current connection.
 

Detailed Description

Provides database setup and cleanup utilities for tests.

Member Function Documentation

◆ seed_rbac()

void seed_rbac ( )

Seeds minimal RBAC data for tests.

Creates the essential permissions and roles needed for IAM tests:

  • Wildcard permission (*)
  • Admin role with wildcard permission

This is idempotent - safe to call multiple times.

Here is the caller graph for this function:

◆ set_tenant_context()

void set_tenant_context ( )

Sets the tenant context for tests.

Uses the test tenant ID from the environment variable if set (set by database_lifecycle_listener), otherwise falls back to the system tenant.