Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

how to fill authentication data from unit test in dsRequest

$
0
0
Hi Isomorphic,

<gwtVersion>2.4.0</gwtVersion>
<smartgwtGroupId>com.isomorphic.smartgwt</smartgwtGroupId>
<smartgwtVersion>3.1-p20140602</smartgwtVersion>

I am trying to create and execute DSRequest in an unit test. So far it works for me to mock and run the dsRequest via DSResponse execute = addDsRequest.execute() which is calling the appropriate DMI in my spring context and so forth and so on.

The problem that I am facing now is that the "insertedBy" field is not filled with the username of the logged in user. I have a datasource wich is inherited by other datasources with these fields:

<DataSource ID="wdMetaCreateInfo" serverType="sql">
<fields>
<field name="creationDate" type="creatorTimestamp" nativeName="INSERT_TS" escapeHTML="true"/>
<field name="insertedBy" type="creator" length="128" nativeName="INSERTED_BY" escapeHTML="true"/>
</fields>
</DataSource>

To mock the httpRequest within the dsRequest I used MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest();

Where should I set additionally the username in the HttRequest as header or as UserPrincipal so I make it work?

Thanks for any help,
zapryano

Viewing all articles
Browse latest Browse all 4756

Trending Articles