Package ai.platon.pulsar.test.server
Class MockSiteStarter
-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public final class MockSiteStarter implements AutoCloseable
Reusable utility to wait for a demo/mock site to become available.
Features:
Tries a health endpoint first (default /actuator/health) then falls back to root / (optional)
Configurable timeouts & intervals
Returns true if any probe gets a 2xx/3xx response
This logic was extracted from SessionInstructionsExample so other demos/examples can share it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classMockSiteStarter.Options
-
Constructor Summary
Constructors Constructor Description MockSiteStarter()
-
Method Summary
-
-
Method Detail
-
start
final Unit start(String url)
Ensure the mock site serving the given url is started. Extracts the explicit port from the URL; if absent uses system/env configured port or sensible fallbacks (8182, then 8080) instead of the protocol default (80).
-
wait
final Boolean wait(String pageUrl, MockSiteStarter.Options options)
Wait for the site referred to by a full page URL (any path under host). Only host/port are probed.
- Parameters:
pageUrl- Any URL within the target host (ex: http://localhost:8182/generated/tta/instructions/instructions-demo.
-
-
-
-