Search in sources :

Example 1 with Article

use of com.github.noraui.application.model.demo.Article in project NoraUi by NoraUi.

the class HelloByeSteps method readBlog.

@RetryOnFailure(attempts = 3)
@Given("me any article, please. '(.*)' of '(.*)'.")
public void readBlog(String jsonArticles, String blog) throws FailureException {
    Articles articles = new Articles();
    articles.deserialize(jsonArticles);
    for (Article article : articles) {
        if ("anonymous".equals(article.getAuthor())) {
            new Result.Failure<>("anonymous", "anonymous is prohibited in demo blog!!", true, this.demoPage.getCallBack());
        } else {
            logger.info("> " + blog);
            logger.info("    > " + article.getTitle() + ": " + article.getText());
        }
    }
}
Also used : Articles(com.github.noraui.application.model.demo.Articles) Article(com.github.noraui.application.model.demo.Article) RetryOnFailure(com.github.noraui.cucumber.annotation.RetryOnFailure) Given(cucumber.api.java.en.Given) RetryOnFailure(com.github.noraui.cucumber.annotation.RetryOnFailure)

Aggregations

Article (com.github.noraui.application.model.demo.Article)1 Articles (com.github.noraui.application.model.demo.Articles)1 RetryOnFailure (com.github.noraui.cucumber.annotation.RetryOnFailure)1 Given (cucumber.api.java.en.Given)1