I think we just answered this one.
We are not trying to reproduce the servlet request behaviour, we are=20
trying to instrument a stub that will get us through the test and tell=20
us if the right things happened. If you expect to get a header that is=20
not set, then you should call setupAddHeader("header name", null) -- or=20
whatever the call is -- which will confirm that the client code=20
requested the right header field, and then return a preset value, null.=20
How else can we ensure that your target code has not called an=20
unexpected header?
S.
Ga=EBl Marziou wrote:
> Hello,
>=20
> I'm new to mockobjects, so I may have got something wrong.
>=20
> In MockHttpServletRequest version 1.18 (J2EE 1.3), the
> getHeader() method should not throw an AssertFailError
> when the requested header is not present because the
> javadoc for this method says:
>=20
> If the request did not include a header of the specified
> name, this method returns null.
>=20
> So, with the current behavior I cannot test my code
> error handling when request.getHeader() returns null on
> not existing header.
>=20
> Or maybe there is a way to disable this assertion
> checking?
>=20
> Thanks for any help
>=20
> Ga=EBl
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_0=
1/01
> _______________________________________________
> Mockobjects-java-users mailing list
> Moc...@li...
> https://lists.sourceforge.net/lists/listinfo/mockobjects-java-users
|