Skip to content
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

How to use builder pattern in Serenity BDD-issues at point builder() #2899

Closed
Vijay2871 opened this issue Aug 24, 2022 · 8 comments
Closed

Comments

@Vijay2871
Copy link

image

@Vijay2871 Vijay2871 changed the title How to use builder pattern in Serenity BDD How to use builder pattern in Serenity BDD-issues at point builder() Aug 24, 2022
@globalworming
Copy link
Collaborator

what issue do you have exactly?
lombock annotations are pretty much independent from serenity (unless interference in the compile phase somehow)

@Vijay2871
Copy link
Author

what issue do you have exactly? lombock annotations are pretty much independent from serenity (unless interference in the compile phase somehow)

For serialising the request body i need to use the builer pattern and throwing an error

@globalworming
Copy link
Collaborator

globalworming commented Aug 24, 2022

and what error might that be?

@Vijay2871
Copy link
Author

and what error might that be?

image

error: cannot find symbol
return SFCCGuestAuth.builder().type("guest").build();
^
symbol: method builder()
location: class SFCCGuestAuth

@globalworming
Copy link
Collaborator

globalworming commented Aug 24, 2022

this has nothing to do with serenity but is more a general java and maybe lombock related question. please ask in a java or lombok forum

also please check some advice on how to ask questions

@Vijay2871
Copy link
Author

this has nothing to do with serenity but is more a general java and maybe lombock related question. please ask in a java or lombok forum

also please check some advice on how to ask questions

I have replicate the code which I did for Cucumber and it was working fine, but same code I put in Serenity bdd framework it's not working

@wakaleo
Copy link
Member

wakaleo commented Aug 24, 2022

It might be a dependency conflict. It's a compilation error, not a runtime error, so it looks like an issue with the build setup.

@Vijay2871
Copy link
Author

It might be a dependency conflict. It's a compilation error, not a runtime error, so it looks like an issue with the build setup.

build.gradle looks like:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "net.serenity-bdd:serenity-gradle-plugin:3.3.2"
classpath "net.serenity-bdd:serenity-single-page-report:3.3.2"
}
}

plugins {
id "net.serenity-bdd.serenity-gradle-plugin" version "3.3.2"
id 'java'
id 'eclipse'
id 'idea'
}

defaultTasks 'clean', 'test', 'aggregate'

repositories {
mavenCentral()
}

sourceCompatibility = 11
targetCompatibility = 11

ext {
serenityCoreVersion = '3.3.2'
serenityCucumberVersion = '3.3.2'
junitVersion = '5.9.0'
assertJVersion = '3.23.1'
hamcrest = '2.2'
slf4japi = ':1.6.1'
lombok = '1.18.24'
}

dependencies {

implementation 'org.projectlombok:lombok:1.18.24'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.3'
implementation 'org.projectlombok:lombok-mapstruct-binding:0.2.0'
implementation 'net.serenity-bdd:serenity-rest-assured:3.3.2'


testImplementation "net.serenity-bdd:serenity-core:${serenityCoreVersion}",
        "net.serenity-bdd:serenity-junit5:${serenityCoreVersion}",
        "net.serenity-bdd:serenity-rest-assured:${serenityCoreVersion}",
        "net.serenity-bdd:serenity-cucumber:${serenityCucumberVersion}",
        "org.junit.jupiter:junit-jupiter-api:${junitVersion}",
        "org.junit.jupiter:junit-jupiter-engine:${junitVersion}",
        "org.assertj:assertj-core:${assertJVersion}",
        "org.hamcrest:hamcrest-library:${hamcrest}",
        'io.rest-assured:rest-assured:5.1.1'

}

test {
useJUnitPlatform()
enableAssertions = true
testLogging.showStandardStreams = true
systemProperties System.getProperties()
}

serenity {
reports = ["single-page-html"]

//testRoot = "starter"

}

gradle.startParameter.continueOnFailure = true
test.finalizedBy(aggregate)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants