Owner Registration Tests
OpenFrame Documentation
Get the most out of OpenFrame · Book 30 minutes with Conrad, 25 years in IT. He'll show you what Mingo and Fae can take off your list.
OpenFrame Documentation
Owner Registration Tests is the ordered end-to-end test suite that establishes an initial tenant owner and verifies the baseline conditions created by that registration. It also contains negative coverage for registration attempts that must be rejected. The tests are supplied by the com.openframe.oss:openframe-test-service-core library at version 7.0.11 and are run by this repository's OpenFrame test service.
The suite has two JUnit 5 classes:
OwnerRegistrationTest provisions an owner, signs in as that user, and confirms that registration created a default organization.OwnerRegistrationNegativeTest verifies rejection when public registration is closed and when an email already belongs to an owner.The positive test class is explicitly ordered and described in its source as running before the remaining tests. Its first test makes a new owner account and records the successful tenant in PipelineContext. Later tests use the same generated user to validate authentication and organization provisioning. This creates the tenant context required by the broader end-to-end test pipeline without publishing a tenant if registration fails.
The negative class is separately tagged for OSS and negative-registration execution. It probes two business rules through the registration boundary and asserts only that the response is an HTTP error, which permits either client-side or server-side rejection while preserving the behavior under test.
flowchart TD
TestRunner["JUnit Test Runner"] --> Positive["Owner Registration Test"]
TestRunner --> Negative["Owner Registration Negative Test"]
Positive --> Generator["Registration Generator"]
Positive --> RegistrationApi["Registration API"]
Positive --> AuthFlow["Authentication Flow"]
Positive --> UserApi["User API"]
Positive --> OrganizationApi["Organization API"]
Positive --> PipelineContext["Pipeline Context"]
Negative --> ExistingUsers["User API"]
Negative --> RegistrationApi
RegistrationApi --> Platform["OpenFrame Registration Services"]
AuthFlow --> Platform
UserApi --> Platform
OrganizationApi --> Platform
The tests deliberately use API and authentication helpers rather than database writes. As a result, they verify the observable lifecycle across registration, login, authenticated identity lookup, and default organization retrieval.
OwnerRegistrationTest uses @TestMethodOrder(MethodOrderer.OrderAnnotation.class) to make the account lifecycle deterministic. @BeforeAll randomizes environment and user configuration before registration begins.
sequenceDiagram
participant Suite as "Owner Registration Test"
participant Generator as "Registration Generator"
participant Registration as "Registration API"
participant Context as "Pipeline Context"
participant Auth as "Authentication Flow"
participant User as "User API"
participant Organization as "Organization API"
Suite->>Generator: Create new owner request
Generator-->>Suite: Registration request and expected response
Suite->>Registration: Register owner
Registration-->>Suite: Registration response
Suite->>Context: Record registered tenant after success
Suite->>Auth: Login generated user
Auth-->>Suite: Session cookies
Suite->>User: Read current user
User-->>Suite: Authenticated response
Suite->>Organization: List organizations
Organization-->>Suite: Default organization list
| Order | Test | Verified outcome | Key collaborators |
|---|---|---|---|
| 1 | Register Owner User | The response has an ID, owner ID, and update time. All expected generated fields match after excluding server-generated identifiers, timestamps, HubSpot data, and plan. | RegistrationGenerator, RegistrationApi, PipelineContext |
| 2 | Login Owner User | The generated user can log in and the current-user response is authenticated. | AuthFlow, AuthHelper, UserApi |
| 3 | Check Default Organization Created | An authenticated owner can retrieve at least one organization, demonstrating post-registration default organization provisioning. | AuthFlow, AuthHelper, OrganizationApi |
After the registration response passes its assertions, the test writes the generated user email and test user domain to PipelineContext. The ordering is important: the context is populated only after successful registration. If registration fails, the code leaves it unset, allowing the all-tests pipeline to use its request-tenant fallback rather than incorrectly targeting a partially created tenant.
OwnerRegistrationNegativeTest carries the oss and registration-negative tags. Its methods make an attempted registration and expect a status code greater than or equal to 400.
flowchart LR
Start["Negative Test"] --> Scenario{"Registration scenario?"}
Scenario -->|"Registration closed"| NewRequest["Generate new user request"]
Scenario -->|"Existing email"| Owners["Load owner users"]
Owners --> ExistingRequest["Generate request with existing email"]
NewRequest --> Attempt["Attempt registration"]
ExistingRequest --> Attempt
Attempt --> Rejected{"Status code at least 400?"}
Rejected -->|"Yes"| Pass["Rule enforced"]
Rejected -->|"No"| Fail["Test fails"]
The duplicate-email scenario first requires the owner-user list to be nonempty. This prevents the test from constructing a duplicate request from absent fixture state and makes its precondition explicit.
The OwnerRegistrationTest class is the positive lifecycle suite.
UserApi.me() reports an authenticated user.The OwnerRegistrationNegativeTest class is the policy-rejection suite.
400 or higher as a successful rejection.The module belongs to the openframe-test-service-core library, consumed by OpenFrame OSS Tenant as com.openframe.oss:openframe-test-service-core:7.0.11. It depends on test-framework collaborators that create requests, invoke registration and resource APIs, establish sessions, and preserve pipeline state. Their implementations are outside this two-class module, so this document describes their observed roles rather than their internal protocol details.
At run time, the tested flows exercise the OpenFrame authentication and registration surface, then verify organization availability through the public test APIs. The broader platform provides tenant registration through the authorization-service core and API-layer capabilities, while this module remains a consumer-focused end-to-end verification layer.
registration.oss and registration-negative.AuthHelper.