Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pact-jvm provider/spring6/README.md #1840

Open
tasosz opened this issue Nov 26, 2024 · 1 comment
Open

pact-jvm provider/spring6/README.md #1840

tasosz opened this issue Nov 26, 2024 · 1 comment

Comments

@tasosz
Copy link

tasosz commented Nov 26, 2024

Minor documentation issue

This README https://github.com/pact-foundation/pact-jvm/blob/master/provider/spring6/README.md includes this note:

Important: Since @WebMvcTest starts only Spring MVC components you can't use PactVerificationSpring6Provider and need to fallback to PactVerificationInvocationContextProvider

Given that a previous example uses @WebMvcTest together with PactVerificationSpring6Provider:

@WebMvcTest
@Provider("myAwesomeService")
@PactBroker
class ContractVerificationTest {
    
    @Autowired
    private MockMvc mockMvc;

    @TestTemplate
    @ExtendWith(PactVerificationSpring6Provider.class)
    void pactVerificationTestTemplate(PactVerificationContext context) {
      context.verifyInteraction();
    }
    
    @BeforeEach
    void before(PactVerificationContext context) {
        context.setTarget(new Spring6MockMvcTestTarget(mockMvc));
    }
}

then the above Important statement causes confusion.
I.e. as a reader I'm thinking: Is this statement incorrect? Is this example incorrect? Is the statement referring to some other case altogether?

@rholshausen
Copy link
Contributor

That example seems to work fine for me, so that comment might be incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants