## Step Annotations

JBehave supports the following method step annotations:

- @Given
- @When
- @Then
- @Alias
- @Aliases
- @Pending

Each annotation holds a regex pattern as value, which is used to match the candidate steps to the textual step:

        @Given("a stock of symbol $symbol and a threshold of $threshold")
        public void aStock(String symbol, double threshold) {
            // ...
        }

        @When("the stock is traded at $price")
        @Alias("the stock is exchanged at $price") // single alias
        public void theStockIsTradedAt(double price) {
            // ...
        }

        @Then("the alert status should be $status")
        @Aliases(values={"the trader should be alerted of status $status",
                         "the alert status is at $status"}) // multiple aliases
        public void theAlertStatusShouldBe(String status) {
            // ...
        }

The use of aliases is optional.

## Scenario Annotations

JBehave supports the following method scenario annotations:

- @BeforeScenario
- @AfterScenario

The @BeforeScenario and @AfterScenario annotations allow the corresponding methods to be executed before and after each scenario. Optionally, the ScenarioType can be specified to execute only upon that type, e.g. for scenarios parametrised by examples. In addition, @AfterScenario allows the setting of an optional Outcome value, which specifies whether the method should be executed depending on the outcome of the scenario:

        @BeforeScenario
        public void beforeEachScenario() {
            // ...
        }

        @BeforeScenario(uponType=ScenarioType.EXAMPLE)
        public void beforeEachExampleScenario() {
            // ...
        }

        @AfterScenario // equivalent to  @AfterScenario(uponOutcome=AfterScenario.Outcome.ANY)
        public void afterAnyScenario() {
            // ...
        }

        @AfterScenario(uponType=ScenarioType.EXAMPLE)
        public void afterEachExampleScenario() {
            // ...
        }

        @AfterScenario(uponOutcome=AfterScenario.Outcome.SUCCESS)
        public void afterSuccessfulScenario() {
            // ...
        }

        @AfterScenario(uponOutcome=AfterScenario.Outcome.FAILURE)
        public void afterFailedScenario() {
            // ...
        }

## Story Annotations

JBehave supports the following method story annotations:

- @BeforeStory
- @AfterStory

The @BeforeStory and @AfterStory annotations allow the corresponding methods to be executed before and after each story, either a GivenStory or not:

        @BeforeStory // equivalent to @BeforeStory(uponGivenStory=false)
        public void beforeStory() {
            // ...
        }

        @BeforeStory(uponGivenStory=true)
        public void beforeGivenStory() {
            // ...
        }

        @AfterStory // equivalent to @AfterStory(uponGivenStory=false)
        public void afterStory() {
            // ...
        }

        @AfterStory(uponGivenStory=true)
        public void afterGivenStory() {
            // ...
        }

## Stories Annotations

JBehave supports the following method stories annotations:

- @BeforeStories
- @AfterStories

The @BeforeStories and @AfterStories annotations allow the corresponding methods to be executed before and after a collection of stories:

        @BeforeStories
        public void beforeStories() {
            // ...
        }

        @AfterStories
        public void afterStories() {
            // ...
        }

## Parameter Annotations

JBehave supports the following parameter annotations:

- @Named

Parameter annotations are used in parameter injection.

## Configuration Annotations

JBehave supports the following configuration annotations:

- @AsParameterConverter
- @Configure
- @UsingEmbedder
- @UsingSteps
- @UsingGuice
- @UsingPico
- @UsingSpring