I've got a stripes/spring/jpa/jsp/hibernate/mysql stack web application. I'm looking to implement some sort of automated testing, but I'm really unsure of how to approach this.
I've had a look at JUnit as that seemed the natural choice, but how can I run tests on such simple code as below?
For example, one of my JSPs looks like this, is there anyway I can test to make sure the variables are correct? Say I rename some attributes on my domain class, I'd like a test to fail if I forget to go through my JSPs and rename attributes
Should I not be as concerned about testing? Testing is good practice, and so far I haven't done any, I really want to change this but could do with some advice
The two things would (necessarily) be tested completely differently. If you want to test the output of a JSP you really want to do integration testing, driving a browser, and so on. Testing the first method can really depend: do you want to test your full JPA stack (also integration testing), or do you want to test what persistClient itself is doing, which is do one behavior if there's no ID, or a different one if there is?