Skip to content

feat: improve context API and tester scanning#62

Open
mcollovati wants to merge 4 commits into
mainfrom
issues/61-refactor_caches_and_hide_internal_api_usage
Open

feat: improve context API and tester scanning#62
mcollovati wants to merge 4 commits into
mainfrom
issues/61-refactor_caches_and_hide_internal_api_usage

Conversation

@mcollovati
Copy link
Copy Markdown
Contributor

The multi-user context factory exposed the internal Routes type and offered no way to scan custom component testers. The Spring and Quarkus factories carried the same Routes leak.

Public factories now take view packages or view classes directly, and the builder exposes withComponentTesterPackages(...) for registering custom testers when creating an application context.

Closes #61

@mcollovati
Copy link
Copy Markdown
Contributor Author

This PR is made on top of #60, the target branch needs to be updated accordingly after the other changes are merged.
An alternative is to review this and merge it into #60

@mcollovati mcollovati force-pushed the refactor/browserless_dsl branch from ffcb8f2 to e7a59c9 Compare May 15, 2026 10:30
@mcollovati mcollovati force-pushed the issues/61-refactor_caches_and_hide_internal_api_usage branch from 3c0a746 to 568bd46 Compare May 15, 2026 10:39
@mshabarov mshabarov self-requested a review May 18, 2026 12:45
Base automatically changed from refactor/browserless_dsl to main May 20, 2026 07:07
The multi-user context factory exposed the internal `Routes` type and
offered no way to scan custom component testers. The Spring and Quarkus
factories carried the same `Routes` leak.

Public factories now take view packages or view classes directly, and
the builder exposes `withComponentTesterPackages(...)` for registering
custom testers when creating an application context.

Closes #61
@mcollovati mcollovati force-pushed the issues/61-refactor_caches_and_hide_internal_api_usage branch from 568bd46 to 5ea90f9 Compare May 20, 2026 07:17
@mcollovati mcollovati marked this pull request as ready for review May 20, 2026 11:02
Public `BrowserlessApplicationContext.create(Routes)` and the
package-private `Builder(Routes)` constructor were leaking the internal
`Routes` type into tests, even though `RouteDiscovery` now caches
discovered routes per package process-wide, so sharing a `Routes`
instance across contexts is no longer a useful optimization.

Remove `create(Routes)` from the public API and migrate the 23
affected junit6 call sites to `create(<View>.class)`,
`create(UnaryOperator)`, or `createSecured(...)` as appropriate.
`BrowserlessClosePathCleanupTest` collapses its six repeating
`createSecured(...)` lambdas into a `securedAppFor(handler)` helper.
`Builder(Routes)` stays package-private for the shared/
Builder-contract tests that exercise it directly. Also fix a stale
Javadoc reference to `BrowserlessApplicationContext#builder(Routes)`.

Part of #61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant