In recent years, I have been working on Java-based web applications using the Spring MVC framework. Projects have good testing coverage with JUnit and Selenium. However, in two cases, errors in the Spring configuration went through the testing process.
In one case, the change was made to the parent bean in the controllerContext.xml file, which also required a change for the two inheriting beans. But the required change was made only for one of the two inheriting beans. The error was visible only in a small but important part of the web application. Selenium UA tests were later extended to test this directly in the web application. before deployment, but the damage has already been done since the mistake turned it into a living environment.
In another case, the property required to set the data format was not correctly entered through applicationContext.xml. The only visible error was in the date format of the generated report downloaded from the web application. Hard to check with selenium.
One of the benefits of using Spring MVC is the ability to set the injected objects into your JUnit tests (i.e. the layout of the object), but this does not tell you what you are actually going to type when the application is running in a live environment.
The answer may be integration testing, but setting up and running integration testing in the past proved difficult ... but this is another question ...
So, I would be very interested to know how people tried to catch the possible errors made to the Spring configuration files.
So my question is:
What is the best way to check for errors in a Spring configuration?
source share