Skip to content

Instantly share code, notes, and snippets.

@beyondxscratch
Created August 12, 2020 18:27
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
package org.craftsrecords.talkadvisor.recommendation.stepdefs
import cucumber.api.java.en.Then
import cucumber.api.java.en.When
import org.craftsrecords.talkadvisor.recommendation.api.RecommendTalks
import org.craftsrecords.talkadvisor.recommendation.assertions.that
import org.craftsrecords.talkadvisor.recommendation.criteria.GuestCriteria
import org.craftsrecords.talkadvisor.recommendation.talk.TalkFormat
import java.time.Duration.ofMinutes
class RecommendationStepdefs(private val testContext: TestContext,
private val recommendTalks: RecommendTalks) {
@When("^he asks for a recommendation$")
fun `he asks for a recommendation`() {
try {
val user = testContext.userId
val recommendation = recommendTalks to user
testContext.recommendation = recommendation
} catch (e: Exception) {
testContext.error = e
}
}
@Then("^the recommended talks are related to (.+)")
fun `the recommended talks are related to`(topic: String) {
val recommendation = testContext.recommendation
recommendation.that `has talks related to` topic
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment