Include context inside uc.authorize() #44
Labels
hacktoberfest
help wanted
Extra attention is needed
question
Further information is requested
severity-minor
Item is not urgent
Hey guys, I came across a problem theses days, which was:
I needed to test a use case that had an external client call inside authorize(), like calling another micro service to check some user permissions before authorizing the use case execution.
I did realize that I could not inject the external client while testing, because .authorize() do not receive the use case context as a parameter, so I needed to mock the hole external client require or override the ._authorize()
I dont know if its an real issue and we should add ctx inside the authorize() or that is the expected behavior, since its a convention to not use context inside authorize step. What your thoughts on this?
The text was updated successfully, but these errors were encountered: