Non JSP Login Page for IDP

Etienne Dysli-Metref etienne.dysli-metref at
Tue Aug 4 02:49:42 EDT 2015

On 31/07/15 18:42, Bjorn Stange wrote:
> I am working on a project that has requirements for high code
> coverage percentages and the project leadership wants us to replace
> the JSP Login Page for the IDP with a node application so that unit
> tests can be written for it. My question to you is, is this even
> feasible? From what I have been able to gather from the documentation
> it seems that a JSP servlet and container context is expected for
> this. Am I mistaken? Any feedback would be greatly appreciated,
> thanks!

I am assuming here that you do not put any logic inside your views and
only want to test the rendering (like correct variable replacement).

JSP rendering is harder to test because you would need to run a JSP
compiler inside your test (seems really complicated to me) or deploy
your application to a container and test from the outside with something
like Selenium. Selenium works, but this is a much slower form of testing
than running something with JUnit. Templating technologies like Velocity
are easier to test according to the Spring MVC Test Framework
documentation [1] (haven't tried myself yet):

> This means if you are using JSPs you can verify the JSP page to which
> the request was forwarded but there won't be any HTML rendered. Note
> however that all other rendering technologies that don't rely on
> forwarding such as Thymeleaf, Freemarker, Velocity will render HTML
> to the response body as expected. The same is true for rendering
> JSON, XML and others via @ResponseBody methods.

I wouldn't call these tests "unit tests" because they run the Spring
Framework, I'd rather call them "integration tests", even though I write
them using JUnit.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the users mailing list