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
- 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
- make
new make(Type? iocModule := null)
Create a instance of
afBedSheet
with the given afIoc module (usually your web app)- makeClient
BedClient makeClient()
Create a BedClient that makes requests against this server
- registry
Registry registry { private set }
The
afIoc
registry - 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