Hi George,
I'm most interested in your Question on Unit Testing a REST service.
The approach I've taken seems similar to yours. Unfortunately I've not yet cracked a working Unit Test implementation for this scenario.
Equally I had already studied the documentation that 'Robert Cemper' suggested in his answer links. Also I note in the following link:
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY…
that a bunch of the %CSP.Stream methods are being deprecated from 2016.1 on. I have been unable to locate their replacement or alternative approach.
If you, Robert or anyone in the community can supply a working code sample of how to set the parameters of a %CSP.Request object would be much appreciated.
The following code compiles but fails on execution.
#dim status As %Status
#dim cspRequest As %CSP.Request = ##class(%CSP.Request).%New()
set status = cspRequest.Content.ContentTypeSet("application/json") => Fails => OREF Failure => I assume to do with %CSP.Stream
My aim with the Unit Test is to somehow have the class that Extends %CSP.REST be instansiated or ingest the cspRequest As %CSP.Request. This would allow for directly debugging the ClassMethods of the %CSP.REST class.
Much appreciate your assistance.
Cheers,
Gordon
- Log in to post comments