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:
parent
191245c2da
commit
d4c6226aa5
@ -26,23 +26,6 @@
|
|||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<version>${commons-lang3.version}</version>
|
<version>${commons-lang3.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- http client -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpclient</artifactId>
|
|
||||||
<version>${httpclient.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>commons-logging</artifactId>
|
|
||||||
<groupId>commons-logging</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpcore</artifactId>
|
|
||||||
<version>${httpcore.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- marshalling -->
|
<!-- marshalling -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
@ -66,6 +49,7 @@
|
|||||||
<groupId>io.cucumber</groupId>
|
<groupId>io.cucumber</groupId>
|
||||||
<artifactId>cucumber-junit</artifactId>
|
<artifactId>cucumber-junit</artifactId>
|
||||||
<version>${cucumber.version}</version>
|
<version>${cucumber.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jbehave</groupId>
|
<groupId>org.jbehave</groupId>
|
||||||
@ -73,11 +57,6 @@
|
|||||||
<version>${jbehave.version}</version>
|
<version>${jbehave.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.intuit.karate</groupId>
|
|
||||||
<artifactId>karate-apache</artifactId>
|
|
||||||
<version>${karate.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.intuit.karate</groupId>
|
<groupId>com.intuit.karate</groupId>
|
||||||
<artifactId>karate-junit4</artifactId>
|
<artifactId>karate-junit4</artifactId>
|
||||||
@ -94,6 +73,18 @@
|
|||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
|
<testResources>
|
||||||
|
<!-- https://github.com/karatelabs/karate#folder-structure -->
|
||||||
|
<testResource>
|
||||||
|
<directory>src/test/java</directory>
|
||||||
|
<excludes>
|
||||||
|
<exclude>**/*.java</exclude>
|
||||||
|
</excludes>
|
||||||
|
</testResource>
|
||||||
|
<testResource>
|
||||||
|
<directory>src/test/resources</directory>
|
||||||
|
</testResource>
|
||||||
|
</testResources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
@ -145,9 +136,7 @@
|
|||||||
<rest-assured.version>2.9.0</rest-assured.version>
|
<rest-assured.version>2.9.0</rest-assured.version>
|
||||||
<cucumber.version>6.8.0</cucumber.version>
|
<cucumber.version>6.8.0</cucumber.version>
|
||||||
<wiremock.version>2.21.0</wiremock.version>
|
<wiremock.version>2.21.0</wiremock.version>
|
||||||
<karate.version>0.6.1</karate.version>
|
<karate.version>1.3.1</karate.version>
|
||||||
<httpcore.version>4.4.5</httpcore.version>
|
|
||||||
<httpclient.version>4.5.2</httpclient.version>
|
|
||||||
<jbehave.version>4.1</jbehave.version>
|
<jbehave.version>4.1</jbehave.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
@ -2,17 +2,16 @@ package com.baeldung.rest.karate;
|
|||||||
|
|
||||||
import com.github.tomakehurst.wiremock.WireMockServer;
|
import com.github.tomakehurst.wiremock.WireMockServer;
|
||||||
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
|
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
|
||||||
import cucumber.api.CucumberOptions;
|
import com.intuit.karate.junit4.Karate;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
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.*;
|
||||||
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
|
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)
|
||||||
//@RunWith(Karate.class)
|
|
||||||
@CucumberOptions(features = "classpath:karate")
|
|
||||||
public class KarateIntegrationTest {
|
public class KarateIntegrationTest {
|
||||||
|
|
||||||
private static final int PORT_NUMBER = 8097;
|
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));
|
private static final WireMockServer wireMockServer = new WireMockServer(WireMockConfiguration.options().port(PORT_NUMBER));
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setUp() throws Exception {
|
public static void setUp() {
|
||||||
wireMockServer.start();
|
wireMockServer.start();
|
||||||
|
|
||||||
configureFor("localhost", PORT_NUMBER);
|
configureFor("localhost", PORT_NUMBER);
|
||||||
@ -30,7 +29,7 @@ public class KarateIntegrationTest {
|
|||||||
.withHeader("Content-Type", "application/json")
|
.withHeader("Content-Type", "application/json")
|
||||||
.withBody("{ \"id\": \"1234\", name: \"John Smith\" }")));
|
.withBody("{ \"id\": \"1234\", name: \"John Smith\" }")));
|
||||||
stubFor(post(urlEqualTo("/user/create"))
|
stubFor(post(urlEqualTo("/user/create"))
|
||||||
.withHeader("content-type", equalTo("application/json"))
|
.withHeader("content-type", equalTo("application/json; charset=UTF-8"))
|
||||||
.withRequestBody(containing("id"))
|
.withRequestBody(containing("id"))
|
||||||
.willReturn(aResponse()
|
.willReturn(aResponse()
|
||||||
.withStatus(200)
|
.withStatus(200)
|
||||||
@ -40,7 +39,7 @@ public class KarateIntegrationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void tearDown() throws Exception {
|
public static void tearDown() {
|
||||||
wireMockServer.stop();
|
wireMockServer.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user