Skip to content
Snippets Groups Projects
Commit 4f8063e9 authored by Mic's avatar Mic
Browse files

#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
parent eb8ba79b
No related branches found
No related tags found
No related merge requests found
...@@ -318,9 +318,19 @@ ...@@ -318,9 +318,19 @@
</dependencies> </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> <build>
<defaultGoal>install</defaultGoal> <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> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
...@@ -380,20 +390,6 @@ ...@@ -380,20 +390,6 @@
</additionalProjectnatures> </additionalProjectnatures>
</configuration> </configuration>
</plugin> </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> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
...@@ -415,48 +411,6 @@ ...@@ -415,48 +411,6 @@
</configuration> </configuration>
</plugin> </plugin>
</plugins> </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> </build>
</project> </project>
...@@ -20,9 +20,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; ...@@ -20,9 +20,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
* (useful when upgrading to a new version of Hibernate Validator/ Bean Validation) * (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) @RunWith(SpringJUnit4ClassRunner.class)
public class ValidatorTest { public class ValidatorTests {
@Autowired @Autowired
private Validator validator; private Validator validator;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment