
One concrete example would be that Sunday isn’t Friday. Src/test/resources/hellocucumber features features In Cucumber, an example is called a scenario. Try running an Example Mapping workshop in your team to Finally, delete the StepDefinitions.java class (or even the java directory).Copy the import statements from StepDefinitions.java to StepDefs.kt you’ll need them later.Create a Kotlin class called StepDefs inside the hellocucumber package.Now you can delete the RunCucumberTest.java class.Your RunCucumberTest.kt class should now look like this: package hellocucumber If you are using IntelliJ, it will offer to translate the Java code to Kotlin code. Copy the annotations from the RunCucumberTest.java class to the RunCucumberTest.kt class.IntelliJ might tell you that Kotlin is not configured click “Configure”. Create a Kotlin class called RunCucumberTest inside the hellocucumber package.Create the hellocucumber package inside the kotlin directory.In IntelliJ, you can do so by right-clicking on the kotlin directory and selecting “Mark Directory as” > “Test Sources Root”. Add a directory named kotlin in your src/test directory and mark it as Test Sources Root.To use Kotlin, we need to add it to our project: Ĭhange into the directory that was just created by running the following command: cd hellocucumber

You should get something like the following result: Project created from Archetype in dir: /cucumber "-DarchetypeArtifactId=cucumber-archetype" \ Open a terminal, go to the directory where you want to create your project,Īnd run the following command: mvn archetype:generate \ Remember that you can always change the Dispatcher used by runBlocking by passing one: runBlocking(Dispatchers.IO).We’ll start by creating a new project directory with the cucumber-archetype Which may, or may not, be OK depending on your use case. So again we’d be running in the single thread confined Dispatcher runBlocking gets by default. This is because coroutineScope basically inherits the caller’s context. Suspend fun Iterable.pmap(f: suspend (A) -> B): List = coroutineScope Collections, coroutines, kotlin, parallelĮver wonder how to run map in parallel using coroutines? This is how you do it.
