BAEL-3975: Fix the PactVerification test (#9870)
This commit is contained in:
		
							parent
							
								
									2a0e8db760
								
							
						
					
					
						commit
						c1d934e8a4
					
				| @ -32,12 +32,6 @@ | |||||||
|             <artifactId>pact-jvm-consumer-junit_2.11</artifactId> |             <artifactId>pact-jvm-consumer-junit_2.11</artifactId> | ||||||
|             <version>${pact.version}</version> |             <version>${pact.version}</version> | ||||||
|             <scope>test</scope> |             <scope>test</scope> | ||||||
|             <exclusions> |  | ||||||
|                 <exclusion> |  | ||||||
|                     <groupId>org.codehaus.groovy</groupId> |  | ||||||
|                     <artifactId>groovy-all</artifactId> |  | ||||||
|                 </exclusion> |  | ||||||
|             </exclusions> |  | ||||||
|         </dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
|         <!-- https://mvnrepository.com/artifact/com.typesafe.akka/akka-actor --> |         <!-- https://mvnrepository.com/artifact/com.typesafe.akka/akka-actor --> | ||||||
| @ -53,10 +47,10 @@ | |||||||
|             <scope>test</scope> |             <scope>test</scope> | ||||||
| 
 | 
 | ||||||
|         </dependency> |         </dependency> | ||||||
|                 <dependency> |         <dependency> | ||||||
|                     <groupId>one.util</groupId> |             <groupId>one.util</groupId> | ||||||
|                     <artifactId>streamex</artifactId> |             <artifactId>streamex</artifactId> | ||||||
|                     <version>${streamex.version}</version> |             <version>${streamex.version}</version> | ||||||
|         </dependency> |         </dependency> | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>net.bytebuddy</groupId> |             <groupId>net.bytebuddy</groupId> | ||||||
|  | |||||||
| @ -5,8 +5,6 @@ import au.com.dius.pact.consumer.PactProviderRuleMk2; | |||||||
| import au.com.dius.pact.consumer.PactVerification; | import au.com.dius.pact.consumer.PactVerification; | ||||||
| import au.com.dius.pact.consumer.dsl.PactDslWithProvider; | import au.com.dius.pact.consumer.dsl.PactDslWithProvider; | ||||||
| import au.com.dius.pact.model.RequestResponsePact; | import au.com.dius.pact.model.RequestResponsePact; | ||||||
| 
 |  | ||||||
| import org.junit.Ignore; |  | ||||||
| import org.junit.Rule; | import org.junit.Rule; | ||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.springframework.http.HttpEntity; | import org.springframework.http.HttpEntity; | ||||||
| @ -28,15 +26,30 @@ public class PactConsumerDrivenContractUnitTest { | |||||||
| 
 | 
 | ||||||
|     @Pact(consumer = "test_consumer") |     @Pact(consumer = "test_consumer") | ||||||
|     public RequestResponsePact createPact(PactDslWithProvider builder) { |     public RequestResponsePact createPact(PactDslWithProvider builder) { | ||||||
|         Map<String, String> headers = new HashMap<String, String>(); |         Map<String, String> headers = new HashMap<>(); | ||||||
|         headers.put("Content-Type", "application/json"); |         headers.put("Content-Type", "application/json"); | ||||||
| 
 | 
 | ||||||
|         return builder.given("test GET").uponReceiving("GET REQUEST").path("/pact").method("GET").willRespondWith().status(200).headers(headers).body("{\"condition\": true, \"name\": \"tom\"}").given("test POST").uponReceiving("POST REQUEST").method("POST") |         return builder | ||||||
|                 .headers(headers).body("{\"name\": \"Michael\"}").path("/pact").willRespondWith().status(201).toPact(); |           .given("test GET") | ||||||
|  |             .uponReceiving("GET REQUEST") | ||||||
|  |             .path("/pact") | ||||||
|  |             .method("GET") | ||||||
|  |           .willRespondWith() | ||||||
|  |             .status(200) | ||||||
|  |             .headers(headers) | ||||||
|  |             .body("{\"condition\": true, \"name\": \"tom\"}") | ||||||
|  |           .given("test POST") | ||||||
|  |             .uponReceiving("POST REQUEST") | ||||||
|  |             .method("POST") | ||||||
|  |             .headers(headers) | ||||||
|  |             .body("{\"name\": \"Michael\"}") | ||||||
|  |             .path("/pact") | ||||||
|  |           .willRespondWith() | ||||||
|  |             .status(201) | ||||||
|  |           .toPact(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Test |     @Test | ||||||
|     @Ignore |  | ||||||
|     @PactVerification() |     @PactVerification() | ||||||
|     public void givenGet_whenSendRequest_shouldReturn200WithProperHeaderAndBody() { |     public void givenGet_whenSendRequest_shouldReturn200WithProperHeaderAndBody() { | ||||||
|         // when |         // when | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user