I am not clear what I should use my free time doing. Right now I am still going through the Struts 2 tutorials, and I am also upgrading a few web apps that I made a few years ago.
I tried to recompile an old app with Maven, and it took a long time because I had to track down the latest versions of all the dependencies. I am also struggling with testing it as well. I am having a hard time setting things up so that the tests hit a different database than the “production” app. I could just edit the hibernate.cfg.xml file in src/main/resources, but I would prefer to do things the “right” way.
I tried using src/test/resources/hibernate.cfg.xml, but that did not work. I know that editing the prod file is not quite correct, but I figure I could spend more time trying to work on that, or I could write some tests.
It is a bit frustrating that there are a LOT of sample apps that do not have tests included, and also do not have test configurations as well.
I know some people say that tests should never touch the database, but personally I think that is kind of dumb. All this app does is change the database. I am not against mocking and stubbing, and if you are calling external services you need it. But I do not understand the stance that some fundamentalists take that your tests should NEVER touch the database. Changing databases is what a lot of applications do. If all you are doing is using mocks, then you are not testing your app. You are testing some artificial thing that is not really your app.
Image from an 11th century manuscript housed at Bibliotheken Schaffhausen (Wikipedia page here), image from e-Codices, assumed allowed under Fair Use.