mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 12:15:50 +00:00
#18 fixing 2 errors related to ValidatorTests
- test didn't have the suffix "Tests" so it was not taken into account when running Maven in the comand line - the POM was not configured so it can find Spring config files placed inside src/test/java
This commit is contained in:
parent
eb8ba79ba1
commit
4f8063e9b8
3 changed files with 13 additions and 59 deletions
68
pom.xml
68
pom.xml
|
@ -318,9 +318,19 @@
|
|||
|
||||
</dependencies>
|
||||
|
||||
<!-- all Maven plugin versions are mentioned in order to guarantee the build reproducibility in the long term -->
|
||||
<!-- Maven plugin versions are mentioned in order to guarantee the build reproducibility in the long term -->
|
||||
<build>
|
||||
<defaultGoal>install</defaultGoal>
|
||||
<testResources>
|
||||
<testResource>
|
||||
<!-- declared explicitly so Spring config files can be placed next to their corresponding JUnit test class
|
||||
(see example with ValidatorTests) -->
|
||||
<directory>${project.basedir}/src/test/java</directory>
|
||||
</testResource>
|
||||
<testResource>
|
||||
<directory>${project.basedir}/src/test/resources</directory>
|
||||
</testResource>
|
||||
</testResources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@ -380,20 +390,6 @@
|
|||
</additionalProjectnatures>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>install</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>sources</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
|
@ -415,48 +411,6 @@
|
|||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
<pluginExecution>
|
||||
<pluginExecutionFilter>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
<versionRange>[1.0.0,)</versionRange>
|
||||
<goals>
|
||||
<goal>enforce</goal>
|
||||
</goals>
|
||||
</pluginExecutionFilter>
|
||||
<action>
|
||||
<execute />
|
||||
</action>
|
||||
</pluginExecution>
|
||||
<pluginExecution>
|
||||
<pluginExecutionFilter>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<versionRange>[2.4,)</versionRange>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
<goal>sources</goal>
|
||||
</goals>
|
||||
</pluginExecutionFilter>
|
||||
<action>
|
||||
<execute />
|
||||
</action>
|
||||
</pluginExecution>
|
||||
</pluginExecutions>
|
||||
</lifecycleMappingMetadata>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -20,9 +20,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|||
* (useful when upgrading to a new version of Hibernate Validator/ Bean Validation)
|
||||
*
|
||||
*/
|
||||
@ContextConfiguration(locations = {"ValidatorTest-config.xml"})
|
||||
@ContextConfiguration(locations = {"ValidatorTests-config.xml"})
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class ValidatorTest {
|
||||
public class ValidatorTests {
|
||||
|
||||
@Autowired
|
||||
private Validator validator;
|
Loading…
Reference in a new issue