title: Spring & Cucumber integration: @Sql import didn't execute
body: <p>I need to integrate the cucumber with spring in a practice. But I can't import some test data with spring's <code>@Sql</code> annotation. However the other integration tests that not use cucumber works fine. I didn't find why? The cucumber runner:</p>
  
  <pre><code>@RunWith(Cucumber.class)
  @CucumberOptions(features={"classpath:features/"})
  public class CucumberIT {
  
  }
  </code></pre>
  
  <p>And the step defination:</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @ContextConfiguration(classes={DevDbConfig.class})
  @Sql("classpath:test-reader-data.sql")
  @Transactional
  @ActiveProfiles("dev")
  public class StepDefines {
  
    @Autowired
    ReaderService readerService;
  
    Reader reader;
  
    @Given("^a user with name Lily$")
    public void a_user_with_name_Lily() throws Throwable {
      reader = readerService.findByName("Lily"); // reader is null here!
    }
  
    @Given("^this user Lily exists$")
    public void this_user_Lily_exists() throws Throwable {
        assertThat(reader, notNullValue());
    }
  
    @Then("^Lily's info should be returned$")
    public void lily_s_info_should_be_returned() throws Throwable {
        assertThat(reader.getName(), is("Lily"));
    }
  
  }
  </code></pre>
  
  <p>But the following testing code can import the testing data normally:</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @ContextConfiguration(classes={DevDbConfig.class})
  @Sql("classpath:test-reader-data.sql")
  @Transactional
  @ActiveProfiles("dev")
  public class ReaderServiceTest {
  
    @Autowired
    ReaderService readerService;
  
    @Autowired
    EntityManager entityManager;
  
    @Test
    public void testQueryByIdAndShouldNotReturnNull() {    
      Reader reader = readerService.findByName("Lily");
      assertThat(reader, notNullValue()); // reader is not null!
    }
  
  }
  </code></pre>
  
  <p>Thanks!</p>