Skip to content

Commit

Permalink
Add Java 17 support (#149)
Browse files Browse the repository at this point in the history
* Add Java 17 support

* Fix #148

* Test updated examples

* Update mockito

* Fix unit tests

* Update actions names

* Up 17 -> 21

* Revert "Up 17 -> 21"

This reverts commit bad53b5.
  • Loading branch information
Petr Komissarov authored May 31, 2024
1 parent 9366185 commit 9eb8461
Show file tree
Hide file tree
Showing 19 changed files with 117 additions and 114 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
- name: Setup and execute Gradle 'test' task
uses: gradle/gradle-build-action@v3
with:
arguments: check
run: ./gradlew :testit-java-commons:check
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
- name: Publish package
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
DOTNET_VERSION: 8
GITHUB_PAT: ${{ secrets.SERVICE_ACCOUNT_TOKEN }}
JAVA_DISTRIBUTION: "temurin"
JAVA_VERSION: 8
JAVA_VERSION: 17
PYTHON_VERSION: 3.12
TEMP_FILE: tmp/output.txt
TMS_ADAPTER_MODE: 1
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=2.3.3
version=2.3.4

org.gradle.daemon=true
org.gradle.parallel=true
Expand Down
16 changes: 8 additions & 8 deletions testit-adapter-cucumber4/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Add this dependency to your project POM:
<dependency>
<groupId>ru.testit</groupId>
<artifactId>testit-adapter-cucumber4</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -23,7 +23,7 @@ Add this dependency to your project POM:
Add this dependency to your project build file:

```groovy
implementation "ru.testit:testit-adapter-cucumber4:2.3.3"
implementation "ru.testit:testit-adapter-cucumber4:2.3.4"
```

## Usage
Expand All @@ -38,7 +38,7 @@ implementation "ru.testit:testit-adapter-cucumber4:2.3.3"
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<adapter.version>2.3.3</adapter.version>
<adapter.version>2.3.4</adapter.version>
<cucumber.version>4.8.0</cucumber.version>
</properties>
<dependencies>
Expand Down Expand Up @@ -87,7 +87,7 @@ implementation "ru.testit:testit-adapter-cucumber4:2.3.3"
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<adapter.version>2.3.3</adapter.version>
<adapter.version>2.3.4</adapter.version>
<cucumber.version>4.8.0</cucumber.version>
</properties>
<dependencies>
Expand Down Expand Up @@ -156,8 +156,8 @@ repositories {
def cucumberVersion = "4.8.0"

dependencies {
testImplementation "ru.testit:testit-adapter-cucumber4:2.3.3"
testImplementation "ru.testit:testit-java-commons:2.3.3"
testImplementation "ru.testit:testit-adapter-cucumber4:2.3.4"
testImplementation "ru.testit:testit-java-commons:2.3.4"
testImplementation "org.testng:testng:7.5"
testImplementation("io.cucumber:cucumber-core:$cucumberVersion")
testImplementation("io.cucumber:cucumber-java:$cucumberVersion")
Expand Down Expand Up @@ -191,8 +191,8 @@ def cucumberVersion = "4.8.0"
def junit4Version = "4.12"

dependencies {
testImplementation "ru.testit:testit-adapter-cucumber4:2.3.3"
testImplementation "ru.testit:testit-java-commons:2.3.3"
testImplementation "ru.testit:testit-adapter-cucumber4:2.3.4"
testImplementation "ru.testit:testit-java-commons:2.3.4"
testImplementation("io.cucumber:cucumber-core:$cucumberVersion")
testImplementation("io.cucumber:cucumber-java:$cucumberVersion")
testImplementation("io.cucumber:cucumber-junit:$cucumberVersion")
Expand Down
22 changes: 11 additions & 11 deletions testit-adapter-cucumber5/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Add this dependency to your project POM:
<dependency>
<groupId>ru.testit</groupId>
<artifactId>testit-adapter-cucumber5</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -23,7 +23,7 @@ Add this dependency to your project POM:
Add this dependency to your project build file:

```groovy
implementation "ru.testit:testit-adapter-cucumber5:2.3.3"
implementation "ru.testit:testit-adapter-cucumber5:2.3.4"
```

## Usage
Expand All @@ -38,7 +38,7 @@ implementation "ru.testit:testit-adapter-cucumber5:2.3.3"
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<adapter.version>2.3.3</adapter.version>
<adapter.version>2.3.4</adapter.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -92,7 +92,7 @@ implementation "ru.testit:testit-adapter-cucumber5:2.3.3"
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<adapter.version>2.3.3</adapter.version>
<adapter.version>2.3.4</adapter.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -157,7 +157,7 @@ implementation "ru.testit:testit-adapter-cucumber5:2.3.3"
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<adapter.version>2.3.3</adapter.version>
<adapter.version>2.3.4</adapter.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -232,8 +232,8 @@ def cucumberVersion = "5.1.2"
def cucumberGherkinVersion = "5.1.0"

dependencies {
testImplementation "ru.testit:testit-adapter-cucumber5:2.3.3"
testImplementation "ru.testit:testit-java-commons:2.3.3"
testImplementation "ru.testit:testit-adapter-cucumber5:2.3.4"
testImplementation "ru.testit:testit-java-commons:2.3.4"
testImplementation "org.testng:testng:7.5"
testImplementation("io.cucumber:gherkin:$cucumberGherkinVersion")
testImplementation("io.cucumber:cucumber-core:$cucumberVersion")
Expand Down Expand Up @@ -268,8 +268,8 @@ def cucumberVersion = "5.5.0"
def cucumberGherkinVersion = "5.1.0"

dependencies {
testImplementation "ru.testit:testit-adapter-cucumber5:2.3.3"
testImplementation "ru.testit:testit-java-commons:2.3.3"
testImplementation "ru.testit:testit-adapter-cucumber5:2.3.4"
testImplementation "ru.testit:testit-java-commons:2.3.4"
testImplementation("io.cucumber:gherkin:$cucumberGherkinVersion")
testImplementation("io.cucumber:cucumber-core:$cucumberVersion")
testImplementation("io.cucumber:cucumber-java:$cucumberVersion")
Expand Down Expand Up @@ -307,8 +307,8 @@ def cucumberGherkinVersion = "5.1.0"
def junit4Version = "4.12"

dependencies {
testImplementation "ru.testit:testit-adapter-cucumber5:2.3.3"
testImplementation "ru.testit:testit-java-commons:2.3.3"
testImplementation "ru.testit:testit-adapter-cucumber5:2.3.4"
testImplementation "ru.testit:testit-java-commons:2.3.4"
testImplementation("io.cucumber:gherkin:$cucumberGherkinVersion")
testImplementation("io.cucumber:cucumber-core:$cucumberVersion")
testImplementation("io.cucumber:cucumber-java:$cucumberVersion")
Expand Down
22 changes: 11 additions & 11 deletions testit-adapter-cucumber6/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Add this dependency to your project POM:
<dependency>
<groupId>ru.testit</groupId>
<artifactId>testit-adapter-cucumber6</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -23,7 +23,7 @@ Add this dependency to your project POM:
Add this dependency to your project build file:

```groovy
implementation "ru.testit:testit-adapter-cucumber6:2.3.3"
implementation "ru.testit:testit-adapter-cucumber6:2.3.4"
```

## Usage
Expand All @@ -38,7 +38,7 @@ implementation "ru.testit:testit-adapter-cucumber6:2.3.3"
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<adapter.version>2.3.3</adapter.version>
<adapter.version>2.3.4</adapter.version>
<gherkin.version>18.0.0</gherkin.version>
<cucumber.version>6.11.0</cucumber.version>
</properties>
Expand Down Expand Up @@ -94,7 +94,7 @@ implementation "ru.testit:testit-adapter-cucumber6:2.3.3"
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<adapter.version>2.3.3</adapter.version>
<adapter.version>2.3.4</adapter.version>
<gherkin.version>18.0.0</gherkin.version>
<cucumber.version>6.11.0</cucumber.version>
</properties>
Expand Down Expand Up @@ -149,7 +149,7 @@ implementation "ru.testit:testit-adapter-cucumber6:2.3.3"
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<adapter.version>2.3.3</adapter.version>
<adapter.version>2.3.4</adapter.version>
<gherkin.version>18.0.0</gherkin.version>
<cucumber.version>6.11.0</cucumber.version>
</properties>
Expand Down Expand Up @@ -226,8 +226,8 @@ def cucumberVersion = "6.11.0"
def cucumberGherkinVersion = "18.0.0"

dependencies {
testImplementation "ru.testit:testit-adapter-cucumber6:2.3.3"
testImplementation "ru.testit:testit-java-commons:2.3.3"
testImplementation "ru.testit:testit-adapter-cucumber6:2.3.4"
testImplementation "ru.testit:testit-java-commons:2.3.4"
testImplementation "org.testng:testng:7.5"
testImplementation("io.cucumber:gherkin:$cucumberGherkinVersion")
testImplementation("io.cucumber:cucumber-core:$cucumberVersion")
Expand Down Expand Up @@ -262,8 +262,8 @@ def cucumberVersion = "6.11.0"
def cucumberGherkinVersion = "18.0.0"

dependencies {
testImplementation "ru.testit:testit-adapter-cucumber6:2.3.3"
testImplementation "ru.testit:testit-java-commons:2.3.3"
testImplementation "ru.testit:testit-adapter-cucumber6:2.3.4"
testImplementation "ru.testit:testit-java-commons:2.3.4"
testImplementation("io.cucumber:gherkin:$cucumberGherkinVersion")
testImplementation("io.cucumber:cucumber-core:$cucumberVersion")
testImplementation("io.cucumber:cucumber-java:$cucumberVersion")
Expand Down Expand Up @@ -301,8 +301,8 @@ def cucumberGherkinVersion = "18.0.0"
def junit4Version = "4.12"

dependencies {
testImplementation "ru.testit:testit-adapter-cucumber6:2.3.3"
testImplementation "ru.testit:testit-java-commons:2.3.3"
testImplementation "ru.testit:testit-adapter-cucumber6:2.3.4"
testImplementation "ru.testit:testit-java-commons:2.3.4"
testImplementation("io.cucumber:gherkin:$cucumberGherkinVersion")
testImplementation("io.cucumber:cucumber-core:$cucumberVersion")
testImplementation("io.cucumber:cucumber-java:$cucumberVersion")
Expand Down
22 changes: 11 additions & 11 deletions testit-adapter-cucumber7/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Add this dependency to your project POM:
<dependency>
<groupId>ru.testit</groupId>
<artifactId>testit-adapter-cucumber7</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -23,7 +23,7 @@ Add this dependency to your project POM:
Add this dependency to your project build file:

```groovy
implementation "ru.testit:testit-adapter-cucumber7:2.3.3"
implementation "ru.testit:testit-adapter-cucumber7:2.3.4"
```

## Usage
Expand All @@ -38,7 +38,7 @@ implementation "ru.testit:testit-adapter-cucumber7:2.3.3"
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<adapter.version>2.3.3</adapter.version>
<adapter.version>2.3.4</adapter.version>
<gherkin.version>23.0.1</gherkin.version>
<cucumber.version>7.3.2</cucumber.version>
</properties>
Expand Down Expand Up @@ -94,7 +94,7 @@ implementation "ru.testit:testit-adapter-cucumber7:2.3.3"
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<adapter.version>2.3.3</adapter.version>
<adapter.version>2.3.4</adapter.version>
<gherkin.version>23.0.1</gherkin.version>
<cucumber.version>7.3.2</cucumber.version>
</properties>
Expand Down Expand Up @@ -161,7 +161,7 @@ implementation "ru.testit:testit-adapter-cucumber7:2.3.3"
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<adapter.version>2.3.3</adapter.version>
<adapter.version>2.3.4</adapter.version>
<gherkin.version>23.0.1</gherkin.version>
<cucumber.version>7.3.2</cucumber.version>
</properties>
Expand Down Expand Up @@ -236,8 +236,8 @@ def cucumberVersion = "7.3.2"
def cucumberGherkinVersion = "23.0.1"

dependencies {
testImplementation "ru.testit:testit-adapter-cucumber7:2.3.3"
testImplementation "ru.testit:testit-java-commons:2.3.3"
testImplementation "ru.testit:testit-adapter-cucumber7:2.3.4"
testImplementation "ru.testit:testit-java-commons:2.3.4"
testImplementation "org.testng:testng:7.5"
testImplementation("io.cucumber:gherkin:$cucumberGherkinVersion")
testImplementation("io.cucumber:cucumber-core:$cucumberVersion")
Expand Down Expand Up @@ -272,8 +272,8 @@ def cucumberVersion = "7.3.2"
def cucumberGherkinVersion = "23.0.1"

dependencies {
testImplementation "ru.testit:testit-adapter-cucumber7:2.3.3"
testImplementation "ru.testit:testit-java-commons:2.3.3"
testImplementation "ru.testit:testit-adapter-cucumber7:2.3.4"
testImplementation "ru.testit:testit-java-commons:2.3.4"
testImplementation("io.cucumber:gherkin:$cucumberGherkinVersion")
testImplementation("io.cucumber:cucumber-core:$cucumberVersion")
testImplementation("io.cucumber:cucumber-java:$cucumberVersion")
Expand Down Expand Up @@ -312,8 +312,8 @@ def cucumberGherkinVersion = "23.0.1"
def junit4Version = "4.12"

dependencies {
testImplementation "ru.testit:testit-adapter-cucumber7:2.3.3"
testImplementation "ru.testit:testit-java-commons:2.3.3"
testImplementation "ru.testit:testit-adapter-cucumber7:2.3.4"
testImplementation "ru.testit:testit-java-commons:2.3.4"
testImplementation("io.cucumber:gherkin:$cucumberGherkinVersion")
testImplementation("io.cucumber:cucumber-core:$cucumberVersion")
testImplementation("io.cucumber:cucumber-java:$cucumberVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ public Map<String, String> getParameters(final URI uri, final int stepLine, Map<
}

private Step getStep(final URI uri, final int stepLine) {
return getScenarioDefinition(uri, stepLine)
.getSteps().stream()
.filter(s -> s.getLocation().getLine().equals((long) stepLine)).findFirst().orElse(null);
Scenario scenario = getScenarioDefinition(uri, stepLine);

if (scenario == null) {
return null;
}

return scenario.getSteps().stream().filter(s -> s.getLocation().getLine().equals((long) stepLine)).findFirst().orElse(null);
}

private Map<String, String> updateParameters(DataTable dataTable, Map<String, String> parameters) {
Expand Down
Loading

0 comments on commit 9eb8461

Please sign in to comment.