add integration test profile
This commit is contained in:
		
							parent
							
								
									1e9d1a7566
								
							
						
					
					
						commit
						903c9c5299
					
				| @ -37,7 +37,6 @@ | |||||||
| 		<dependency> | 		<dependency> | ||||||
| 			<groupId>org.apache.httpcomponents</groupId> | 			<groupId>org.apache.httpcomponents</groupId> | ||||||
| 			<artifactId>httpclient</artifactId> | 			<artifactId>httpclient</artifactId> | ||||||
| 			<version>4.5.2</version> |  | ||||||
| 		</dependency> | 		</dependency> | ||||||
| 	</dependencies> | 	</dependencies> | ||||||
| 
 | 
 | ||||||
| @ -47,12 +46,57 @@ | |||||||
| 			<plugin> | 			<plugin> | ||||||
| 				<groupId>org.apache.maven.plugins</groupId> | 				<groupId>org.apache.maven.plugins</groupId> | ||||||
| 				<artifactId>maven-compiler-plugin</artifactId> | 				<artifactId>maven-compiler-plugin</artifactId> | ||||||
| 				<version>3.3</version> |  | ||||||
| 				<configuration> | 				<configuration> | ||||||
| 					<source>1.8</source> | 					<source>1.8</source> | ||||||
| 					<target>1.8</target> | 					<target>1.8</target> | ||||||
| 				</configuration> | 				</configuration> | ||||||
| 			</plugin> | 			</plugin> | ||||||
|  | 			 | ||||||
|  |             <plugin> | ||||||
|  |                 <groupId>org.apache.maven.plugins</groupId> | ||||||
|  |                 <artifactId>maven-surefire-plugin</artifactId> | ||||||
|  |                 <configuration> | ||||||
|  |                     <excludes> | ||||||
|  |                         <exclude>**/*IntegrationTest.java</exclude> | ||||||
|  |                         <exclude>**/*LiveTest.java</exclude> | ||||||
|  |                     </excludes> | ||||||
|  |                 </configuration> | ||||||
|  |             </plugin>			 | ||||||
| 		</plugins> | 		</plugins> | ||||||
| 	</build> | 	</build> | ||||||
|  | 	 | ||||||
|  |     <profiles> | ||||||
|  |         <profile> | ||||||
|  |             <id>integration</id> | ||||||
|  |             <build> | ||||||
|  |                 <plugins> | ||||||
|  |                     <plugin> | ||||||
|  |                         <groupId>org.apache.maven.plugins</groupId> | ||||||
|  |                         <artifactId>maven-surefire-plugin</artifactId> | ||||||
|  |                         <executions> | ||||||
|  |                             <execution> | ||||||
|  |                                 <phase>integration-test</phase> | ||||||
|  |                                 <goals> | ||||||
|  |                                     <goal>test</goal> | ||||||
|  |                                 </goals> | ||||||
|  |                                 <configuration> | ||||||
|  |                                     <excludes> | ||||||
|  |                                         <exclude>**/*LiveTest.java</exclude> | ||||||
|  |                                     </excludes> | ||||||
|  |                                     <includes> | ||||||
|  |                                         <include>**/*IntegrationTest.java</include> | ||||||
|  |                                     </includes> | ||||||
|  |                                 </configuration> | ||||||
|  |                             </execution> | ||||||
|  |                         </executions> | ||||||
|  |                         <configuration> | ||||||
|  |                             <systemPropertyVariables> | ||||||
|  |                                 <test.mime>json</test.mime> | ||||||
|  |                             </systemPropertyVariables> | ||||||
|  |                         </configuration> | ||||||
|  |                     </plugin> | ||||||
|  |                 </plugins> | ||||||
|  |             </build> | ||||||
|  |         </profile> | ||||||
|  |     </profiles>	 | ||||||
| </project> | </project> | ||||||
|  | |||||||
| @ -24,7 +24,7 @@ import static org.junit.Assert.assertThat; | |||||||
| @RunWith(SpringJUnit4ClassRunner.class) | @RunWith(SpringJUnit4ClassRunner.class) | ||||||
| @SpringApplicationConfiguration(classes = Application.class) | @SpringApplicationConfiguration(classes = Application.class) | ||||||
| @WebIntegrationTest | @WebIntegrationTest | ||||||
| public class ApplicationTest { | public class ApplicationIntegrationTest { | ||||||
| 
 | 
 | ||||||
|     private static final String COURSE1_URL = "http://localhost:8080/courses/1"; |     private static final String COURSE1_URL = "http://localhost:8080/courses/1"; | ||||||
| 
 | 
 | ||||||
| @ -71,30 +71,75 @@ | |||||||
|         </dependency> |         </dependency> | ||||||
|     </dependencies> |     </dependencies> | ||||||
| 
 | 
 | ||||||
|     <build> | 	<build> | ||||||
|         <finalName>angular-spring-rest-sample</finalName> | 		<finalName>angular-spring-rest-sample</finalName> | ||||||
|         <plugins> | 		<plugins> | ||||||
| 
 | 
 | ||||||
|             <plugin> | 			<plugin> | ||||||
|                 <groupId>org.apache.maven.plugins</groupId> | 				<groupId>org.apache.maven.plugins</groupId> | ||||||
|                 <artifactId>maven-compiler-plugin</artifactId> | 				<artifactId>maven-compiler-plugin</artifactId> | ||||||
|                 <configuration> | 				<configuration> | ||||||
|                     <source>1.8</source> | 					<source>1.8</source> | ||||||
|                     <target>1.8</target> | 					<target>1.8</target> | ||||||
|                 </configuration> | 				</configuration> | ||||||
|             </plugin> | 			</plugin> | ||||||
| 
 | 
 | ||||||
|             <plugin> | 			<plugin> | ||||||
|                 <groupId>org.apache.maven.plugins</groupId> | 				<groupId>org.apache.maven.plugins</groupId> | ||||||
|                 <artifactId>maven-war-plugin</artifactId> | 				<artifactId>maven-war-plugin</artifactId> | ||||||
|                 <configuration> | 				<configuration> | ||||||
|                     <failOnMissingWebXml>false</failOnMissingWebXml> | 					<failOnMissingWebXml>false</failOnMissingWebXml> | ||||||
|                 </configuration> | 				</configuration> | ||||||
|             </plugin> | 			</plugin> | ||||||
| 
 | 
 | ||||||
|         </plugins> | 			<plugin> | ||||||
|     </build> | 				<groupId>org.apache.maven.plugins</groupId> | ||||||
|  | 				<artifactId>maven-surefire-plugin</artifactId> | ||||||
|  | 				<configuration> | ||||||
|  | 					<excludes> | ||||||
|  | 						<exclude>**/*IntegrationTest.java</exclude> | ||||||
|  | 						<exclude>**/*LiveTest.java</exclude> | ||||||
|  | 					</excludes> | ||||||
|  | 				</configuration> | ||||||
|  | 			</plugin> | ||||||
|  | 		</plugins> | ||||||
|  | 	</build> | ||||||
| 
 | 
 | ||||||
|  |     <profiles> | ||||||
|  |         <profile> | ||||||
|  |             <id>integration</id> | ||||||
|  |             <build> | ||||||
|  |                 <plugins> | ||||||
|  |                     <plugin> | ||||||
|  |                         <groupId>org.apache.maven.plugins</groupId> | ||||||
|  |                         <artifactId>maven-surefire-plugin</artifactId> | ||||||
|  |                         <executions> | ||||||
|  |                             <execution> | ||||||
|  |                                 <phase>integration-test</phase> | ||||||
|  |                                 <goals> | ||||||
|  |                                     <goal>test</goal> | ||||||
|  |                                 </goals> | ||||||
|  |                                 <configuration> | ||||||
|  |                                     <excludes> | ||||||
|  |                                         <exclude>**/*LiveTest.java</exclude> | ||||||
|  |                                     </excludes> | ||||||
|  |                                     <includes> | ||||||
|  |                                         <include>**/*IntegrationTest.java</include> | ||||||
|  |                                     </includes> | ||||||
|  |                                 </configuration> | ||||||
|  |                             </execution> | ||||||
|  |                         </executions> | ||||||
|  |                         <configuration> | ||||||
|  |                             <systemPropertyVariables> | ||||||
|  |                                 <test.mime>json</test.mime> | ||||||
|  |                             </systemPropertyVariables> | ||||||
|  |                         </configuration> | ||||||
|  |                     </plugin> | ||||||
|  |                 </plugins> | ||||||
|  |             </build> | ||||||
|  |         </profile> | ||||||
|  |     </profiles> | ||||||
|  |      | ||||||
|     <properties> |     <properties> | ||||||
|         <guava.version>19.0</guava.version> |         <guava.version>19.0</guava.version> | ||||||
|     </properties> |     </properties> | ||||||
|  | |||||||
| @ -18,7 +18,7 @@ import static org.hamcrest.core.IsEqual.*; | |||||||
| @SpringApplicationConfiguration(classes = Application.class) | @SpringApplicationConfiguration(classes = Application.class) | ||||||
| @WebAppConfiguration | @WebAppConfiguration | ||||||
| @IntegrationTest("server.port:8888") | @IntegrationTest("server.port:8888") | ||||||
| public class StudentServiceTest { | public class StudentServiceIntegrationTest { | ||||||
| 
 | 
 | ||||||
|     private static final String ENDPOINT = "http://localhost:8888/student/get"; |     private static final String ENDPOINT = "http://localhost:8888/student/get"; | ||||||
| 
 | 
 | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user