connect-group / thymeleaf-tdd

Test Driven Development framework for @Thymeleaf and Thymesheet
Apache License 2.0
3 stars 3 forks source link

ThymeleafTestEngine.java #1

Closed RK206 closed 10 years ago

RK206 commented 10 years ago

Changed getHttpServletRequest method to return same request object every time instead of creating new object. Added new method setHttpServletRequest.

4dz commented 10 years ago

Need to review carefully. Engine is Autowired so this will mean ALL tests in a class share same request object. The order in which tests run is not guaranteed. This will break existing tests and breaks junit rules generally since one Test should not break / influence another. We should look for an alternative method to solve this. What is the problem it is trying to solve?

RK206 commented 10 years ago

Please ignore the changes. I found an alternative way to the problem. I was trying to add parameters to HttpServletRequest and wanted to add model as well. This was solved by adding parameters and attributes to MockHttpServletRequest instead of adding to model. Thanks