I just found out about Cucumber and it seems to be more prone to behavior-based testing. Or not?
In addition, I got this sample code:
public class HelloStepdefs { private Hello hello; private String hi; @Given("^I have a hello app with \"([^\"]*)\"$") public void I_have_a_hello_app_with(String greeting) { hello = new Hello(greeting); } @When("^I ask it to say hi$") public void I_ask_it_to_say_hi() { hi = hello.sayHi(); } @Then("^it should answer with \"([^\"]*)\"$") public void it_should_answer_with(String expectedHi) { assertEquals(expectedHi, hi); } }
From my understanding, this class initiates the Hello class due to the @Given annotation, then if the method annotated using @When , it will call the method with the @Then annotation?
In any case, Cucumber seems very interesting, however, how it works with existing design patterns, as well as with existing infrastructures such as Spring, etc.
In addition, how can this be used when working with database-oriented projects.
source share