Search in sources :

Example 11 with Given

use of io.cucumber.java.en.Given in project syndesis-qe by syndesisio.

the class OpenshiftValidationSteps method deployODataServer.

@Given("deploy OData v4 server")
public void deployODataServer() {
    WildFlyS2i wildFlyS2i = ResourceFactory.get(WildFlyS2i.class);
    wildFlyS2i.setAppName("odata");
    wildFlyS2i.setGitURL("https://github.com/syndesisio/syndesis-qe-olingo-sample-service.git");
    wildFlyS2i.setBranch(null);
    ResourceFactory.create(WildFlyS2i.class);
}
Also used : WildFlyS2i(io.syndesis.qe.resource.impl.WildFlyS2i) Given(io.cucumber.java.en.Given)

Example 12 with Given

use of io.cucumber.java.en.Given in project apm-agent-java by elastic.

the class OutcomeStepsDefinitions method httpSpanWithStatus.

// HTTP spans & transactions mapping
@Given("a HTTP call is made that returns {int}")
public void httpSpanWithStatus(int code) {
    Span span = state.getSpan();
    span.withName(String.format("HTTP span status = %d", code));
    span.withOutcome(ResultUtil.getOutcomeByHttpClientStatus(code));
}
Also used : Span(co.elastic.apm.agent.impl.transaction.Span) AbstractSpan(co.elastic.apm.agent.impl.transaction.AbstractSpan) Given(io.cucumber.java.en.Given)

Example 13 with Given

use of io.cucumber.java.en.Given in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class ConnectorSteps method a_connector.

@Given("^a Connector with:$")
public void a_connector(Map<String, String> entry) {
    final Long drv = Long.parseLong(entry.getOrDefault(ConnectorContext.COS_DEPLOYMENT_RESOURCE_VERSION, "1"));
    final Long crv = Long.parseLong(entry.getOrDefault(ConnectorContext.COS_CONNECTOR_RESOURCE_VERSION, "1"));
    final String connectorId = entry.getOrDefault(ConnectorContext.COS_CONNECTOR_ID, uid());
    final String deploymentId = entry.getOrDefault(ConnectorContext.COS_DEPLOYMENT_ID, uid());
    final String clusterId = ctx.clusterId();
    var connector = new ManagedConnectorBuilder().withMetadata(new ObjectMetaBuilder().addToLabels(Resources.LABEL_CLUSTER_ID, clusterId).addToLabels(Resources.LABEL_CONNECTOR_ID, connectorId).addToLabels(Resources.LABEL_DEPLOYMENT_ID, deploymentId).addToLabels(Resources.LABEL_OPERATOR_TYPE, entry.get(ConnectorContext.OPERATOR_TYPE)).withName(Connectors.generateConnectorId(deploymentId)).build()).withSpec(new ManagedConnectorSpecBuilder().withClusterId(clusterId).withConnectorId(connectorId).withDeploymentId(deploymentId).withDeployment(new DeploymentSpecBuilder().withConnectorResourceVersion(crv).withConnectorTypeId(entry.get(ConnectorContext.CONNECTOR_TYPE_ID)).withDeploymentResourceVersion(drv).withKafka(new KafkaSpecBuilder().withUrl(entry.getOrDefault("kafka.bootstrap", "kafka.acme.com:443")).build()).withDesiredState(entry.get(ConnectorContext.DESIRED_STATE)).withSecret(Connectors.generateConnectorId(deploymentId) + "-" + drv).build()).withOperatorSelector(new OperatorSelectorBuilder().withId(entry.get(ConnectorContext.OPERATOR_ID)).withType(entry.get(ConnectorContext.OPERATOR_TYPE)).withVersion(entry.get(ConnectorContext.OPERATOR_VERSION)).build()).build()).build();
    var secret = new SecretBuilder().withMetadata(new ObjectMetaBuilder().addToLabels(Resources.LABEL_OPERATOR_TYPE, entry.get(ConnectorContext.OPERATOR_TYPE)).withName(connector.getMetadata().getName() + "-" + connector.getSpec().getDeployment().getDeploymentResourceVersion()).build()).withData(new HashMap<>()).addToData(Secrets.SECRET_ENTRY_SERVICE_ACCOUNT, Secrets.toBase64(Serialization.asJson(Serialization.jsonMapper().createObjectNode().put("client_id", entry.getOrDefault("kafka.client.id", uid())).put("client_secret", entry.getOrDefault("kafka.client.secret", Secrets.toBase64(uid())))))).build();
    ctx.connector(connector);
    ctx.secret(secret);
}
Also used : SecretBuilder(io.fabric8.kubernetes.api.model.SecretBuilder) DeploymentSpecBuilder(org.bf2.cos.fleetshard.api.DeploymentSpecBuilder) ManagedConnectorBuilder(org.bf2.cos.fleetshard.api.ManagedConnectorBuilder) KafkaSpecBuilder(org.bf2.cos.fleetshard.api.KafkaSpecBuilder) ManagedConnectorSpecBuilder(org.bf2.cos.fleetshard.api.ManagedConnectorSpecBuilder) ObjectMetaBuilder(io.fabric8.kubernetes.api.model.ObjectMetaBuilder) OperatorSelectorBuilder(org.bf2.cos.fleetshard.api.OperatorSelectorBuilder) Given(io.cucumber.java.en.Given)

Example 14 with Given

use of io.cucumber.java.en.Given in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class ManagedConnectorOperatorSteps method a_managedConnectorOperator.

@Given("^a ManagedConnectorOperator with:$")
public void a_managedConnectorOperator(Map<String, String> entry) {
    final String operatorId = entry.getOrDefault("operator.id", uid());
    final String operatorType = entry.get("operator.type");
    final String operatorVersion = entry.get("operator.version");
    final String operatorRuntime = entry.get("operator.runtime");
    var connector = new ManagedConnectorOperatorBuilder().withMetadata(new ObjectMetaBuilder().withName(operatorId).addToLabels(Resources.LABEL_OPERATOR_TYPE, operatorType).addToLabels(Resources.LABEL_OPERATOR_VERSION, operatorVersion).build()).withSpec(new ManagedConnectorOperatorSpecBuilder().withVersion(operatorVersion).withType(operatorType).withRuntime(operatorRuntime).build()).build();
    ctx.managedConnectorOperator(connector);
}
Also used : ManagedConnectorOperatorBuilder(org.bf2.cos.fleetshard.api.ManagedConnectorOperatorBuilder) ObjectMetaBuilder(io.fabric8.kubernetes.api.model.ObjectMetaBuilder) ManagedConnectorOperatorSpecBuilder(org.bf2.cos.fleetshard.api.ManagedConnectorOperatorSpecBuilder) Given(io.cucumber.java.en.Given)

Example 15 with Given

use of io.cucumber.java.en.Given in project open-smart-grid-platform by OSGP.

the class BundledSetAdministrativeStatusSteps method theBundleRequestContainsASetAdministrativeStatusAction.

@Given("^the bundle request contains a set administrative status action$")
public void theBundleRequestContainsASetAdministrativeStatusAction() throws Throwable {
    final SetAdministrativeStatusRequest action = new SetAdministrativeStatusRequestBuilder().withDefaults().build();
    this.addActionToBundleRequest(action);
}
Also used : SetAdministrativeStatusRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.SetAdministrativeStatusRequest) SetAdministrativeStatusRequestBuilder(org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.SetAdministrativeStatusRequestBuilder) Given(io.cucumber.java.en.Given)

Aggregations

Given (io.cucumber.java.en.Given)125 ReadSettingsHelper.getString (org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString)27 ArrayList (java.util.ArrayList)11 Transactional (org.springframework.transaction.annotation.Transactional)11 Ssld (org.opensmartgridplatform.domain.core.entities.Ssld)8 Date (java.util.Date)7 DeviceOutputSetting (org.opensmartgridplatform.domain.core.entities.DeviceOutputSetting)6 ActivityCalendar (org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.ActivityCalendar)5 Device (org.opensmartgridplatform.domain.core.entities.Device)5 RelayType (org.opensmartgridplatform.domain.core.valueobjects.RelayType)5 ByteString (com.google.protobuf.ByteString)4 Account (io.syndesis.qe.account.Account)4 File (java.io.File)4 List (java.util.List)4 ElementsCollection (com.codeborne.selenide.ElementsCollection)3 Field (java.lang.reflect.Field)3 HashMap (java.util.HashMap)3 ResponseData (org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData)3 ResponseDataBuilder (org.opensmartgridplatform.cucumber.platform.glue.steps.database.ws.ResponseDataBuilder)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2