Search in sources :

Example 1 with StepDefinitionPattern

use of io.cucumber.messages.types.StepDefinitionPattern in project cucumber-jvm by cucumber.

the class CachingGlue method emitStepDefined.

private void emitStepDefined(CoreStepDefinition coreStepDefinition) {
    bus.send(new StepDefinedEvent(bus.getInstant(), new io.cucumber.plugin.event.StepDefinition(coreStepDefinition.getStepDefinition().getLocation(), coreStepDefinition.getExpression().getSource())));
    io.cucumber.messages.types.StepDefinition messagesStepDefinition = new io.cucumber.messages.types.StepDefinition();
    messagesStepDefinition.setId(coreStepDefinition.getId().toString());
    messagesStepDefinition.setPattern(new StepDefinitionPattern(coreStepDefinition.getExpression().getSource(), getExpressionType(coreStepDefinition)));
    coreStepDefinition.getDefinitionLocation().ifPresent(reference -> messagesStepDefinition.setSourceReference(createSourceReference(reference)));
    Envelope envelope = new Envelope();
    envelope.setStepDefinition(messagesStepDefinition);
    bus.send(envelope);
}
Also used : StepDefinitionPattern(io.cucumber.messages.types.StepDefinitionPattern) StepDefinedEvent(io.cucumber.plugin.event.StepDefinedEvent) StepDefinition(io.cucumber.core.backend.StepDefinition) Envelope(io.cucumber.messages.types.Envelope)

Aggregations

StepDefinition (io.cucumber.core.backend.StepDefinition)1 Envelope (io.cucumber.messages.types.Envelope)1 StepDefinitionPattern (io.cucumber.messages.types.StepDefinitionPattern)1 StepDefinedEvent (io.cucumber.plugin.event.StepDefinedEvent)1