BAEL-3444: Simplified example steps
This commit is contained in:
parent
b51f276b2c
commit
423a529f56
|
@ -5,7 +5,6 @@ import org.junit.runner.RunWith;
|
||||||
import io.cucumber.junit.Cucumber;
|
import io.cucumber.junit.Cucumber;
|
||||||
import io.cucumber.junit.CucumberOptions;
|
import io.cucumber.junit.CucumberOptions;
|
||||||
|
|
||||||
|
|
||||||
@RunWith(Cucumber.class)
|
@RunWith(Cucumber.class)
|
||||||
@CucumberOptions(features = "classpath:features/book-store.feature")
|
@CucumberOptions(features = "classpath:features/book-store.feature")
|
||||||
public class BookStoreIntegrationTest {
|
public class BookStoreIntegrationTest {
|
||||||
|
|
|
@ -18,7 +18,6 @@ public class BookStoreRegistryConfigurer implements TypeRegistryConfigurer {
|
||||||
@Override
|
@Override
|
||||||
public void configureTypeRegistry(TypeRegistry typeRegistry) {
|
public void configureTypeRegistry(TypeRegistry typeRegistry) {
|
||||||
typeRegistry.defineDataTableType(new DataTableType(BookCatalog.class, new BookTableTransformer()));
|
typeRegistry.defineDataTableType(new DataTableType(BookCatalog.class, new BookTableTransformer()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class BookTableTransformer implements TableTransformer<BookCatalog> {
|
private static class BookTableTransformer implements TableTransformer<BookCatalog> {
|
||||||
|
@ -34,11 +33,8 @@ public class BookStoreRegistryConfigurer implements TypeRegistryConfigurer {
|
||||||
.map(fields -> new Book(fields.get(0), fields.get(1)))
|
.map(fields -> new Book(fields.get(0), fields.get(1)))
|
||||||
.forEach(catalog::addBook);
|
.forEach(catalog::addBook);
|
||||||
|
|
||||||
System.out.println(catalog);
|
|
||||||
|
|
||||||
return catalog;
|
return catalog;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,8 +43,8 @@ public class BookStoreRunSteps {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Given("^I have the following books in the store with custom table parsing$")
|
@Given("^I have the following books in the store with transformer$")
|
||||||
public void haveBooksInTheStoreByListOfDomainObjects(BookCatalog catalog) {
|
public void haveBooksInTheStoreByListOfTransformer(BookCatalog catalog) {
|
||||||
store.addAllBooks(catalog.getBooks());
|
store.addAllBooks(catalog.getBooks());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,6 @@ Feature: Book Store
|
||||||
| The Devil in the White City | Erik Larson |
|
| The Devil in the White City | Erik Larson |
|
||||||
| The Lion, the Witch and the Wardrobe | C.S. Lewis |
|
| The Lion, the Witch and the Wardrobe | C.S. Lewis |
|
||||||
| In the Garden of Beasts | Erik Larson |
|
| In the Garden of Beasts | Erik Larson |
|
||||||
| Jane Eyre | Charlotte Bronte |
|
|
||||||
| Frankenstein | Mary Shelley |
|
|
||||||
When I search for books by author Erik Larson
|
When I search for books by author Erik Larson
|
||||||
Then I find 2 books
|
Then I find 2 books
|
||||||
|
|
||||||
|
@ -16,18 +14,14 @@ Feature: Book Store
|
||||||
| The Devil in the White City | Erik Larson |
|
| The Devil in the White City | Erik Larson |
|
||||||
| The Lion, the Witch and the Wardrobe | C.S. Lewis |
|
| The Lion, the Witch and the Wardrobe | C.S. Lewis |
|
||||||
| In the Garden of Beasts | Erik Larson |
|
| In the Garden of Beasts | Erik Larson |
|
||||||
| Jane Eyre | Charlotte Bronte |
|
|
||||||
| Frankenstein | Mary Shelley |
|
|
||||||
When I search for books by author Erik Larson
|
When I search for books by author Erik Larson
|
||||||
Then I find 2 books
|
Then I find 2 books
|
||||||
|
|
||||||
Scenario: Correct non-zero number of books found by author with custom table parsing
|
Scenario: Correct non-zero number of books found by author with transformer
|
||||||
Given I have the following books in the store with custom table parsing
|
Given I have the following books in the store with transformer
|
||||||
| title | author |
|
| title | author |
|
||||||
| The Devil in the White City | Erik Larson |
|
| The Devil in the White City | Erik Larson |
|
||||||
| The Lion, the Witch and the Wardrobe | C.S. Lewis |
|
| The Lion, the Witch and the Wardrobe | C.S. Lewis |
|
||||||
| In the Garden of Beasts | Erik Larson |
|
| In the Garden of Beasts | Erik Larson |
|
||||||
| Jane Eyre | Charlotte Bronte |
|
|
||||||
| Frankenstein | Mary Shelley |
|
|
||||||
When I search for books by author Erik Larson
|
When I search for books by author Erik Larson
|
||||||
Then I find 2 books
|
Then I find 2 books
|
Loading…
Reference in New Issue