Search in sources :

Example 21 with Given

use of cucumber.api.java.en.Given 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)

Example 22 with Given

use of cucumber.api.java.en.Given in project ff4j by ff4j.

the class FeatureStoreStepDef method the_following_features_are_cached.

@Given("^the following features are cached$")
public void the_following_features_are_cached(List<FeaturePojo> features) throws Throwable {
    for (FeaturePojo featurePojo : features) {
        Feature feature = new Feature(featurePojo.getUid(), Boolean.valueOf(featurePojo.getEnable()), featurePojo.getDescription(), featurePojo.getGroup(), Arrays.asList(featurePojo.getPermissions().split(",")));
        ((FF4jCacheProxy) ff4j.getFeatureStore()).getCacheManager().putFeature(feature);
    }
}
Also used : Feature(org.ff4j.core.Feature) Given(cucumber.api.java.en.Given)

Example 23 with Given

use of cucumber.api.java.en.Given in project ff4j by ff4j.

the class FeatureStoreServicesStepDef method the_feature_store_is_cached.

@Given("^the feature store is cached$")
public void the_feature_store_is_cached() throws Throwable {
    FF4jCacheProxy proxy = new FF4jCacheProxy(ff4j.getFeatureStore(), null, new InMemoryCacheManager());
    ff4j.setFeatureStore(proxy);
}
Also used : InMemoryCacheManager(org.ff4j.cache.InMemoryCacheManager) FF4jCacheProxy(org.ff4j.cache.FF4jCacheProxy) Given(cucumber.api.java.en.Given)

Example 24 with Given

use of cucumber.api.java.en.Given in project ff4j by ff4j.

the class FeatureStoreServicesStepDef method the_following_features_are_cached.

@Given("^the following features are cached$")
public void the_following_features_are_cached(List<FeaturePojo> features) throws Throwable {
    for (FeaturePojo featurePojo : features) {
        Feature feature = new Feature(featurePojo.getUid(), Boolean.valueOf(featurePojo.getEnable()), featurePojo.getDescription(), featurePojo.getGroup(), Arrays.asList(featurePojo.getPermissions().split(",")));
        ((FF4jCacheProxy) ff4j.getFeatureStore()).getCacheManager().putFeature(feature);
    }
}
Also used : Feature(org.ff4j.core.Feature) Given(cucumber.api.java.en.Given)

Example 25 with Given

use of cucumber.api.java.en.Given in project vertexium by visallo.

the class GraphGlue method givenHavingExecuted.

@Given("^having executed:$")
public void givenHavingExecuted(String queryString) {
    CypherCompilerContext compilerContext = new CypherCompilerContext(ctx.getFunctions());
    VertexiumCypherQuery.parse(compilerContext, queryString).execute(ctx);
}
Also used : CypherCompilerContext(org.vertexium.cypher.ast.CypherCompilerContext) Given(cucumber.api.java.en.Given)

Aggregations

Given (cucumber.api.java.en.Given)121 ApplicationEnvironmentAuthorizationUpdateRequest (alien4cloud.rest.orchestrator.model.ApplicationEnvironmentAuthorizationUpdateRequest)10 Connection (io.syndesis.common.model.connection.Connection)10 Connector (io.syndesis.common.model.connection.Connector)10 Step (io.syndesis.common.model.integration.Step)9 StepDefinition (io.syndesis.qe.bdd.entities.StepDefinition)9 TestUtils.nullAsString (alien4cloud.it.utils.TestUtils.nullAsString)7 Action (io.syndesis.common.model.action.Action)6 ConnectorDescriptor (io.syndesis.common.model.action.ConnectorDescriptor)6 HashMap (java.util.HashMap)6 List (java.util.List)6 Action (org.talend.dataprep.helper.api.Action)6 AbstractStep (io.syndesis.qe.bdd.AbstractStep)5 S3BucketNameBuilder (io.syndesis.qe.utils.S3BucketNameBuilder)5 File (java.io.File)5 Map (java.util.Map)5 Publication (uk.nhs.digital.ps.test.acceptance.models.Publication)5 Application (alien4cloud.model.application.Application)4 Response (com.jayway.restassured.response.Response)4 IOException (java.io.IOException)4