Comments (5)
VisitsViewTest
should be renamed to VisitsViewTests
(or the POM should be modified to include **/*Test.java
), and the XML configuration file should reside under the test resources
folder, in line with Maven's standard directory structure (i.e., src/test/resources/org/springframework/samples/petclinic/web/VisitsViewTests-config.xml
(assuming the test class was renamed)).
from spring-petclinic.
Thanks Sam! Thats very helpful.
from spring-petclinic.
I've made the changes accordingly. That's for spotting that issue!
I haven't moved the config file to the resources folder because it makes it a bit harder to find. So I've changed the POM so VisitsViewTests-config.xml can be loaded even though it's inside src/test/java
from spring-petclinic.
Is there a reason you're not using Spring's LocalValidatorFactoryBean
?
Also, using the TestContext framework to load an ApplicationContext
just to instantiate a validator is a bit of overkill. So why not make this an actual unit test like this?
public class ValidatorTests {
private Validator createValidator() {
LocalValidatorFactoryBean localValidatorFactoryBean = new LocalValidatorFactoryBean();
localValidatorFactoryBean.afterPropertiesSet();
return localValidatorFactoryBean;
}
@Test
public void emptyFirstName() {
Validator validator = createValidator();
// ...
}
}
from spring-petclinic.
Thanks Sam! I've made changes accordingly.
from spring-petclinic.
Related Issues (20)
- handle exception HOT 4
- gradle build fails when Docker is not available HOT 6
- Add owner HOT 6
- K HOT 1
- The "Find owner" functionality should be based on the first name, last name, and city, which is only based on last name HOT 1
- Owners should not be allowed to enter duplicate mobile numbers. HOT 3
- Telephone number validation is not user friendly while adding owner HOT 2
- "Confirmation messages are not displayed for 'Add, edit, or update' actions in the application." HOT 1
- For Add new pet functionality selection of "Type" are limited for all types of pet HOT 1
- build failure due to some postgresql issue HOT 1
- Error on linux and java 17 when running ./mvnw package HOT 12
- Unable to format code on gradle HOT 1
- The gradle build failed after adding spring.javaformat HOT 2
- The owner list described in the readme.md file was not found. HOT 2
- Compiling css does not work HOT 1
- do we have swagger in petclinic HOT 1
- Shouldn't the "name" property of the NamedEntity Bean be non nullable? HOT 1
- Fix test assertions on CrashControllerIntegrationTests.java
- Why not use Lombok? HOT 1
- PostgresIntegrationTests fails sometimes (maybe on a stale volume?) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-petclinic.