You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I am new to Pact JVM and I am trying to write the test on the provider side. I am getting the error 400 as a return code instead of 200. I am using the gradle tool to test the functionality. Can someone please guide me to this issue?
I am using the correct token and the header and the content-type.
Thanks in advance.
@Provider("ABC")
@PactFolder("pacts")
public class ProviderTest {
private String token; // Declare the token variable
@BeforeEach
void before(PactVerificationContext context){
token = "1234567"
context.setTarget(new HttpsTestTarget("testing.ABC.", 443, "/..));
}
@TestTemplate
@ExtendWith(PactVerificationInvocationContextProvider.class)
void verifyPact(PactVerificationContext context, HttpRequest request) {
request.addHeader("Authorization", "Bearer " + token);
context.verifyInteraction();
}
@State("my test does not exists")
void testdoesnotexists() {
/* Set up the token as needed for this provider state */
}
}
The text was updated successfully, but these errors were encountered:
Hi! I am new to Pact JVM and I am trying to write the test on the provider side. I am getting the error 400 as a return code instead of 200. I am using the gradle tool to test the functionality. Can someone please guide me to this issue?
I am using the correct token and the header and the content-type.
Thanks in advance.
@Provider("ABC")
@PactFolder("pacts")
public class ProviderTest {
The text was updated successfully, but these errors were encountered: