package com.tngtech.jgiven.junit;

import org.assertj.core.api.Assertions;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import com.tngtech.jgiven.annotation.BeforeStage;
import com.tngtech.jgiven.annotation.ExpectedScenarioState;
import com.tngtech.jgiven.annotation.ProvidedScenarioState;

public class BeforeStageInjectionTest extends SimpleScenarioTest<BeforeStageInjectionTest.BeforeStageInjectionStage> {

    @Rule
    @ProvidedScenarioState
    public TemporaryFolder folder = new TemporaryFolder();

    @Test
    public void testAfterScenario( ) {
        given().someStep();
    }

    public static class BeforeStageInjectionStage {
        @ExpectedScenarioState
        TemporaryFolder folder;

        @BeforeStage
        public void init() {
            Assertions.assertThat(folder).isNotNull();
        }

        void someStep() {
            Assertions.assertThat(folder).isNotNull();
        }
    }
}

@@ -573,27 +573,65 @@
 oid 
-testAfterScenario( 
+scenario_state_should_be_available_in_BeforeState_method(
 ) %7B%0A
@@ -857,38 +857,40 @@
 ions.assertThat(
+ 
 folder
+ 
 ).isNotNull();%0A 
@@ -959,22 +959,24 @@
 ertThat(
+ 
 folder
+ 
 ).isNotN

rename test method #364