So it's my first time with JBehave and I'm trying to create the first JBehave in the project but it currently appears that the test doesn't execute the steps. In the end the test says that all test cases went through without any problems but in fact they are not executed at all. I set break points in every step method and my debugger doesn't stop me at all not to mention the exceptions that these steps currently throw.
This is my scenario:
Narrative:
In order for the user to start using the application, he first needs to register and log in
Scenario: Successful registration
Given a user with email 'test@test.com'
When the user specifies password 'aaaaaa'
Then the user should be successfully registered with email 'test@test.com' and hashed password 'aaaaaa'
the steps:
public class UserRegistrationSteps extends Steps {
@Given("a user with email '$email'")
public void addNewUser(@Named("email") String email) {
User u = new User();
u.setEmail(email);
throw new RuntimeException("test");
}
@When("the user specifies password '$password'")
public void setPassword(@Named("password") String password) {
System.out.println("test");
throw new RuntimeException("test");
}
@Then("the user should be successfully registered with email '$email' and hashed password '$password'")
public void verifySuccessfulRegistration(@Named("email") String email, @Named("password") String password) {
System.out.println("test");
throw new RuntimeException("test");
}
}
and the test executor:
public class UserRegistrationTest extends JUnitStories {
public UserRegistrationTest() {
super();
this.configuredEmbedder().candidateSteps().add(new UserRegistrationSteps());
}
@Override
protected List<String> storyPaths() {
return Arrays.asList("bdd/users/user_registration.story");
}
}
Any idea what is wrong with it?