title: Better to use @Autowired or new in Spring test class?
body: <p>I was wondering about this question by having some trouble writting unit tests for my spring application. </p>
  
  <p>Let's take the following example: </p>
  
  <pre><code>@SpringBootTest
  @RunWith(SpringRunner.class)
  public class AlbumDTOConverterTest {
  
      @Autowired
      private AlbumDTOConverter albumDTOConverter;
  
      @Test
      public void ToEntity_ReturnValue_NotNull() {
          AlbumDTO albumDTO = new AlbumDTO("Summer album", new Date(), "This summer, we have made some wonderfull photos. Have a look!", null);
          assertNotNull(albumDTOConverter.toEntity(albumDTO));
      }
  }
  </code></pre>
  
  <p>In order to make <code>@Autowired</code> work properly, I am launching a container with annotating the test class with <code>@SpringBootTest</code>.</p>
  
  <p>The thing is that I think I am doing this wrong. In my opinion, I'll rather just create a new <code>instance</code> of <code>AlbumDTOConverter</code> by just using the <code>new</code> operator instead of using Spring's IoD.</p>
  
  <p>What do you guys think about this ?</p>