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

addModulesFromDependencies

Source

BedServer addModulesFromDependencies(Pod dependency)

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

makeClient

Source

BedClient makeClient()

Create a BedClient that makes requests against this server

makeWithModule

Source

new makeWithModule(Type? iocModule := null)

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

makeWithPod

Source

new makeWithPod(Pod webApp)

Create a instance of afBedSheet with afIoc dependencies from the given pod (usually your web app)

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