-
-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to consume rest api using serenity rest assured , getting error #1563
Comments
Try adding a dependency on bytebuddy 1.8.4 (from memory l) |
@wakaleo can you please provide me the link of git repo where "serenity with rest assured " is implemented using "gradle" |
Just take the serenity-junit-starter or serenity-cucumber-starter and add serenity-rest-assured (e.g. https://github.com/serenity-bdd/serenity-junit-starter) |
Also, try with Serenity 2.0.40 |
@wakaleo Thanks for the info, project is working (serenity-cucumber-starter & cucumber4) for me if jdk is "1.8" but its not working for "open jdk 11 " :( Testing started at 19:15 ...
|
There seem to be issues with Gradle and Java 11 (it works correctly with Maven and Java 11). |
Adding these dependencies helped me in similar issue: testCompile "net.bytebuddy:byte-buddy:1.8.22" |
Example Code
tring ROOT_URI = "https://reqres.in/api/users";
private String ISO_CODE_SEARCH = "http://services.groupkt.com/country/get/iso2code/";
private Response response;
RequestSpecification request;
@given("^Consume get rest api with sample url$")
public void consumeGetRestApiRequest() throws Throwable {
request = SerenityRest.rest();
baseURI = ROOT_URI;
// response = SerenityRest.when().get(ISO_CODE_SEARCH + "US");
/* Response response = RestAssured.get(ROOT_URI );
System.out.println(response.asString()); */
}
java.lang.AbstractMethodError: Receiver class net.serenitybdd.rest.decorators.request.RequestSpecificationDecorated$ByteBuddy$DUWJ44oG does not define or inherit an implementation of the resolved method abstract getDefinedFilters()Ljava/util/List; of interface io.restassured.specification.QueryableRequestSpecification.
build.gradle dependencies
import com.github.kongchen.swagger.docgen.mavenplugin.ApiSource
import com.github.zhurlik.SwaggerTask
import io.swagger.models.Contact
import io.swagger.models.Info
import io.swagger.models.License
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
}
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "org.springframework.boot"
apply plugin: "io.spring.dependency-management"
apply plugin: "com.github.sherter.google-java-format"
apply plugin: "jacoco"
apply plugin: "com.github.zhurlik.swagger"
apply plugin: "com.github.hierynomus.license"
apply plugin: "org.ec4j.editorconfig"
apply plugin: "org.sonarqube"
//qa
apply plugin: 'idea'
apply plugin: "net.serenity-bdd.aggregator"
group = "com"
version = "0.0.1-SNAPSHOT"
sourceCompatibility = 11
targetCompatibility = 11
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "http://repo.maven.apache.org/maven2" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://maven.google.com" }
mavenCentral()
}
dependencyManagement {
imports {
mavenBom 'com.vaadin:vaadin-bom:12.0.4'
}
}
dependencies {
compile group: "org.springframework.boot", name: "spring-boot-starter-actuator", version:"2.1.1.RELEASE"
compile group: "org.springframework.cloud", name: "spring-cloud-starter-config", version:"2.0.0.RC1"
compile group: "org.springframework.boot", name: "spring-boot-starter-data-jpa", version:"2.1.1.RELEASE"
compile group: "org.springframework.boot", name: "spring-boot-starter-jdbc", version: "1.3.5.RELEASE"
compile group: "org.springframework.boot", name: "spring-boot-configuration-processor", version: "2.1.1.RELEASE"
compile group: "com.vaadin", name: "vaadin-spring-boot-starter"
compile group: "javax.xml.bind", name: "jaxb-api", version:"2.3.0"
compile group: "org.springframework.boot", name: "spring-boot-starter-web", version:"2.1.1.RELEASE"
compile group: "io.springfox", name: "springfox-swagger2", version:"2.6.1"
compile group: "io.springfox", name: "springfox-swagger-ui", version:"2.6.1"
//compile group: 'io.swagger', name: 'swagger-annotations', version: '1.5.21'
runtime group: "org.springframework.boot", name: "spring-boot-devtools", version:"2.1.1.RELEASE"
compile group: "org.apache.logging.log4j", name: "log4j-api", version: "2.11.0"
compile group: "org.apache.logging.log4j", name: "log4j-core", version: "2.11.0"
compile group: "com.opencsv", name: "opencsv", version: "4.4"
compile group: 'com.google.guava', name: 'guava', version: '22.0'
compile group: "org.modelmapper", name: "modelmapper", version: "1.0.0"
compile group: "com.fasterxml.jackson.core", name: "jackson-databind", version: "2.9.4"
compile("com.google.googlejavaformat:google-java-format:1.6")
compile group: 'org.jsoup', name: 'jsoup', version: '1.8.3'
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
}
jacocoTestReport {
reports {
html.enabled true
xml.enabled true
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.8 // minimun 80% coverage
}
}
}
}
check.dependsOn jacocoTestReport
check.dependsOn jacocoTestCoverageVerification
license {
include "**/*.java"
}
test {
exclude "**/**RunAutomation.class"
useTestNG()
useJUnitPlatform()
}
googleJavaFormat {
source "src/"
include "/*.java"
exclude "docs/"
}
task fatJar(type: Jar) {
baseName = project.name + "-all"
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
manifest {
attributes "Main-Class": "MigrationServiceApplication"
attributes "Implementation-Version": version
}
}
//Database Dev Profile
task bootRunDev(type: org.springframework.boot.gradle.tasks.run.BootRun, dependsOn: 'build') {
group = 'Application'
}
//Database QA Profile
task bootRunQa(type: org.springframework.boot.gradle.tasks.run.BootRun, dependsOn: 'build') {
group = 'Application'
}
task("generateSwaggerFile", type: SwaggerTask) {
classesDirs = [
file("build/classes/java/main")
]
}
editorconfig {
excludes = [".gradle", ".gitlab", "gradle*", "LICENSE", "/.gitkeep", "build", "venv","/Drivers","/**features"]
}
tasks.generateSwaggerFile.dependsOn classes
check.dependsOn generateSwaggerFile
check.dependsOn editorconfigCheck
//qa
gradle.startParameter.continueOnFailure = true
task Automation(type: Test) {
/* systemProperty "host", findProperty("host")
systemProperty "port", findProperty("port")
systemProperty "cucumber.options", findProperty("cucumber.options")
systemProperty "POSTGRES_HOST", findProperty("POSTGRES_HOST")
systemProperty "POSTGRES_DB", findProperty("POSTGRES_DB")
systemProperty "POSTGRES_USER", findProperty("POSTGRES_USER")
systemProperty "POSTGRES_PASSWORD", findProperty("POSTGRES_PASSWORD")
systemProperty "MQ_SCHEME", findProperty("MQ_SCHEME")
systemProperty "MQ_HOST", findProperty("MQ_HOST")
systemProperty "MQ_PORT", findProperty("MQ_PORT")
systemProperty "MQ_USER", findProperty("MQ_USER")
systemProperty "MQ_PASSWORD", findProperty("MQ_PASSWORD") */
scanForTestClasses = false
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = false
include "**/**RunAutomation.class"
}
The text was updated successfully, but these errors were encountered: