const classafBedSheet::BedServer
sys::Obj afBedSheet::BedServer
For testing: Allows tests to be run against an instance of afBedSheet without starting the wisp web server. Testing your web app is as simple as:
Void testMywebApp() {
server := BedServer(AppModule#).startup
client := server.makeClient
response := client.get(`/hello`)
verifyEq(response.statusCode, 200)
verifyEq(response.asStr, "Hello!")
server.shutdown
}@since 1.0.4
- addModule
BedServer addModule(Type iocModule)Add extra (test) modules should you wish to override behaviour in your tests
- addModulesFromDependencies
BedServer addModulesFromDependencies(Pod dependency)- autobuild
Obj autobuild(Type type, Obj?[] ctorArgs := Obj#.emptyList())Helper method - tap into BedSheet's afIoc registry
- dependencyByType
Obj dependencyByType(Type dependencyType)Helper method - tap into BedSheet's afIoc registry
- injectIntoFields
Obj injectIntoFields(Obj service)Helper method - tap into BedSheet's afIoc registry
- makeClient
BedClient makeClient()Create a BedClient that makes requests against this server
- makeWithModule
new makeWithModule(Type? iocModule := null)Create a instance of
afBedSheetwith the given afIoc module (usually your web app)- makeWithPod
new makeWithPod(Pod webApp)Create a instance of
afBedSheetwith afIoc dependencies from the given pod (usually your web app)- registry
Registry registry { private set }The
afIocregistry - read only.- serviceById
Obj serviceById(Str serviceId)Helper method - tap into BedSheet's afIoc registry
- shutdown
BedServer shutdown()Shutdown
afBedSheet- startup
BedServer startup()Startup
afBedSheet