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);
}
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));
}
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);
}
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);
}
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);
}
Aggregations