JAVA-22250 | bumping karate to a new version compatible with jdk 17 (#14230)
* JAVA-22250 | bumping karate to a new version compatible with jdk 17 * JAVA-22180 | removed unused lib and added correct scope.
This commit is contained in:
committed by
GitHub
parent
191245c2da
commit
d4c6226aa5
+6
-7
@@ -2,17 +2,16 @@ package com.baeldung.rest.karate;
|
||||
|
||||
import com.github.tomakehurst.wiremock.WireMockServer;
|
||||
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
|
||||
import cucumber.api.CucumberOptions;
|
||||
import com.intuit.karate.junit4.Karate;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
|
||||
import static com.github.tomakehurst.wiremock.client.WireMock.*;
|
||||
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
|
||||
|
||||
//We need to upgrade to latest version of Karate for JDK17 --- JAVA-22250
|
||||
//@RunWith(Karate.class)
|
||||
@CucumberOptions(features = "classpath:karate")
|
||||
@RunWith(Karate.class)
|
||||
public class KarateIntegrationTest {
|
||||
|
||||
private static final int PORT_NUMBER = 8097;
|
||||
@@ -20,7 +19,7 @@ public class KarateIntegrationTest {
|
||||
private static final WireMockServer wireMockServer = new WireMockServer(WireMockConfiguration.options().port(PORT_NUMBER));
|
||||
|
||||
@BeforeClass
|
||||
public static void setUp() throws Exception {
|
||||
public static void setUp() {
|
||||
wireMockServer.start();
|
||||
|
||||
configureFor("localhost", PORT_NUMBER);
|
||||
@@ -30,7 +29,7 @@ public class KarateIntegrationTest {
|
||||
.withHeader("Content-Type", "application/json")
|
||||
.withBody("{ \"id\": \"1234\", name: \"John Smith\" }")));
|
||||
stubFor(post(urlEqualTo("/user/create"))
|
||||
.withHeader("content-type", equalTo("application/json"))
|
||||
.withHeader("content-type", equalTo("application/json; charset=UTF-8"))
|
||||
.withRequestBody(containing("id"))
|
||||
.willReturn(aResponse()
|
||||
.withStatus(200)
|
||||
@@ -40,7 +39,7 @@ public class KarateIntegrationTest {
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDown() throws Exception {
|
||||
public static void tearDown() {
|
||||
wireMockServer.stop();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user