Skip to content

Commit

Permalink
feat: Update to cucumber-jvm 7
Browse files Browse the repository at this point in the history
  • Loading branch information
kripaliz committed Apr 30, 2023
1 parent bb045ce commit 9cd8d26
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
10 changes: 7 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
</parent>
<groupId>com.github.kripaliz</groupId>
<artifactId>unifiedbdd-automation-framework</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>

<properties>
<allure.version>2.21.0</allure.version>
<appium.version>7.2.0</appium.version>
<cucumber.version>5.7.0</cucumber.version>
<cucumber.version>7.8.1</cucumber.version>
<java.version>11</java.version>
<lombok.version>1.18.26</lombok.version>
<okhttp.version>3.12.0</okhttp.version>
Expand Down Expand Up @@ -53,7 +53,7 @@
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-cucumber5-jvm</artifactId>
<artifactId>allure-cucumber7-jvm</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -90,6 +90,10 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
</dependencies>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.github.kripaliz.automation.cucumber.glue;

import java.lang.reflect.Type;

import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

import io.cucumber.java.DefaultDataTableCellTransformer;
import io.cucumber.java.DefaultDataTableEntryTransformer;
import io.cucumber.java.DefaultParameterTransformer;

/**
*
* @see https://cucumber.io/blog/open-source/announcing-cucumber-jvm-v5-0-0-rc1/
* @author kkurian
*/
public class DefaultTransformer {

private final ObjectMapper objectMapper = new ObjectMapper().registerModule(new JavaTimeModule());

@DefaultParameterTransformer
@DefaultDataTableEntryTransformer
@DefaultDataTableCellTransformer
public Object defaultTransformer(final Object fromValue, final Type toValueType) {
final JavaType javaType = objectMapper.constructType(toValueType);
return objectMapper.convertValue(fromValue, javaType);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private void handleTestStepFinished(final TestStepFinished event) {
* @return
*/
private boolean isNotOk(final TestStepFinished event) {
return !event.getResult().getStatus().isOk(true);
return !event.getResult().getStatus().isOk();
}

/**
Expand Down

0 comments on commit 9cd8d26

Please sign in to comment.