title: Multiple @Before/@After with Cucumber and Spring?
body: <p>I don't understand the Cucumber configuration and cannot find any example on this.</p>
  <p>Folder structure:</p>
  <pre><code>src/
   |-test/
      |-resources/
      |  |-cucumber/
      |     |-auth/
      |     |  |-Login.feature
      |     |-contributions/
      |        |-ClearanceCertificates.feature
      |-java/
         |-de/
            |-vbg/
               |-other/
                  |-again/
                     |-important/
                        |-cucumber/
                        |  |-auth/
                        |  |  |-LoginStepDefinitions.java
                        |  |-contributions/
                        |     |-ClearanceCertificatesStepDefinitions.java
                        |-CucumberBase.java
                        |-SeleniumApplicationTests.java
  </code></pre>
  <p>CucumberBase.java:</p>
  <pre><code>@RunWith(Cucumber.class)
  @CucumberOptions(
      features = &quot;src/test/resources&quot;,
      plugin = {&quot;pretty&quot;, &quot;html:build/reports/tests/test/cucumber.html&quot;})
  public class CucumberBase {}
  </code></pre>
  <p>SeleniumApplicationTests.java:</p>
  <pre><code>@CucumberContextConfiguration
  @SpringBootTest
  class SeleniumApplicationTests {}
  </code></pre>
  <p>Both <code>*StepDefinitions.java</code> have a <code>@Before</code> and <code>@After</code> defined. My assumption was that the <code>StepDefinitions</code> are matched to the <code>*feature</code>-files based on location/package.</p>
  <p>In my tests though, the <code>Login.feature</code> executes the <code>@After</code> defined in the <code>ClearanceCertificatesStepDefinitions.java</code>.</p>
  <p>How should this be configured properly?</p>