title: Mongock (Mongobee) and Spring Boot in unit test
body: <p>I have the following dummy class:</p>
  
  <pre><code>@Document("items")
  static class Item {
      int i;
  
      public Item() {
      }
  
      public Item(int i) {
          this.i = i;
      }
  
      public int getI() {
          return i;
      }
  }
  </code></pre>
  
  <p>And here's a simple <code>@Changeset</code>:</p>
  
  <pre><code>//@Autowired
  @ChangeSet(order = "001", id = "add_items", author = "tester")
  public void changeset1(MongoTemplate mongoTemplate) {
      for (int i = 0; i &lt; NUM_OF_DB_ITEMS; i++) {
          mongoTemplate.insert(new Item(i));
      }
  }
  </code></pre>
  
  <p>After <code>@Changeset</code> is called, the unit test is running (Notice that mongoTemplate is <code>@Autowired</code>)</p>
  
  <pre><code>@Test
  public void test() {
      List&lt;Item&gt; items = mongoTemplate.findAll(Item.class);
      System.out.println(items);
  }
  </code></pre>
  
  <p>Problem: I'm getting zero items from <code>findAll()</code> </p>
  
  <p>I found that when I'm adding <code>@Autowired</code> to <code>changeset1()</code> it does work (commented above) - I'm getting all items.</p>
  
  <p>Can you explain why? In the <a href="https://github.com/cloudyrock/mongock#defining-changeset-methods" rel="nofollow noreferrer">examples</a>, I don't see they need to <code>@Autowired</code></p>
  
  <p>Should I even do that? I mean, can it damage the locking mechanism of Mongock?</p>