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

Source

BedServer addModule(Type iocModule)

Add extra (test) modules should you wish to override behaviour in your tests

autobuild

Source

Obj autobuild(Type type, Obj?[] ctorArgs := Obj#.emptyList())

Helper method - tap into BedSheet's afIoc registry

dependencyByType

Source

Obj dependencyByType(Type dependencyType)

Helper method - tap into BedSheet's afIoc registry

injectIntoFields

Source

Obj injectIntoFields(Obj service)

Helper method - tap into BedSheet's afIoc registry

make

Source

new make(Type? iocModule := null)

Create a instance of afBedSheet with the given afIoc module (usually your web app)

makeClient

Source

BedClient makeClient()

Create a BedClient that makes requests against this server

registry

Source

Registry registry { private set }

The afIoc registry - read only.

serviceById

Source

Obj serviceById(Str serviceId)

Helper method - tap into BedSheet's afIoc registry

shutdown

Source

BedServer shutdown()

Shutdown afBedSheet

startup

Source

BedServer startup()

Startup afBedSheet