title: How to force transaction commit in Spring Boot test?
body: <p>How can I force a transaction commit in Spring Boot (with Spring Data) <strong>while running a method</strong> and <strong>not</strong> after the method ? </p>
  
  <p>I've read here that it should be possible with <code>@Transactional(propagation = Propagation.REQUIRES_NEW)</code> in another class but doesn't work for me.</p>
  
  <p>Any hints? I'm using Spring Boot v1.5.2.RELEASE.</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @SpringBootTest
  public class CommitTest {
  
      @Autowired
      TestRepo repo;
  
      @Transactional
      @Commit
      @Test
      public void testCommit() {
          repo.createPerson();
          System.out.println("I want a commit here!");
          // ...
          System.out.println("Something after the commit...");
      }
  }
  
  @Repository
  public class TestRepo {
  
      @Autowired
      private PersonRepository personRepo;
  
      @Transactional(propagation = Propagation.REQUIRES_NEW)
      public void createPerson() {
          personRepo.save(new Person("test"));
      }
  }
  </code></pre>