November 2018
Intermediate to advanced
388 pages
9h 5m
English
We then mock the response for the identity-creation operation:
val mockResponse = TestUtil.getResponseForIdentityCreation(uuid)
When the createPerson() function is invoked on the serviceImpl instance, a uuid will be returned:
`when`(serviceImpl.createPerson(createPersonRequest)) .thenReturn(uuid)
When the build() method of the Response class is invoked, the mocked response will be returned:
`when`(builder.build()) .thenReturn(mockResponse)
We invoke createPerson() on the mocked controller instance:
controller.createPerson(createPersonRequest)
Read now
Unlock full access