November 2018
Intermediate to advanced
388 pages
9h 5m
English
Now let's write a test class to verify the chaining of handlers:
fun main(args: Array<String>) { val personAuditHandler = PersonAuditHandler() val organizationAuditHandler = OrganizationAuditHandler() val groupAuditHandler = GroupAuditHandler() val deviceAuditHandler = DeviceAuditHandler() organizationAuditHandler.addHandler(groupAuditHandler) groupAuditHandler.addHandler(deviceAuditHandler) deviceAuditHandler.addHandler(personAuditHandler) organizationAuditHandler.handleRequest(creaeSamplePersonRequest()) }
In this class, we created instances of handler implementations and chained them using the addHandler() function. We also created a sample Person identity that we pass to the handleRequest() function. ...
Read now
Unlock full access