Skip to content

Commit

Permalink
fix a pact framework bug with spring-boot
Browse files Browse the repository at this point in the history
  • Loading branch information
lmx1989219 committed Dec 25, 2018
1 parent eac8b9d commit 7cdfc15
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
package com.lmx.pactdemoprovider;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.core.annotation.Order;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;

@SpringBootApplication
public class PactDemoProviderApplication {

/**
* set jsonConvert to highest priority
*
* @return
*/
@Bean
@Order(1)
public MappingJackson2HttpMessageConverter newJsonConvert() {
return new MappingJackson2HttpMessageConverter(new ObjectMapper());
}

public static void main(String[] args) {
SpringApplication.run(PactDemoProviderApplication.class, args);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ pactbroker.host=localhost
pactbroker.port=9292
#pactbroker.auth.username=admin
#pactbroker.auth.password=admin

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.springframework.boot.test.context.SpringBootTest;

@RunWith(SpringRestPactRunner.class)
@Provider("Some Provider")
@Provider("sc.provider")
@PactBroker
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class PactBrokerProviderTest {
Expand Down

0 comments on commit 7cdfc15

Please sign in to comment.